Changeset 9084

Show
Ignore:
Timestamp:
04/07/08 19:05:53 (5 years ago)
Author:
tokuhirom
Message:

added no_match method.

Location:
lang/perl/HTTP-MobileAttribute/trunk
Files:
1 added
3 modified

Legend:

Unmodified
Added
Removed
  • lang/perl/HTTP-MobileAttribute/trunk/MANIFEST

    r9055 r9084  
    1616inc/Test/Builder/Module.pm 
    1717inc/Test/More.pm 
     18inc/YAML.pm 
    1819lib/HTTP/MobileAttribute.pm 
    1920lib/HTTP/MobileAttribute/Agent/AirHPhone.pm 
  • lang/perl/HTTP-MobileAttribute/trunk/Makefile.PL

    r9061 r9084  
    66 
    77build_requires 'YAML'; 
     8build_requires 'Test::Warn'; 
    89use_test_base; 
    910auto_include; 
  • lang/perl/HTTP-MobileAttribute/trunk/lib/HTTP/MobileAttribute/Agent/Base.pm

    r9041 r9084  
    33use warnings; 
    44require Class::Component; 
     5use Carp; 
    56 
    67sub import { 
     
    1011 
    1112    *{"$pkg\::mk_accessors"} = \&mk_accessors; 
     13    *{"$pkg\::no_match"}     = \&_no_match; 
    1214    *{"$pkg\::user_agent"}   = sub { $_[0]->request->get('User-Agent') }; 
    1315    *{"$pkg\::class_component_load_plugin_resolver"} = sub { "HTTP::MobileAttribute::Plugin::$_[1]" }; 
     
    2022 
    2123    $pkg->load_components(qw/DisableDynamicPlugin Autocall::InjectMethod/); 
     24} 
     25 
     26sub _no_match { 
     27    my $self = shift; 
     28 
     29    if ($^W) { 
     30        carp( 
     31            $self->user_agent, 
     32            ": no match. Might be new variants. ", 
     33            "please contact the author of HTTP::MobileAgent!" 
     34        ); 
     35    } 
    2236} 
    2337