r67576 - in /branches/upstream/libnet-github-perl/current: Changes MANIFEST META.yml lib/Net/GitHub.pm lib/Net/GitHub/V2.pm lib/Net/GitHub/V2/PullRequest.pm

angelabad-guest at users.alioth.debian.org angelabad-guest at users.alioth.debian.org
Thu Jan 20 20:11:21 UTC 2011


Author: angelabad-guest
Date: Thu Jan 20 20:09:58 2011
New Revision: 67576

URL: http://svn.debian.org/wsvn/pkg-perl/?sc=1&rev=67576
Log:
[svn-upgrade] new version libnet-github-perl (0.26)

Added:
    branches/upstream/libnet-github-perl/current/lib/Net/GitHub/V2/PullRequest.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=67576&op=diff
==============================================================================
--- branches/upstream/libnet-github-perl/current/Changes (original)
+++ branches/upstream/libnet-github-perl/current/Changes Thu Jan 20 20:09:58 2011
@@ -1,4 +1,10 @@
 Revision history for Net-GitHub
+
+0.26    2011.01.20
+        fix Makefile.PL
+
+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=67576&op=diff
==============================================================================
--- branches/upstream/libnet-github-perl/current/MANIFEST (original)
+++ branches/upstream/libnet-github-perl/current/MANIFEST Thu Jan 20 20:09:58 2011
@@ -30,6 +30,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=67576&op=diff
==============================================================================
--- branches/upstream/libnet-github-perl/current/META.yml (original)
+++ branches/upstream/libnet-github-perl/current/META.yml Thu Jan 20 20:09:58 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.26

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=67576&op=diff
==============================================================================
--- branches/upstream/libnet-github-perl/current/lib/Net/GitHub.pm (original)
+++ branches/upstream/libnet-github-perl/current/lib/Net/GitHub.pm Thu Jan 20 20:09:58 2011
@@ -2,7 +2,7 @@
 
 use Any::Moose;
 
-our $VERSION = '0.24';
+our $VERSION = '0.26';
 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=67576&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 Thu Jan 20 20:09:58 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=67576&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 Thu Jan 20 20:09:58 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