Changeset 8664
- Timestamp:
- 04/02/08 19:10:04 (5 years ago)
- Location:
- lang/perl/HTTP-MobileAttribute/trunk/lib/HTTP/MobileAttribute
- Files:
-
- 7 modified
-
Attribute/MobileMethod.pm (modified) (2 diffs)
-
Plugin/Default/AirHPhone.pm (modified) (1 diff)
-
Plugin/Default/DoCoMo.pm (modified) (3 diffs)
-
Plugin/Default/EZweb.pm (modified) (2 diffs)
-
Plugin/Default/NonMobile.pm (modified) (1 diff)
-
Plugin/Default/ThirdForce.pm (modified) (1 diff)
-
Plugin/GPS.pm (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
lang/perl/HTTP-MobileAttribute/trunk/lib/HTTP/MobileAttribute/Attribute/MobileMethod.pm
r8662 r8664 5 5 6 6 sub register { 7 my ( $class, $plugin, $c, $method, $parameter, $code ) = @_; 8 $parameter =~ s/\s*//g; 9 my ($meth, $carrier ) = split /,/, $parameter; 7 my ( $class, $plugin, $c, $method, $carrier, $code ) = @_; 8 10 9 if ($c->carrier_longname eq $carrier) { 11 $c->register_method( $meth => $plugin );10 $c->register_method( $method => $plugin ); 12 11 } 13 12 } … … 19 18 =head1 SYNOPSIS 20 19 21 sub foo : MobileMethod(' html_version,DoCoMo') {20 sub foo : MobileMethod('DoCoMo') { 22 21 # your codes here 23 22 } -
lang/perl/HTTP-MobileAttribute/trunk/lib/HTTP/MobileAttribute/Plugin/Default/AirHPhone.pm
r8662 r8664 11 11 12 12 for my $method (qw(name vendor model model_version browser_version cache_size)) { 13 eval qq! sub $method :MobileMethod(" $method,AirHPhone") { shift->{$method} }; !; ## no critic.13 eval qq! sub $method :MobileMethod("AirHPhone") { shift->{$method} }; !; ## no critic. 14 14 die $@ if $@; 15 15 } -
lang/perl/HTTP-MobileAttribute/trunk/lib/HTTP/MobileAttribute/Plugin/Default/DoCoMo.pm
r8662 r8664 15 15 # FIXME: ここなんとかして。どうにかして。なんか anonymous function だと Attribute がうまくあたらないからとりあえずこれで。 16 16 for my $method (qw/version model status bandwidth serial_number is_foma card_id xhtml_compliant comment/) { 17 eval qq! sub $method :MobileMethod( "$method,DoCoMo") { shift->{$method} }; !; ## no critic.17 eval qq! sub $method :MobileMethod('DoCoMo') { shift->{$method} }; !; ## no critic. 18 18 die $@ if $@; 19 19 } 20 20 21 sub name : MobileMethod(' name,DoCoMo') { shift->{name} }21 sub name : MobileMethod('DoCoMo') { shift->{name} } 22 22 23 sub cache_size :MobileMethod(' cache_size,DoCoMo') {23 sub cache_size :MobileMethod('DoCoMo') { 24 24 my $self = shift; 25 25 return $self->{cache_size} || $DefaultCacheSize; 26 26 } 27 27 28 sub series :MobileMethod(' series,DoCoMo') {28 sub series :MobileMethod('DoCoMo') { 29 29 my $self = shift; 30 30 my $model = $self->model; … … 38 38 } 39 39 40 sub vendor :MobileMethod(' vendor,DoCoMo') {40 sub vendor :MobileMethod('DoCoMo') { 41 41 my $self = shift; 42 42 my $model = $self->model; … … 57 57 ]; 58 58 59 sub html_version: MobileMethod(' html_version,DoCoMo') {59 sub html_version: MobileMethod('DoCoMo') { 60 60 my ($self, $c) = @_; 61 61 -
lang/perl/HTTP-MobileAttribute/trunk/lib/HTTP/MobileAttribute/Plugin/Default/EZweb.pm
r8662 r8664 13 13 # FIXME: ここなんとかして。どうにかして。なんか anonymous function だと Attribute がうまくあたらないからとりあえずこれで。 14 14 for my $method (qw(name version model device_id server xhtml_compliant comment)) { 15 eval qq! sub $method :MobileMethod(" $method,EZweb") { shift->{$method} }; !; ## no critic.15 eval qq! sub $method :MobileMethod("EZweb") { shift->{$method} }; !; ## no critic. 16 16 die $@ if $@; 17 17 } 18 18 19 sub is_tuka : MobileMethod(' is_tuka,EZweb') {19 sub is_tuka : MobileMethod('EZweb') { 20 20 my $self = shift; 21 21 my $tuka = substr( $self->device_id, 2, 1 ); … … 29 29 } 30 30 31 sub is_win : MobileMethod(' is_win,EZweb') {31 sub is_win : MobileMethod('EZweb') { 32 32 my $self = shift; 33 33 my $win = substr( $self->device_id, 2, 1 ); -
lang/perl/HTTP-MobileAttribute/trunk/lib/HTTP/MobileAttribute/Plugin/Default/NonMobile.pm
r8663 r8664 4 4 use base qw/Class::Component::Plugin/; 5 5 6 sub model :MobileMethod(' model,NonMobile') { '' }7 sub device_id :MobileMethod(' device_id,NonMobile') { '' }8 sub xhtml_compliant :MobileMethod(' xhtml_compliant,NonMobile') { 1 }6 sub model :MobileMethod('NonMobile') { '' } 7 sub device_id :MobileMethod('NonMobile') { '' } 8 sub xhtml_compliant :MobileMethod('NonMobile') { 1 } 9 9 10 10 1; -
lang/perl/HTTP-MobileAttribute/trunk/lib/HTTP/MobileAttribute/Plugin/Default/ThirdForce.pm
r8662 r8664 13 13 # FIXME: ここなんとかして。どうにかして。なんか anonymous function だと Attribute がうまくあたらないからとりあえずこれで。 14 14 for my $method (qw(name version model type packet_compliant serial_number vendor vendor_version java_info)) { 15 eval qq! sub $method :MobileMethod(" $method,ThirdForce") { shift->{$method} }; !; ## no critic.15 eval qq! sub $method :MobileMethod("ThirdForce") { shift->{$method} }; !; ## no critic. 16 16 die $@ if $@; 17 17 } 18 18 19 sub is_type_c :MobileMethod(' is_type_c,ThirdForce') { shift->{type} =~ /^C/ }20 sub is_type_p :MobileMethod(' is_type_p,ThirdForce') { shift->{type} =~ /^P/ }21 sub is_type_w :MobileMethod(' is_type_w,ThirdForce') { shift->{type} =~ /^W/ }22 sub is_type_3gc :MobileMethod(' is_type_3gc,ThirdForce') { shift->{type} eq '3GC' }19 sub is_type_c :MobileMethod('ThirdForce') { shift->{type} =~ /^C/ } 20 sub is_type_p :MobileMethod('ThirdForce') { shift->{type} =~ /^P/ } 21 sub is_type_w :MobileMethod('ThirdForce') { shift->{type} =~ /^W/ } 22 sub is_type_3gc :MobileMethod('ThirdForce') { shift->{type} eq '3GC' } 23 23 24 sub xhtml_compliant :MobileMethod(' xhtml_compliant,ThirdForce') {24 sub xhtml_compliant :MobileMethod('ThirdForce') { 25 25 my $self = shift; 26 26 return ( $self->is_type_w || $self->is_type_3gc ) ? 1 : 0; -
lang/perl/HTTP-MobileAttribute/trunk/lib/HTTP/MobileAttribute/Plugin/GPS.pm
r8638 r8664 6 6 our $DoCoMoGPSModels = { map { $_ => 1 } qw(F661i F505iGPS) }; 7 7 8 sub is_gps : MobileMethod(' is_gps,DoCoMo') {8 sub is_gps : MobileMethod('DoCoMo') { 9 9 my ($self, $c) = @_; 10 10 return exists $DoCoMoGPSModels->{ $c->model };
![(please configure the [header_logo] section in trac.ini)](/share/chrome/site/your_project_logo.png)