Changeset 20322 for lang/perl/HTTP-MobileAgent-Plugin-RoamingZone
- Timestamp:
- 09/30/08 23:57:42 (5 years ago)
- Location:
- lang/perl/HTTP-MobileAgent-Plugin-RoamingZone/trunk
- Files:
-
- 1 removed
- 6 modified
-
Build.PL (modified) (1 diff)
-
Changes (modified) (1 diff)
-
MANIFEST (modified) (1 diff)
-
README (modified) (3 diffs)
-
lib/HTTP/MobileAgent/Plugin/RoamingZone (deleted)
-
lib/HTTP/MobileAgent/Plugin/RoamingZone.pm (modified) (8 diffs)
-
t/01.parse.t (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
lang/perl/HTTP-MobileAgent-Plugin-RoamingZone/trunk/Build.PL
r18459 r20322 11 11 'Test::Base' => 0, 12 12 'version' => 0, 13 'Mobile::Data::ITU' => 0, 14 'Mobile::Data::SID' => 0, 13 15 'HTTP::MobileAgent' => '0.27', 14 16 }, -
lang/perl/HTTP-MobileAgent-Plugin-RoamingZone/trunk/Changes
r18459 r20322 1 1 Revision history for HTTP-MobileAgent-Plugin-RoamingZone 2 3 0.0.3 Thu Sep 30 2008 4 Use Mobile::Data::ITU and Mobile::Data::SID modules. 2 5 3 6 0.0.2 Sat Aug 30 2008 -
lang/perl/HTTP-MobileAgent-Plugin-RoamingZone/trunk/MANIFEST
r18460 r20322 2 2 Changes 3 3 lib/HTTP/MobileAgent/Plugin/RoamingZone.pm 4 lib/HTTP/MobileAgent/Plugin/RoamingZone/CodeHash.pm5 4 Makefile.PL 6 5 MANIFEST -
lang/perl/HTTP-MobileAgent-Plugin-RoamingZone/trunk/README
r18409 r20322 7 7 L<http://www.nttdocomo.co.jp/service/imode/make/content/ip/index.html#world>に記載された仕様に従い実装され、 8 8 国番号を取得し、L<http://www.itu.int/itudoc/itu-t/ob-lists/icc/e212_685.html>で配布されている国番号->国名の 9 変換テーブルに従って、 国名/国内海外判定を行っています。9 変換テーブルに従って、Mobile::Data::ITUモジュールを使って国名/国内海外判定を行っています。 10 10 11 11 SoftBank … … 17 17 18 18 公式な仕様が存在していませんが、L<http://mscl.jp/diary/img/KDDI-SA3D.txt>等でレポートされているグローバル 19 パスポート携帯のみに存在するヘッダC<x-up-devcap-zone>において、地域情報が得られるのではないかとの想定の元 20 実装しています。 21 公式仕様がないため、実際にヘッダが返すデータと地域との対応表がありませんが、レポート・テストケース等の 22 報告をお待ちしております。 19 パスポート携帯のみに存在するヘッダC<x-up-devcap-zone>において、L<http://www.ifast.org/files/SIDNumeric.htm> 20 の仕様に規定された国コードが返される模様であるため、Mobile::Data::SIDモジュールを使って国名変換を行います。 23 21 24 22 … … 42 40 DEPENDENCIES 43 41 44 None. 42 HTTP::MobileAgengt 43 Mobile::Data::ITU 44 Mobile::Data::SID 45 Test::Base 45 46 46 47 -
lang/perl/HTTP-MobileAgent-Plugin-RoamingZone/trunk/lib/HTTP/MobileAgent/Plugin/RoamingZone.pm
r18459 r20322 5 5 use Carp; 6 6 7 use version; our $VERSION = qv('0.0. 2');7 use version; our $VERSION = qv('0.0.3'); 8 8 use HTTP::MobileAgent; 9 use HTTP::MobileAgent::Plugin::RoamingZone::CodeHash; 9 use Mobile::Data::ITU; 10 use Mobile::Data::SID; 10 11 11 12 ########################################## … … 14 15 package # hide from PAUSE 15 16 HTTP::MobileAgent; 17 use Mobile::Data::ITU; 16 18 17 19 sub zone_code { $_[0]->_zone_code || '440' } … … 20 22 21 23 sub zone_name { 22 $_[0]->_zone_name || 23 HTTP::MobileAgent::Plugin::RoamingZone::CodeHash::zone_name($_[0]->zone_code) || 'Unknown'; 24 my $ret = $_[0]->_zone_name; 25 unless ( $ret ) { 26 my $code = $_[0]->zone_code; 27 $ret = itu2country($code) if ($code =~ /^\d+$/); 28 $ret = 'Unknown' unless ($ret); 29 } 30 $ret; 24 31 } 25 32 … … 46 53 package # hide from PAUSE 47 54 HTTP::MobileAgent::EZweb; 55 use Mobile::Data::SID; 48 56 49 sub _zone_code { $_[0]->get_header('x-up-devcap-zone') }57 sub _zone_code { $_[0]->get_header('x-up-devcap-zone') || 12304 } 50 58 51 sub _zone_name { 'Japan' if ( $_[0]->zone_code eq '12304') }59 sub _zone_name { sid2country( $_[0]->zone_code ) } 52 60 53 61 ########################################## … … 56 64 package # hide from PAUSE 57 65 HTTP::MobileAgent::Vodafone; 66 use Mobile::Data::ITU; 58 67 59 68 sub _zone_code { $_[0]->get_header('x-jphone-region') } 60 69 61 sub _zone_name {'Japan' if ( $_[0]->zone_code eq '44020' ) }70 #sub _zone_name {'Japan' if ( $_[0]->zone_code eq '44020' ) } 62 71 63 72 64 73 1; # Magic true value required at end of module 65 74 __END__ 75 76 =encoding utf-8 66 77 67 78 =head1 NAME … … 105 116 =item C<< HTTP::MobileAgengt >> 106 117 118 =item C<< Mobile::Data::ITU >> 119 120 =item C<< Mobile::Data::SID >> 121 107 122 =item C<< Test::Base >> 108 123 … … 118 133 L<http://www.nttdocomo.co.jp/service/imode/make/content/ip/index.html#world>に記載された仕様に従い実装され、 119 134 国番号を取得し、L<http://www.itu.int/itudoc/itu-t/ob-lists/icc/e212_685.html>で配布されている国番号->国名の 120 変換テーブルに従って、 国名/国内海外判定を行っています。135 変換テーブルに従って、Mobile::Data::ITUモジュールを使って国名/国内海外判定を行っています。 121 136 122 137 =head2 SoftBank … … 128 143 129 144 公式な仕様が存在していませんが、L<http://mscl.jp/diary/img/KDDI-SA3D.txt>等でレポートされているグローバル 130 パスポート携帯のみに存在するヘッダC<x-up-devcap-zone>において、地域情報が得られるのではないかとの想定の元 131 実装しています。 132 公式仕様がないため、実際にヘッダが返すデータと地域との対応表がありませんが、レポート・テストケース等の 133 報告をお待ちしております。 145 パスポート携帯のみに存在するヘッダC<x-up-devcap-zone>において、L<http://www.ifast.org/files/SIDNumeric.htm> 146 の仕様に規定された国コードが返される模様であるため、Mobile::Data::SIDモジュールを使って国名変換を行います。 134 147 135 148 -
lang/perl/HTTP-MobileAgent-Plugin-RoamingZone/trunk/t/01.parse.t
r18409 r20322 110 110 NULL 111 111 --- expected 112 440 112 12304 113 113 Japan 114 114 0 … … 119 119 UNDEF 120 120 --- expected 121 440 121 12304 122 122 Japan 123 123 0 … … 138 138 --- expected 139 139 12345 140 Unknown141 1 140 Japan 141 0 142 142
![(please configure the [header_logo] section in trac.ini)](/share/chrome/site/your_project_logo.png)