Changeset 777

Show
Ignore:
Timestamp:
09/23/02 09:01:04
Author:
miyagawa
Message:

0.02

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • HTTP-MobileAgent/trunk/Changes

    r773 r777  
    11Revision history for Perl extension HTTP::MobileAgent 
     2 
     30.02  Mon Sep 23 09:00:40 JST 2002 
     4        * Removed is_* API. Use $agent->name for dispatch 
     5        - warn_no_match() doesn't bless to NonMobile  
    26 
    370.01  Fri Sep 20 23:01:05 2002 
  • HTTP-MobileAgent/trunk/lib/HTTP/MobileAgent.pm

    r773 r777  
    33use strict; 
    44use vars qw($VERSION); 
    5 $VERSION = 0.01
     5$VERSION = 0.02
    66 
    77use HTTP::MobileAgent::Request; 
     
    5050sub name  { shift->{name} } 
    5151 
    52 # Here sare defaults 
    53 sub is_mobile     { 1 } 
    54 sub is_docomo     { 0 } 
    55 sub is_j_phone    { 0 } 
    56 sub is_ezweb      { 0 } 
    57  
    5852# utility for subclasses 
    5953sub make_accessors { 
     
    7064    Carp::carp($self->user_agent, ": no match. Might be new variants. ", 
    7165               "please contact the author of HTTP::MobileAgent!") if $^W; 
    72     bless $self, 'HTTP::MobileAgent::NonMobile'; 
    73     $self->parse; 
    7466} 
    7567 
     
    8981  # or $agent = HTTP::MobileAgent->new($agent_string); 
    9082 
    91   if ($agent->is_docomo) { 
    92       # or if ($agent->name eq 'DoCoMo') 
     83  if ($agent->name eq 'DoCoMo') { 
    9384      # or if ($agent->isa('HTTP::MobileAgent::DoCoMo')) 
    9485      # it's NTT DoCoMo i-mode. 
    9586      # see what's available in H::MA::DoCoMo 
    96   } elsif ($agent->is_j_phone) { 
     87  } elsif ($agent->name eq 'J-PHONE') { 
    9788      # it's J-Phone. 
    9889      # see what's available in H::MA::JPhone 
    99   } elsif ($agent->is_ezweb) { 
     90  } elsif ($agent->name eq 'UP.Browser') { 
    10091      # it's KDDI/EZWeb. 
    10192      # see what's available in H::MA::EZweb 
     
    142133 
    143134returns User-Agent name like 'DoCoMo'. 
    144  
    145 =item is_mobile 
    146  
    147   if ($agent->is_mobile) { 
    148       # it's really a mobile agent 
    149   } 
    150  
    151 returns if the agent is mobile or not. 
    152  
    153 =item is_docomo, is_j_phone, is_ezweb 
    154  
    155 returns if the agent is DoCoMo or J-Phone or EZWeb. 
    156135 
    157136=back 
  • HTTP-MobileAgent/trunk/lib/HTTP/MobileAgent/DoCoMo.pm

    r773 r777  
    8484} 
    8585 
    86 sub is_docomo { 1 } 
    87  
    8886sub html_version { 
    8987    my $self = shift; 
  • HTTP-MobileAgent/trunk/lib/HTTP/MobileAgent/EZweb.pm

    r773 r777  
    3636    } 
    3737} 
    38  
    39 sub is_ezweb { 1 } 
    4038 
    41391; 
     
    116114Parse C<X-UP-*> HTTP headers. 
    117115 
    118 =over 4 
     116=item * 
    119117 
    120118Spec information support listed in  
  • HTTP-MobileAgent/trunk/lib/HTTP/MobileAgent/JPhone.pm

    r773 r777  
    3333    } 
    3434} 
    35  
    36 sub is_j_phone { 1 } 
    3735 
    38361; 
  • HTTP-MobileAgent/trunk/lib/HTTP/MobileAgent/NonMobile.pm

    r776 r777  
    1010    $self->{version} = $version; 
    1111} 
    12  
    13 sub is_mobile { 0 } 
    1412 
    15131; 
     
    3634See L<HTTP::MobileAgent/"METHODS"> for common methods. 
    3735 
    38 =back 
    39  
    4036=head1 AUTHOR 
    4137 
  • HTTP-MobileAgent/trunk/t/02_docomo.t

    r773 r777  
    11use strict; 
    2 use Test::More tests => 612
     2use Test::More tests => 585
    33 
    44BEGIN { use_ok 'HTTP::MobileAgent' } 
     
    4141    isa_ok $agent, 'HTTP::MobileAgent'; 
    4242    isa_ok $agent, 'HTTP::MobileAgent::DoCoMo'; 
    43     ok $agent->is_docomo; 
    4443    is $agent->name, 'DoCoMo'; 
    4544    is $agent->user_agent, $ua,         "ua is $ua"; 
  • HTTP-MobileAgent/trunk/t/03_j_phone.t

    r773 r777  
    11use strict; 
    2 use Test::More tests => 163
     2use Test::More tests => 159
    33 
    44BEGIN { use_ok 'HTTP::MobileAgent' } 
     
    2727    isa_ok $agent, 'HTTP::MobileAgent'; 
    2828    isa_ok $agent, 'HTTP::MobileAgent::JPhone'; 
    29     ok $agent->is_j_phone; 
    3029    is $agent->name, 'J-PHONE'; 
    3130    is $agent->user_agent, $ua,         "ua is $ua"; 
  • HTTP-MobileAgent/trunk/t/04_ezweb.t

    r773 r777  
    11use strict; 
    2 use Test::More tests => 315
     2use Test::More tests => 312
    33 
    44BEGIN { use_ok 'HTTP::MobileAgent' } 
     
    1919    isa_ok $agent, 'HTTP::MobileAgent'; 
    2020    isa_ok $agent, 'HTTP::MobileAgent::EZweb'; 
    21     ok $agent->is_ezweb; 
    2221    is $agent->name, 'UP.Browser'; 
    2322    is $agent->user_agent, $ua,         "ua is $ua";