[Bps-public-commit] r19687 - in Net-Google-Code/trunk/lib/Net/Google/Code: Issue

sunnavy at bestpractical.com sunnavy at bestpractical.com
Fri May 15 05:20:20 EDT 2009


Author: sunnavy
Date: Fri May 15 05:20:20 2009
New Revision: 19687

Modified:
   Net-Google-Code/trunk/lib/Net/Google/Code/Issue.pm
   Net-Google-Code/trunk/lib/Net/Google/Code/Issue/Attachment.pm
   Net-Google-Code/trunk/lib/Net/Google/Code/Issue/Comment.pm

Log:
refactor a tiny bit

Modified: Net-Google-Code/trunk/lib/Net/Google/Code/Issue.pm
==============================================================================
--- Net-Google-Code/trunk/lib/Net/Google/Code/Issue.pm	(original)
+++ Net-Google-Code/trunk/lib/Net/Google/Code/Issue.pm	Fri May 15 05:20:20 2009
@@ -74,7 +74,7 @@
     my $author_tag = $description->look_down( class => "author" );
     $self->state->{reporter} = $author_tag->content_array_ref->[1]->as_text;
     $self->state->{reported} =
-      $author_tag->look_down( class => 'date' )->attr_get_i('title');
+      $author_tag->look_down( class => 'date' )->attr('title');
     my $text = $description->find_by_tag_name('pre')->as_text;
     $text =~ s/^\s+//;
     $text =~ s/\s+$/\n/;
@@ -90,6 +90,7 @@
 
     my ($meta) = $tree->look_down( id => 'issuemeta' );
     my @meta = $meta->find_by_tag_name('tr');
+    my @labels;
     for my $meta (@meta) {
 
         my ( $key, $value );
@@ -114,13 +115,13 @@
             $self->state->{ lc $key } = $value;
         }
         else {
-            my $href = $meta->find_by_tag_name('a')->attr_get_i('href');
-
+            my $href = $meta->look_down( class => 'label' )->attr('href');
             if ( $href =~ /list\?q=label:(.+)/ ) {
-                $self->labels( [ @{$self->labels}, $1 ] );
+                push @labels, $1;
             }
         }
     }
+    $self->labels( \@labels );
 
     # extract comments
     my @comments_tag = $tree->look_down( class => 'vt issuecomment' );

Modified: Net-Google-Code/trunk/lib/Net/Google/Code/Issue/Attachment.pm
==============================================================================
--- Net-Google-Code/trunk/lib/Net/Google/Code/Issue/Attachment.pm	(original)
+++ Net-Google-Code/trunk/lib/Net/Google/Code/Issue/Attachment.pm	Fri May 15 05:20:20 2009
@@ -39,7 +39,7 @@
         $size =~ s/\s+$//;
         $self->size($size);
 
-        $self->url( $td->find_by_tag_name('a')->attr_get_i('href') );
+        $self->url( $td->find_by_tag_name('a')->attr('href') );
     }
 
     return 1;

Modified: Net-Google-Code/trunk/lib/Net/Google/Code/Issue/Comment.pm
==============================================================================
--- Net-Google-Code/trunk/lib/Net/Google/Code/Issue/Comment.pm	(original)
+++ Net-Google-Code/trunk/lib/Net/Google/Code/Issue/Comment.pm	Fri May 15 05:20:20 2009
@@ -23,7 +23,7 @@
     my @a       = $author->find_by_tag_name('a');
     $self->sequence( $a[0]->content_array_ref->[0] );
     $self->author( $a[1]->content_array_ref->[0] );
-    $self->date( $element->look_down( class => 'date' )->attr_get_i('title') );
+    $self->date( $element->look_down( class => 'date' )->attr('title') );
     my $content = $element->find_by_tag_name('pre')->as_text;
     $content =~ s/^\s+//;
     $content =~ s/\s+$/\n/;



More information about the Bps-public-commit mailing list