r15684 - in /libemail-valid-loose-perl: ./ branches/ branches/upstream/ branches/upstream/current/ branches/upstream/current/lib/ branches/upstream/current/lib/Email/ branches/upstream/current/lib/Email/Valid/ branches/upstream/current/t/

eloy at users.alioth.debian.org eloy at users.alioth.debian.org
Tue Feb 26 22:21:24 UTC 2008


Author: eloy
Date: Tue Feb 26 22:21:23 2008
New Revision: 15684

URL: http://svn.debian.org/wsvn/?sc=1&rev=15684
Log:
[svn-inject] Installing original source of libemail-valid-loose-perl

Added:
    libemail-valid-loose-perl/
    libemail-valid-loose-perl/branches/
    libemail-valid-loose-perl/branches/upstream/
    libemail-valid-loose-perl/branches/upstream/current/
    libemail-valid-loose-perl/branches/upstream/current/Changes
    libemail-valid-loose-perl/branches/upstream/current/MANIFEST
    libemail-valid-loose-perl/branches/upstream/current/META.yml
    libemail-valid-loose-perl/branches/upstream/current/Makefile.PL
    libemail-valid-loose-perl/branches/upstream/current/README
    libemail-valid-loose-perl/branches/upstream/current/lib/
    libemail-valid-loose-perl/branches/upstream/current/lib/Email/
    libemail-valid-loose-perl/branches/upstream/current/lib/Email/Valid/
    libemail-valid-loose-perl/branches/upstream/current/lib/Email/Valid/Loose.pm
    libemail-valid-loose-perl/branches/upstream/current/t/
    libemail-valid-loose-perl/branches/upstream/current/t/00_compile.t
    libemail-valid-loose-perl/branches/upstream/current/t/01_loose.t

Added: libemail-valid-loose-perl/branches/upstream/current/Changes
URL: http://svn.debian.org/wsvn/libemail-valid-loose-perl/branches/upstream/current/Changes?rev=15684&op=file
==============================================================================
--- libemail-valid-loose-perl/branches/upstream/current/Changes (added)
+++ libemail-valid-loose-perl/branches/upstream/current/Changes Tue Feb 26 22:21:23 2008
@@ -1,0 +1,18 @@
+Revision history for Perl extension Email::Valid::Loose.
+
+0.05  Fri Jun 23 23:58:36 JST 2006
+        - Update the module so it works with recent Email::Valid
+
+0.04  Thu Feb 26 18:25:46 JST 2004
+        - Fixed bug that address(-address => $address) is broken
+
+0.03  Fri Jan 30 17:50:39 JST 2004
+	* Now allows '-foo at example.com' due to quick hack
+	  (Thanks to Takefumi Kimura)
+
+0.02  Tue Jan  8 01:12:00 JST 2002
+	- Added dependency on Email::Valid in Makefile.PL
+	- Added Changes file
+
+0.01  Tue Jan  8 01:11:27 JST 2002
+        - original version

Added: libemail-valid-loose-perl/branches/upstream/current/MANIFEST
URL: http://svn.debian.org/wsvn/libemail-valid-loose-perl/branches/upstream/current/MANIFEST?rev=15684&op=file
==============================================================================
--- libemail-valid-loose-perl/branches/upstream/current/MANIFEST (added)
+++ libemail-valid-loose-perl/branches/upstream/current/MANIFEST Tue Feb 26 22:21:23 2008
@@ -1,0 +1,8 @@
+Changes
+lib/Email/Valid/Loose.pm
+Makefile.PL
+MANIFEST
+README
+t/00_compile.t
+t/01_loose.t
+META.yml                                 Module meta-data (added by MakeMaker)

Added: libemail-valid-loose-perl/branches/upstream/current/META.yml
URL: http://svn.debian.org/wsvn/libemail-valid-loose-perl/branches/upstream/current/META.yml?rev=15684&op=file
==============================================================================
--- libemail-valid-loose-perl/branches/upstream/current/META.yml (added)
+++ libemail-valid-loose-perl/branches/upstream/current/META.yml Tue Feb 26 22:21:23 2008
@@ -1,0 +1,12 @@
+# http://module-build.sourceforge.net/META-spec.html
+#XXXXXXX This is a prototype!!!  It will change in the future!!! XXXXX#
+name:         Email-Valid-Loose
+version:      0.05
+version_from: lib/Email/Valid/Loose.pm
+installdirs:  site
+requires:
+    Email::Valid:                  0.17
+    Test::More:                    0.32
+
+distribution_type: module
+generated_by: ExtUtils::MakeMaker version 6.30

