[Bps-public-commit] SD branch, master, updated. a2bf82f2d000b31c782482b4a0497b3f2b166a63

sunnavy at bestpractical.com sunnavy at bestpractical.com
Mon Jun 22 23:24:59 EDT 2009


The branch, master has been updated
       via  a2bf82f2d000b31c782482b4a0497b3f2b166a63 (commit)
       via  bcac84ef7ac2e31bee5c8f7ed471c9beb986f162 (commit)
      from  f95cff9f028b8b13cc8a67e59e84b7f149ae567a (commit)

Summary of changes:
 lib/App/SD/Replica/github.pm |   19 ++++++++++++-------
 1 files changed, 12 insertions(+), 7 deletions(-)

- Log -----------------------------------------------------------------
commit bcac84ef7ac2e31bee5c8f7ed471c9beb986f162
Author: sunnavy <sunnavy at bestpractical.com>
Date:   Tue Jun 23 11:24:28 2009 +0800

    tweak github repo format: github:owner/repository or github:http://github.com/owner/repository

diff --git a/lib/App/SD/Replica/github.pm b/lib/App/SD/Replica/github.pm
index 819f729..5c35280 100644
--- a/lib/App/SD/Replica/github.pm
+++ b/lib/App/SD/Replica/github.pm
@@ -27,16 +27,21 @@ sub BUILD {
     my $self = shift;
 
     my ( $server, $owner, $repo ) =
-      $self->{url} =~ m/^github:(.*?)\|(.+)\|(.+)\|$/
+      $self->{url} =~ m{^github:(http://.*?github.com/)?(.*?)/(.*)}
       or die
-"Can't parse Github server spec. Expected github:http://user\@github.com|owner|repository|";
+"Can't parse Github server spec. Expected github:owner/repository or github:http://github.com/owner/repository";
 
+    my ( $uri, $username, $apikey );
 
-    my $uri = URI->new($server);
-    my ( $username, $apikey );
-    if ( my $auth = $uri->userinfo ) {
-        ( $username, $apikey ) = split /:/, $auth, 2;
-        $uri->userinfo(undef);
+    if ($server) {
+        $uri = URI->new($server);
+        if ( my $auth = $uri->userinfo ) {
+            ( $username, $apikey ) = split /:/, $auth, 2;
+            $uri->userinfo(undef);
+        }
+    }
+    else {
+        $uri = 'http://github.com/';
     }
 
     ( $username, $apikey ) = $self->prompt_for_login( $uri, $username ) unless $apikey ;

commit a2bf82f2d000b31c782482b4a0497b3f2b166a63
Merge: bcac84e... f95cff9...
Author: sunnavy <sunnavy at bestpractical.com>
Date:   Tue Jun 23 11:24:49 2009 +0800

    Merge branch 'master' of code.bestpractical.com:/git/sd


-----------------------------------------------------------------------



More information about the Bps-public-commit mailing list