Changeset 1895

Show
Ignore:
Timestamp:
07/21/06 00:38:23
Author:
miyagawa
Message:

0.05 release; added softbank.ne.jp

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • Mail-Address-MobileJp/trunk/Changes

    r953 r1895  
    11Revision history for Perl extension Mail::Address::MobileJp. 
     2 
     30.05  Fri Jul 21 00:36:02 JST 2006 
     4        * Added is_softbank and softbank.ne.jp to is_mobile domain 
    25 
    360.04  Sun Oct 5 04:15:32 JST 2003 
  • Mail-Address-MobileJp/trunk/lib/Mail/Address/MobileJp.pm

    r953 r1895  
    33use strict; 
    44use vars qw($VERSION); 
    5 $VERSION = '0.04'; 
     5$VERSION = '0.05'; 
    66 
    77BEGIN { 
    88    require Exporter; 
    99    @Mail::Address::MobileJp::ISA    = qw(Exporter); 
    10     @Mail::Address::MobileJp::EXPORT = qw(is_mobile_jp is_imode is_vodafone is_ezweb); 
     10    @Mail::Address::MobileJp::EXPORT = qw(is_mobile_jp is_imode is_vodafone is_ezweb is_softbank); 
    1111} 
    1212 
     
    6868)$@x; # end of qr@@ 
    6969 
     70my $regexp_softbank = qr@^softbank\.ne\.jp$@; 
     71 
    7072my $regex_ezweb = qr@^(?: 
    7173ezweb\.ne\.jp| 
     
    8486} 
    8587 
     88sub is_softbank { 
     89    my $domain = _domain(shift); 
     90    return $domain && $domain =~ /$regexp_softbank/o; 
     91} 
     92 
    8693sub is_ezweb { 
    8794    my $domain = _domain(shift); 
     
    9198sub is_mobile_jp { 
    9299    my $domain = _domain(shift); 
    93     return $domain && $domain =~ /(?:$regex_imode|$regex_vodafone|$regex_ezweb|$regex_mobile)/o; 
     100    return $domain && $domain =~ /(?:$regex_imode|$regex_vodafone|$regex_ezweb|$regex_mobile|$regexp_softbank)/o; 
    94101} 
    95102 
     
    163170can be an email string or Mail::Address object. 
    164171 
     172=item is_softbank 
     173 
     174  $bool = is_softbank($email); 
     175 
     176returns whether C<$email> is a softbank email address or not. C<$email> 
     177can be an email string or Mail::Address object. 
     178 
    165179=back 
    166180 
  • Mail-Address-MobileJp/trunk/t/01_mobile.t

    r955 r1895  
    11use strict; 
    2 use Test::More tests => 31
     2use Test::More tests => 32
    33 
    44use Mail::Address; 
     
    1919); 
    2020 
     21my @ok_softbank = ( 
     22    'foo@softbank.ne.jp', 
     23); 
     24 
    2125my @ok = ( 
    2226    @ok_imode, 
    2327    @ok_vodafone, 
    2428    @ok_ezweb, 
     29    @ok_softbank, 
    2530    'foo@mnx.ne.jp', 
    2631    'foo@bar.mnx.ne.jp', 
     
    4550    'foo@dxx.pdx.ne.jp', 
    4651    'barabr', 
    47     'foo@a.vodafone.ne.jp', 
    4852    Mail::Address->parse('foo <foo@doo.com>'), 
    4953); 
     
    6165} 
    6266 
     67for my $ok (@ok_softbank) { 
     68    ok is_softbank($ok), "$ok"; 
     69} 
     70 
    6371for my $ok (@ok) { 
    6472    ok is_mobile_jp($ok), "$ok";