[Bps-public-commit] Net-Google-Code branch, master, updated. dc1aba9696a46e1939e947fed6501ee2fd07324f

sunnavy at bestpractical.com sunnavy at bestpractical.com
Fri Jan 29 00:20:37 EST 2010


The branch, master has been updated
       via  dc1aba9696a46e1939e947fed6501ee2fd07324f (commit)
      from  91a485d48b31489533b168e532dc0fe76e7c1abd (commit)

Summary of changes:
 Changes                                 |    4 ++++
 lib/Net/Google/Code/Issue.pm            |    3 ++-
 lib/Net/Google/Code/Issue/Attachment.pm |    5 +++--
 3 files changed, 9 insertions(+), 3 deletions(-)

- Log -----------------------------------------------------------------
commit dc1aba9696a46e1939e947fed6501ee2fd07324f
Author: sunnavy <sunnavy at bestpractical.com>
Date:   Fri Jan 29 13:20:04 2010 +0800

    can't set attr to $1 right after the regex if the attr isa Int in current Mouse, so weird :/

diff --git a/Changes b/Changes
index 2dffbce..c26809d 100644
--- a/Changes
+++ b/Changes
@@ -1,5 +1,9 @@
 Revision history for Net-Google-Code
 
+0.17 Fri Jan 29 04:15:09 UTC 2010
+
+* work around a weird bug of Mouse or even perl itself
+
 0.16 Tue Dec 22 03:31:43 UTC 2009
 
 * update issue part since google changed attachments snippet
diff --git a/lib/Net/Google/Code/Issue.pm b/lib/Net/Google/Code/Issue.pm
index c921452..4cf29ea 100644
--- a/lib/Net/Google/Code/Issue.pm
+++ b/lib/Net/Google/Code/Issue.pm
@@ -160,7 +160,8 @@ sub parse {
         {
 # the \w+ is person or people, I don't know if google will change that word
 # some time, so just use \w+
-            $self->stars($1);
+            my $stars = $1;
+            $self->stars($stars);
         }
     }
 
diff --git a/lib/Net/Google/Code/Issue/Attachment.pm b/lib/Net/Google/Code/Issue/Attachment.pm
index 7fdd3c0..637a8e5 100644
--- a/lib/Net/Google/Code/Issue/Attachment.pm
+++ b/lib/Net/Google/Code/Issue/Attachment.pm
@@ -55,8 +55,9 @@ sub parse {
     my @tds = $tr->find_by_tag_name('td');
     if (@tds) {
         $self->url( $tds[0]->find_by_tag_name('a')->attr('href') );
-        if ( $self->url =~ /aid=([-\d]+)/ ) {
-            $self->id( $1 );
+        if ( $self->url =~ /aid=(-?\d+)/ ) {
+            my $id = $1;
+            $self->id( $id );
         }
 
         if ( $tds[1] ) {

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



More information about the Bps-public-commit mailing list