Added: libemail-valid-loose-perl/branches/upstream/current/Makefile.PL
URL: http://svn.debian.org/wsvn/libemail-valid-loose-perl/branches/upstream/current/Makefile.PL?rev=15684&op=file
==============================================================================
--- libemail-valid-loose-perl/branches/upstream/current/Makefile.PL (added)
+++ libemail-valid-loose-perl/branches/upstream/current/Makefile.PL Tue Feb 26 22:21:23 2008
@@ -1,0 +1,9 @@
+use ExtUtils::MakeMaker;
+WriteMakefile(
+    'NAME'      => 'Email::Valid::Loose',
+    'VERSION_FROM' => 'lib/Email/Valid/Loose.pm', # finds $VERSION
+    'PREREQ_PM' => {
+	Test::More => 0.32,
+	Email::Valid => 0.17,
+    },
+);

Added: libemail-valid-loose-perl/branches/upstream/current/README
URL: http://svn.debian.org/wsvn/libemail-valid-loose-perl/branches/upstream/current/README?rev=15684&op=file
==============================================================================
--- libemail-valid-loose-perl/branches/upstream/current/README (added)
+++ libemail-valid-loose-perl/branches/upstream/current/README Tue Feb 26 22:21:23 2008
@@ -1,0 +1,28 @@
+NAME
+    Email::Valid::Loose - Email::Valid which allows dot before at mark
+
+SYNOPSIS
+      use Email::Valid::Loose;
+
+      # same as Email::Valid
+      my $addr     = 'read_rfc822. at docomo.ne.jp';
+      my $is_valid = Email::Valid::Loose->address($addr);
+
+DESCRIPTION
+    Email::Valid::Loose is a subclass of Email::Valid, which allows . (dot)
+    before @ (at-mark). It is invalid in RFC822, but is commonly used in
+    some of mobile phone addresses in Japan (like docomo.ne.jp or
+    jp-t.ne.jp).
+
+IMPLEMENTATION
+    This module overrides "rfc822" method in Email::Valid.
+
+AUTHOR
+    Tatsuhiko Miyagawa <miyagawa at bulknews.net>
+
+    This library is free software; you can redistribute it and/or modify it
+    under the same terms as Perl itself.
+
+SEE ALSO
+    the Email::Valid manpage, the Mail::Address::MobileJp manpage
+

