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

sunnavy at bestpractical.com sunnavy at bestpractical.com
Fri Dec 26 03:24:52 EST 2008


Author: sunnavy
Date: Fri Dec 26 03:24:50 2008
New Revision: 17372

Modified:
   Net-Google-Code/trunk/   (props changed)
   Net-Google-Code/trunk/lib/Net/Google/Code/Ticket.pm

Log:
 r18310 at sunnavys-mb:  sunnavy | 2008-12-26 15:43:29 +0800
 extract description as text; fix typo


Modified: Net-Google-Code/trunk/lib/Net/Google/Code/Ticket.pm
==============================================================================
--- Net-Google-Code/trunk/lib/Net/Google/Code/Ticket.pm	(original)
+++ Net-Google-Code/trunk/lib/Net/Google/Code/Ticket.pm	Fri Dec 26 03:24:50 2008
@@ -56,10 +56,17 @@
     my ($summary) = $tree->look_down(class => 'h3' );
     $self->state->{summary} = $summary->content_array_ref->[0];
 
-    # extract reporter
-    $self->state->{reporter} = 
-      $summary->look_down( class => "author" )->content_array_ref->[1]
+    # extract reporter and description
+    my $description = $tree->look_down(class => 'vt issuedescription' );
+    $self->state->{reporter} =
+      $description->look_down( class => "author" )->content_array_ref->[1]
       ->content_array_ref->[0];
+    my $text = $description->find_by_tag_name('pre')->as_text;
+    $text =~ s/^\s+//;
+    $text =~ s/\s+$//;
+    $self->state->{description} = $text;
+    # TODO extract attachments if there are some
+
 
     my ($meta) = $tree->look_down( id => 'issuemeta' );
     my @meta = $meta->find_by_tag_name('tr');



More information about the Bps-public-commit mailing list