Changeset 36336

Show
Ignore:
Timestamp:
01/03/10 09:41:54 (5 years ago)
Author:
tomi-ru
Message:

merge danjo branch

Location:
lang/perl/HTML-MobileJp-Filter/trunk
Files:
5 added
4 removed
12 modified

Legend:

Unmodified
Added
Removed
  • lang/perl/HTML-MobileJp-Filter/trunk/Makefile.PL

    r18802 r36336  
    44all_from 'lib/HTML/MobileJp/Filter.pm'; 
    55 
    6 requires 'Moose' => 0.55; 
    7 requires 'Moose::Role'; 
     6requires_any_moose; 
    87requires 'Class::Trigger'; 
    9 requires 'Class::MOP'; 
    108requires 'XML::LibXML'; 
    119 
     
    1614requires 'HTML::StickyQuery::DoCoMoGUID'; 
    1715requires 'HTML::Entities::ConvertPictogramMobileJp'; 
     16requires 'HTTP::Headers'; 
    1817requires 'YAML'; 
     18requires 'HTTP::MobileAgent'; 
     19 
     20tests 't/*.t'; 
     21author_tests 'xt'; 
    1922 
    2023test_requires 'Test::More'; 
    2124test_requires 'Test::Base'; 
    22 test_requires 'HTTP::MobileAgent'; 
    2325 
    2426use_test_base; 
  • lang/perl/HTML-MobileJp-Filter/trunk/lib/HTML/MobileJp/Filter.pm

    r18802 r36336  
    11package HTML::MobileJp::Filter; 
    2 use Moose; 
     2use Any::Moose; 
    33our $VERSION = '0.01_03'; 
    44 
     
    66    is      => 'rw', 
    77    isa     => 'ArrayRef', 
     8    required => 1, 
     9    auto_deref => 1, 
    810    default => sub { [] }, 
    911); 
     
    1517); 
    1618 
    17 no Moose; 
    18 __PACKAGE__->meta->make_immutable; 
     19no Any::Moose; 
    1920 
    2021use Class::Trigger; 
    21 use Class::MOP; 
    2222use HTML::MobileJp::Filter::Content; 
    2323 
    24 sub new { 
    25     my $self = shift->SUPER::new(@_); 
    26      
     24sub BUILD { 
     25    my ($self) = @_; 
    2726    for my $config (@{ $self->filters }) { 
    2827        my $filter = do { 
    2928            my $module = $config->{module} =~ m{^\+(.*)$} ? $1 : __PACKAGE__ ."::$config->{module}"; 
    30             Class::MOP::load_class($module); 
     29            Any::Moose::load_class($module); 
    3130            $module->new($config); 
    3231        }; 
     
    4241        }); 
    4342    } 
    44      
    45     $self; 
    4643} 
    4744 
     
    5855    $self->stash->{content}->as_html; 
    5956} 
     57 
     58__PACKAGE__->meta->make_immutable; 
    6059 
    61601; 
  • lang/perl/HTML-MobileJp-Filter/trunk/lib/HTML/MobileJp/Filter/Content.pm

    r18799 r36336  
    11package HTML::MobileJp::Filter::Content; 
    2 use Moose; 
     2use Any::Moose; 
    33 
    44has _current => ( 
     
    5656} 
    5757 
     58__PACKAGE__->meta->make_immutable; 
    58591; 
  • lang/perl/HTML-MobileJp-Filter/trunk/lib/HTML/MobileJp/Filter/DoCoMoCSS.pm

    r18800 r36336  
    11package HTML::MobileJp::Filter::DoCoMoCSS; 
    2 use Moose; 
     2use Any::Moose; 
    33 
    44with 'HTML::MobileJp::Filter::Role'; 
  • lang/perl/HTML-MobileJp-Filter/trunk/lib/HTML/MobileJp/Filter/DoCoMoGUID.pm

    r18800 r36336  
    11package HTML::MobileJp::Filter::DoCoMoGUID; 
    2 use Moose; 
     2use Any::Moose; 
    33 
    44with 'HTML::MobileJp::Filter::Role'; 
  • lang/perl/HTML-MobileJp-Filter/trunk/lib/HTML/MobileJp/Filter/Dummy.pm

    r18800 r36336  
    11package HTML::MobileJp::Filter::Dummy; 
    2 use Moose; 
     2use Any::Moose; 
    33 
    44with 'HTML::MobileJp::Filter::Role'; 
  • lang/perl/HTML-MobileJp-Filter/trunk/lib/HTML/MobileJp/Filter/EntityReference.pm

    r18800 r36336  
    11package HTML::MobileJp::Filter::EntityReference; 
    2 use Moose; 
     2use Any::Moose; 
    33 
    44with 'HTML::MobileJp::Filter::Role'; 
     
    3434} 
    3535 
     36__PACKAGE__->meta->make_immutable; 
     37 
    36381; 
    3739__END__ 
  • lang/perl/HTML-MobileJp-Filter/trunk/lib/HTML/MobileJp/Filter/PictogramFallback.pm

    r18800 r36336  
    11package HTML::MobileJp::Filter::PictogramFallback; 
    2 use Moose; 
     2use Any::Moose; 
    33 
    44with 'HTML::MobileJp::Filter::Role'; 
     
    5353    $fallback; 
    5454} 
     55 
     56__PACKAGE__->meta->make_immutable; 
    5557 
    56581; 
  • lang/perl/HTML-MobileJp-Filter/trunk/lib/HTML/MobileJp/Filter/PictogramFallback/TypeCast.pm

    r18789 r36336  
    11package HTML::MobileJp::Filter::PictogramFallback::TypeCast; 
    2 use Moose; 
     2use Any::Moose; 
    33 
    44with 'HTML::MobileJp::Filter::Role'; 
     
    5454} 
    5555 
     56__PACKAGE__->meta->make_immutable; 
     57 
    56581; 
    5759__END__ 
  • lang/perl/HTML-MobileJp-Filter/trunk/lib/HTML/MobileJp/Filter/Role.pm

    r18104 r36336  
    11package HTML::MobileJp::Filter::Role; 
    2 use strict; 
    3 use Moose::Role; 
     2use Any::Moose '::Role'; 
    43 
    54has config => ( 
  • lang/perl/HTML-MobileJp-Filter/trunk/t/02_dummy.t

    r15481 r36336  
    44use HTML::MobileJp::Filter; 
    55use HTTP::MobileAgent; 
     6use HTTP::Headers; 
    67 
    78my $filter = HTML::MobileJp::Filter->new( filters => [{ module => 'Dummy' }] ); 
    89my $html   = $filter->filter( 
    9     mobile_agent => HTTP::MobileAgent->new, 
    10     html         => "test", 
     10    mobile_agent => HTTP::MobileAgent->new( 
     11        HTTP::Headers->new( 
     12            'User-Agent' => 'DoCoMo/2.0 P906i(c100;TB;W24H15)', 
     13        ) 
     14    ), 
     15    html => "test", 
    1116); 
    1217 
  • lang/perl/HTML-MobileJp-Filter/trunk/t/04_fullname_filter.t

    r17838 r36336  
    1515use HTML::MobileJp::Filter; 
    1616use HTTP::MobileAgent; 
     17use HTTP::Headers; 
    1718 
    1819my $filters = [ 
     
    2324my $filter = HTML::MobileJp::Filter->new( filters => $filters ); 
    2425my $html   = $filter->filter( 
    25     mobile_agent => HTTP::MobileAgent->new, 
    26     html         => "test", 
     26    mobile_agent => HTTP::MobileAgent->new( 
     27        HTTP::Headers->new( 
     28            'User-Agent' => 'DoCoMo/2.0 P906i(c100;TB;W24H15)', 
     29        ) 
     30    ), 
     31    html => "test", 
    2732); 
    2833