[libnet-github-perl] 01/04: Imported Upstream version 0.53

Angel Abad angel at alioth.debian.org
Sun Sep 1 20:32:55 UTC 2013


This is an automated email from the git hooks/post-receive script.

angel pushed a commit to branch master
in repository libnet-github-perl.

commit 6197f6ef9f12567ee16d2c8f7c15ca3798b57bd7
Author: Angel Abad <angelabad at gmail.com>
Date:   Sun Sep 1 22:24:10 2013 +0200

    Imported Upstream version 0.53
---
 Changes                    |    3 +++
 META.yml                   |    2 +-
 README                     |   44 ++++++++++++++++++++++++++++++++++----------
 lib/Net/GitHub.pm          |    2 +-
 lib/Net/GitHub/V3/Repos.pm |   17 ++++++++++++++++-
 5 files changed, 55 insertions(+), 13 deletions(-)

diff --git a/Changes b/Changes
index 697ef9f..ca783c8 100644
--- a/Changes
+++ b/Changes
@@ -1,5 +1,8 @@
 Revision history for Net-GitHub
 
+0.53    2013.09.01
+        - listing all public repos (kimmel)
+
 0.52    2013.03.28
         - Fix argument handling for pulls (dagolden)
 
diff --git a/META.yml b/META.yml
index eee02f8..2345a3d 100644
--- a/META.yml
+++ b/META.yml
@@ -37,4 +37,4 @@ requires:
 resources:
   license: http://dev.perl.org/licenses/
   repository: https://github.com/fayland/perl-net-github
-version: 0.52
+version: 0.53
diff --git a/README b/README
index b63e1f5..68c6816 100644
--- a/README
+++ b/README
@@ -4,22 +4,28 @@ NAME
 SYNOPSIS
         use Net::GitHub;
 
-        my $github = Net::GitHub->new( login => 'fayland', pass => 'secret' ); # default to Net::GitHub::V3
+        my $github = Net::GitHub->new(  # Net::GitHub::V3
+            login => 'fayland', pass => 'secret'
+        );
+
+        # Pass api_url for GitHub Enterprise installations
+        my $github = Net::GitHub->new(  # Net::GitHub::V3
+            login => 'fayland', pass => 'secret',  api_url => 'https://gits.aresweet.com/api/v3'
+        );
 
-        # for backwards
-        my $github = Net::GitHub->new(  # Net::GitHub::V2
-            version => 2,
-            owner => 'fayland', name => 'perl-net-github'
+        # suggested
+        # use OAuth to create token with user/pass
+        my $github = Net::GitHub->new(  # Net::GitHub::V3
+            access_token => $token
         );
-    
-        # for V3
+
         # L<Net::GitHub::V3::Users>
         my $user = $github->user->show('nothingmuch');
         $github->user->update( bio => 'Just Another Perl Programmer' );
-    
+
         # L<Net::GitHub::V3::Repos>
         my @repos = $github->repos->list;
-        my $rp = $github->->create( {
+        my $rp = $github->repos->create( {
             "name" => "Hello-World",
             "description" => "This is your first repo",
             "homepage" => "https://github.com"
@@ -38,6 +44,24 @@ DESCRIPTION
     If you prefer object oriented way, Pithub is 'There is more than one way
     to do it'.
 
+  FAQ
+    *   create access_token for Non-Web Application
+
+            my $gh = Net::GitHub::V3->new( login => 'fayland', pass => 'secret' );
+            my $oauth = $gh->oauth;
+            my $o = $oauth->create_authorization( {
+                scopes => ['user', 'public_repo', 'repo', 'gist'], # just ['public_repo']
+                note   => 'test purpose',
+            } );
+            print $o->{token};
+
+        after create the token, you can use it without your password
+        publicly written
+
+            my $github = Net::GitHub->new(
+                access_token => $token, # from above
+            );
+
 Git
     <http://github.com/fayland/perl-net-github/>
 
@@ -50,7 +74,7 @@ AUTHOR
     Everyone who is listed in Changes.
 
 COPYRIGHT & LICENSE
-    Copyright 2009-2011 Fayland Lam all rights reserved.
+    Copyright 2009-2012 Fayland Lam all rights reserved.
 
     This program is free software; you can redistribute it and/or modify it
     under the same terms as Perl itself.
diff --git a/lib/Net/GitHub.pm b/lib/Net/GitHub.pm
index 07fe997..c633023 100644
--- a/lib/Net/GitHub.pm
+++ b/lib/Net/GitHub.pm
@@ -3,7 +3,7 @@ package Net::GitHub;
 use Any::Moose;
 use Net::GitHub::V3;
 
-our $VERSION = '0.52';
+our $VERSION = '0.53';
 our $AUTHORITY = 'cpan:FAYLAND';
 
 sub new {
diff --git a/lib/Net/GitHub/V3/Repos.pm b/lib/Net/GitHub/V3/Repos.pm
index 4dcec09..6cac6b1 100644
--- a/lib/Net/GitHub/V3/Repos.pm
+++ b/lib/Net/GitHub/V3/Repos.pm
@@ -2,7 +2,7 @@ package Net::GitHub::V3::Repos;
 
 use Any::Moose;
 
-our $VERSION = '0.50';
+our $VERSION = '0.53';
 our $AUTHORITY = 'cpan:FAYLAND';
 
 use URI::Escape;
@@ -18,6 +18,14 @@ sub list {
     return $self->query($u);
 }
 
+sub list_all {
+    my ( $self, $since ) = @_;
+    $since ||= 'first';
+    my $u = '/repositories';
+    $u .= '?since=' . $since if $since ne 'first';
+    return $self->query($u);
+}
+
 sub list_user {
     my ($self, $user, $type) = @_;
     $user ||= $self->u;
@@ -225,6 +233,13 @@ L<http://developer.github.com/v3/repos/>
 
 =item list
 
+=item list_all
+
+    # All public repositories on Github
+    my @rp = $repos->list_all;
+    # starting at id 500
+    my @rp = $repos->list_all(500);
+
 =item list_user
 
 =item list_org

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-perl/packages/libnet-github-perl.git



More information about the Pkg-perl-cvs-commits mailing list