Changeset 2397

Show
Ignore:
Timestamp:
11/26/07 09:01:19
Author:
miyagawa
Message:

Checking in changes prior to tagging of version 0.24. Changelog diff is:

=== Changes
==================================================================
--- Changes (revision 9085)
+++ Changes (local)
@@ -1,5 +1,10 @@

Revision history for Perl extension Web
Scraper

+0.24 Sun Nov 25 15:58:38 PST 2007
+ - Support duck typing in filter args to take object that has 'filter' method
+ This could give Web::Scraper::Filter::Pipe a better interface
+ (Thanks to hanekomu and tokuhirom)
+

0.23 Sat Nov 24 17:21:14 PST 2007

- Upped Web
Scraper dependency
- Skip & test until HTML::TreeBuilder?
XPath fixes it

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • Web-Scraper/trunk/Changes

    r2395 r2397  
    11Revision history for Perl extension Web::Scraper 
     2 
     30.24  Sun Nov 25 15:58:38 PST 2007 
     4        - Support duck typing in filter args to take object that has 'filter' method 
     5          This could give Web::Scraper::Filter::Pipe a better interface 
     6          (Thanks to hanekomu and tokuhirom) 
    27 
    380.23  Sat Nov 24 17:21:14 PST 2007 
  • Web-Scraper/trunk/lib/Web/Scraper.pm

    r2395 r2397  
    1111use UNIVERSAL::require; 
    1212 
    13 our $VERSION = '0.23'; 
     13our $VERSION = '0.24'; 
    1414 
    1515sub import { 
     
    219219            $module->require or Carp::croak("Loading $module: $@"); 
    220220        } 
    221  
    222221        $callback = sub { $module->new->filter(shift) }; 
     222    } elsif (blessed($filter) && $filter->can('filter')) { 
     223        $callback = sub { $filter->filter(shift) }; 
    223224    } else { 
    224225        Carp::croak("Don't know filter type $filter"); 
  • Web-Scraper/trunk/t/16_filter.t

    r2368 r2397  
    8989--- expected 
    90903 
     91 
     92=== object 
     93--- want 
     94['TEXT', Web::Scraper::Filter::foo->new] 
     95--- expected 
     96gpp