r67534 - in /branches/upstream/libnet-github-perl/current: ./ inc/Module/Install/ lib/Net/ lib/Net/GitHub/ lib/Net/GitHub/V2/
angelabad-guest at users.alioth.debian.org
angelabad-guest at users.alioth.debian.org
Wed Jan 19 15:25:21 UTC 2011
Author: angelabad-guest
Date: Wed Jan 19 15:24:49 2011
New Revision: 67534
URL: http://svn.debian.org/wsvn/pkg-perl/?sc=1&rev=67534
Log:
[svn-upgrade] new version libnet-github-perl (0.25)
Added:
branches/upstream/libnet-github-perl/current/lib/Net/GitHub/V2/PullRequest.pm
Removed:
branches/upstream/libnet-github-perl/current/inc/Module/Install/Can.pm
branches/upstream/libnet-github-perl/current/inc/Module/Install/Fetch.pm
branches/upstream/libnet-github-perl/current/inc/Module/Install/Win32.pm
branches/upstream/libnet-github-perl/current/inc/Module/Install/WriteAll.pm
Modified:
branches/upstream/libnet-github-perl/current/Changes
branches/upstream/libnet-github-perl/current/MANIFEST
branches/upstream/libnet-github-perl/current/META.yml
branches/upstream/libnet-github-perl/current/lib/Net/GitHub.pm
branches/upstream/libnet-github-perl/current/lib/Net/GitHub/V2.pm
Modified: branches/upstream/libnet-github-perl/current/Changes
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libnet-github-perl/current/Changes?rev=67534&op=diff
==============================================================================
--- branches/upstream/libnet-github-perl/current/Changes (original)
+++ branches/upstream/libnet-github-perl/current/Changes Wed Jan 19 15:24:49 2011
@@ -1,4 +1,7 @@
Revision history for Net-GitHub
+
+0.25 2011.01.19
+ partial implementation of Pull Request API (doy)
0.24 2011.01.01
Organizations API (fayland)
Modified: branches/upstream/libnet-github-perl/current/MANIFEST
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libnet-github-perl/current/MANIFEST?rev=67534&op=diff
==============================================================================
--- branches/upstream/libnet-github-perl/current/MANIFEST (original)
+++ branches/upstream/libnet-github-perl/current/MANIFEST Wed Jan 19 15:24:49 2011
@@ -4,13 +4,9 @@
inc/Module/Install.pm
inc/Module/Install/AutoInstall.pm
inc/Module/Install/Base.pm
-inc/Module/Install/Can.pm
-inc/Module/Install/Fetch.pm
inc/Module/Install/Include.pm
inc/Module/Install/Makefile.pm
inc/Module/Install/Metadata.pm
-inc/Module/Install/Win32.pm
-inc/Module/Install/WriteAll.pm
lib/Net/GitHub.pm
lib/Net/GitHub/V1.pm
lib/Net/GitHub/V1/Project.pm
@@ -30,6 +26,7 @@
lib/Net/GitHub/V2/NoRepo.pm
lib/Net/GitHub/V2/Object.pm
lib/Net/GitHub/V2/Organizations.pm
+lib/Net/GitHub/V2/PullRequest.pm
lib/Net/GitHub/V2/Repositories.pm
lib/Net/GitHub/V2/Users.pm
Makefile.PL
Modified: branches/upstream/libnet-github-perl/current/META.yml
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libnet-github-perl/current/META.yml?rev=67534&op=diff
==============================================================================
--- branches/upstream/libnet-github-perl/current/META.yml (original)
+++ branches/upstream/libnet-github-perl/current/META.yml Wed Jan 19 15:24:49 2011
@@ -33,4 +33,4 @@
resources:
license: http://dev.perl.org/licenses/
repository: http://github.com/fayland/perl-net-github/tree/master
-version: 0.24
+version: 0.25
Modified: branches/upstream/libnet-github-perl/current/lib/Net/GitHub.pm
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libnet-github-perl/current/lib/Net/GitHub.pm?rev=67534&op=diff
==============================================================================
--- branches/upstream/libnet-github-perl/current/lib/Net/GitHub.pm (original)
+++ branches/upstream/libnet-github-perl/current/lib/Net/GitHub.pm Wed Jan 19 15:24:49 2011
@@ -2,7 +2,7 @@
use Any::Moose;
-our $VERSION = '0.24';
+our $VERSION = '0.25';
our $AUTHORITY = 'cpan:FAYLAND';
sub new {
Modified: branches/upstream/libnet-github-perl/current/lib/Net/GitHub/V2.pm
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libnet-github-perl/current/lib/Net/GitHub/V2.pm?rev=67534&op=diff
==============================================================================
--- branches/upstream/libnet-github-perl/current/lib/Net/GitHub/V2.pm (original)
+++ branches/upstream/libnet-github-perl/current/lib/Net/GitHub/V2.pm Wed Jan 19 15:24:49 2011
@@ -12,6 +12,7 @@
use Net::GitHub::V2::Object;
use Net::GitHub::V2::Network;
use Net::GitHub::V2::Organizations;
+use Net::GitHub::V2::PullRequest;
with 'Net::GitHub::V2::HasRepo';
@@ -91,6 +92,16 @@
},
);
+has 'pull_request' => (
+ is => 'rw',
+ isa => 'Net::GitHub::V2::PullRequest',
+ lazy => 1,
+ default => sub {
+ my $self = shift;
+ return Net::GitHub::V2::PullRequest->new( $self->args_to_pass );
+ },
+);
+
no Any::Moose;
__PACKAGE__->meta->make_immutable;
@@ -184,6 +195,12 @@
L<Net::GitHub::V2::Organizations>
+=head2 pull_request
+
+ my $pull = $github->pull_request->pull_request();
+
+L<Net::GitHub::V2::PullRequest>
+
=head1 SEE ALSO
L<Any::Moose>
Added: branches/upstream/libnet-github-perl/current/lib/Net/GitHub/V2/PullRequest.pm
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libnet-github-perl/current/lib/Net/GitHub/V2/PullRequest.pm?rev=67534&op=file
==============================================================================
--- branches/upstream/libnet-github-perl/current/lib/Net/GitHub/V2/PullRequest.pm (added)
+++ branches/upstream/libnet-github-perl/current/lib/Net/GitHub/V2/PullRequest.pm Wed Jan 19 15:24:49 2011
@@ -1,0 +1,88 @@
+package Net::GitHub::V2::PullRequest;
+
+use Any::Moose;
+
+our $VERSION = '0.25';
+our $AUTHORITY = 'cpan:DOY';
+
+with 'Net::GitHub::V2::HasRepo';
+
+sub pull_request {
+ my ( $self, %params ) = @_;
+
+ my $owner = $self->owner;
+ my $repo = $self->repo;
+
+ $params{base} ||= 'master';
+ $params{head} ||= $self->login . ':master';
+ unless (exists $params{issue}) {
+ $params{title} ||= '';
+ $params{body} ||= '';
+ }
+
+ %params = map { ("pull[$_]" => $params{$_}) }
+ grep { /^(?:base|head|title|body|issue)$/ }
+ keys %params;
+
+ return $self->get_json_to_obj_authed( "pulls/$owner/$repo", %params, 'pull' );
+}
+
+no Any::Moose;
+__PACKAGE__->meta->make_immutable;
+
+1;
+__END__
+=head1 NAME
+
+Net::GitHub::V2::PullRequest - GitHub Pull Request API
+
+=head1 SYNOPSIS
+
+ use Net::GitHub::V2::PullRequest;
+
+ my $pulls = Net::GitHub::V2::PullRequest->new(
+ owner => 'fayland', repo => 'perl-net-github'
+ );
+
+=head1 DESCRIPTION
+
+L<http://develop.github.com/p/pulls.html>
+
+For those B<(authentication required)> below, you must set login and token (in L<https://github.com/account>
+
+ my $pulls = Net::GitHub::V2::PullRequest->new(
+ owner => 'fayland', repo => 'perl-net-github',
+ login => 'fayland', token => '54b5197d7f92f52abc5c7149b313cf51', # faked
+ );
+
+=head1 METHODS
+
+=over 4
+
+=item pull_request
+
+ my $pull = $pulls->pull_request(
+ base => 'master',
+ head => 'someone:master',
+ title => 'fix',
+ body => 'fix this bug',
+ );
+
+Create a pull request (authentication required). The request will be made on
+C<< <owner>/<base> >> to pull in changes in C<head>. C<base> defaults to
+C<master>, and C<head> defaults to C<< <login>:master >>.
+
+=back
+
+=head1 AUTHOR
+
+Fayland Lam, C<< <fayland at gmail.com> >>
+
+Jesse Luehrs C<doy at tozt dot net>
+
+=head1 COPYRIGHT & LICENSE
+
+Copyright 2011 Fayland Lam, Jesse Luehrs all rights reserved.
+
+This program is free software; you can redistribute it and/or modify it
+under the same terms as Perl itself.
More information about the Pkg-perl-cvs-commits
mailing list