[Bps-public-commit] r18277 - in Net-Google-Code/branches/write: .

sunnavy at bestpractical.com sunnavy at bestpractical.com
Sat Feb 7 04:47:06 EST 2009


Author: sunnavy
Date: Sat Feb  7 04:47:05 2009
New Revision: 18277

Modified:
   Net-Google-Code/branches/write/   (props changed)
   Net-Google-Code/branches/write/lib/Net/Google/Code/Role/Authentication.pm

Log:
 r19682 at sunnavys-mb:  sunnavy | 2009-02-07 17:43:30 +0800
 added signout method


Modified: Net-Google-Code/branches/write/lib/Net/Google/Code/Role/Authentication.pm
==============================================================================
--- Net-Google-Code/branches/write/lib/Net/Google/Code/Role/Authentication.pm	(original)
+++ Net-Google-Code/branches/write/lib/Net/Google/Code/Role/Authentication.pm	Sat Feb  7 04:47:05 2009
@@ -36,6 +36,17 @@
     return 1;
 }
 
+sub signout {
+    my $self = shift;
+    $self->mech->follow_link(
+        url_regex => qr!^https?://www\.google\.com/accounts/Logout! )
+      || $self->mech->get('https://www.google.com/accounts/Logout');
+    die 'sign out failed to google code'
+      unless $self->mech->content =~ m!Sign In!;
+
+    return 1;
+}
+
 sub ask_password {
     my $self = shift;
     while ( !defined $self->password or $self->password eq '' ) {
@@ -64,6 +75,10 @@
 
 sign in
 
+=head2 signout
+
+sign out
+
 =head2 ask_password
 
 ask user to input password



More information about the Bps-public-commit mailing list