Added: libemail-valid-loose-perl/branches/upstream/current/lib/Email/Valid/Loose.pm
URL: http://svn.debian.org/wsvn/libemail-valid-loose-perl/branches/upstream/current/lib/Email/Valid/Loose.pm?rev=15684&op=file
==============================================================================
--- libemail-valid-loose-perl/branches/upstream/current/lib/Email/Valid/Loose.pm (added)
+++ libemail-valid-loose-perl/branches/upstream/current/lib/Email/Valid/Loose.pm Tue Feb 26 22:21:23 2008
@@ -1,0 +1,82 @@
+package Email::Valid::Loose;
+
+use strict;
+our $VERSION = '0.05';
+
+use Email::Valid 0.17;
+use base qw(Email::Valid);
+
+# This is BNF from RFC822
+my $esc         = '\\\\';
+my $period      = '\.';
+my $space       = '\040';
+my $open_br     = '\[';
+my $close_br    = '\]';
+my $nonASCII    = '\x80-\xff';
+my $ctrl        = '\000-\037';
+my $cr_list     = '\n\015';
+my $qtext       = qq/[^$esc$nonASCII$cr_list\"]/; # "
+my $dtext       = qq/[^$esc$nonASCII$cr_list$open_br$close_br]/;
+my $quoted_pair = qq<$esc>.qq<[^$nonASCII]>;
+my $atom_char   = qq/[^($space)<>\@,;:\".$esc$open_br$close_br$ctrl$nonASCII]/;	# "
+my $atom        = qq<$atom_char+(?!$atom_char)>;
+my $quoted_str  = qq<\"$qtext*(?:$quoted_pair$qtext*)*\">; # "
+my $word        = qq<(?:$atom|$quoted_str)>;
+my $domain_ref  = $atom;
+my $domain_lit  = qq<$open_br(?:$dtext|$quoted_pair)*$close_br>;
+my $sub_domain  = qq<(?:$domain_ref|$domain_lit)>;
+my $domain      = qq<$sub_domain(?:$period$sub_domain)*>;
+my $local_part  = qq<$word(?:$word|$period)*>; # This part is modified
+
+# Finally, the address-spec regex (more or less)
+use vars qw($Addr_spec_re);
+$Addr_spec_re   = qr<$local_part\@$domain>;
+
+sub rfc822 {
+    my $self = shift;
+    my %args = $self->_rearrange([qw( address )], \@_);
+
+    my $addr = $args{address} or return $self->details('rfc822');
+    $addr = $addr->address if UNIVERSAL::isa($addr, 'Mail::Address');
+
+    return $self->details('rfc822') unless $addr =~ m/^$Addr_spec_re$/o;
+    return 1;
+}
+1;
+__END__
+
+=head1 NAME
+
+Email::Valid::Loose - Email::Valid which allows dot before at mark
+
+=head1 SYNOPSIS
+
+  use Email::Valid::Loose;
+
+  # same as Email::Valid
+  my $addr     = 'read_rfc822. at docomo.ne.jp';
+  my $is_valid = Email::Valid::Loose->address($addr);
+
+=head1 DESCRIPTION
+
+Email::Valid::Loose is a subclass of Email::Valid, which allows
+. (dot) before @ (at-mark). It is invalid in RFC822, but is commonly
+used in some of mobile phone addresses in Japan (like docomo.ne.jp or
+jp-t.ne.jp).
+
+=head1 IMPLEMENTATION
+
+This module overrides C<rfc822> method in Email::Valid.
+
+=head1 AUTHOR
+
+Tatsuhiko Miyagawa E<lt>miyagawa at bulknews.netE<gt>
+
+This library is free software; you can redistribute it and/or modify
+it under the same terms as Perl itself.
+
+=head1 SEE ALSO
+
+L<Email::Valid>, L<Mail::Address::MobileJp>
+
+=cut

Added: libemail-valid-loose-perl/branches/upstream/current/t/00_compile.t
URL: http://svn.debian.org/wsvn/libemail-valid-loose-perl/branches/upstream/current/t/00_compile.t?rev=15684&op=file
==============================================================================
--- libemail-valid-loose-perl/branches/upstream/current/t/00_compile.t (added)
+++ libemail-valid-loose-perl/branches/upstream/current/t/00_compile.t Tue Feb 26 22:21:23 2008
@@ -1,0 +1,4 @@
+use strict;
+use Test::More tests => 1;
+
+BEGIN { use_ok 'Email::Valid::Loose' }

Added: libemail-valid-loose-perl/branches/upstream/current/t/01_loose.t
URL: http://svn.debian.org/wsvn/libemail-valid-loose-perl/branches/upstream/current/t/01_loose.t?rev=15684&op=file
==============================================================================
--- libemail-valid-loose-perl/branches/upstream/current/t/01_loose.t (added)
+++ libemail-valid-loose-perl/branches/upstream/current/t/01_loose.t Tue Feb 26 22:21:23 2008
@@ -1,0 +1,28 @@
+use strict;
+use Test::More;
+
+use Email::Valid::Loose;
+
+my @valid = (
+    'miyagawa at cpan.org',
+    'rfc822. at docomo.ne.jp',
+    '-aaaa at foobar.ezweb.ne.jp',
+);
+
+my @invalid = (
+    'doobar',
+    'doo[@eeee.com',
+    '',
+    'foobar at doo.com ',
+);
+
+plan tests => (@valid + @invalid);
+
+for (@valid) {
+    ok( Email::Valid::Loose->address($_), $_ );
+}
+
+for (@invalid) {
+    ok( !Email::Valid::Loose->address($_), $_ );
+}
+




More information about the Pkg-perl-cvs-commits mailing list