r11683 - in /branches/upstream/libemail-address-perl/current: Changes MANIFEST META.yml lib/Email/Address.pm t/quoting.t

gregoa-guest at users.alioth.debian.org gregoa-guest at users.alioth.debian.org
Wed Dec 26 17:01:14 UTC 2007


Author: gregoa-guest
Date: Wed Dec 26 17:01:14 2007
New Revision: 11683

URL: http://svn.debian.org/wsvn/?sc=1&rev=11683
Log:
[svn-upgrade] Integrating new upstream version, libemail-address-perl (1.889)

Added:
    branches/upstream/libemail-address-perl/current/t/quoting.t
Modified:
    branches/upstream/libemail-address-perl/current/Changes
    branches/upstream/libemail-address-perl/current/MANIFEST
    branches/upstream/libemail-address-perl/current/META.yml
    branches/upstream/libemail-address-perl/current/lib/Email/Address.pm

Modified: branches/upstream/libemail-address-perl/current/Changes
URL: http://svn.debian.org/wsvn/branches/upstream/libemail-address-perl/current/Changes?rev=11683&op=diff
==============================================================================
--- branches/upstream/libemail-address-perl/current/Changes (original)
+++ branches/upstream/libemail-address-perl/current/Changes Wed Dec 26 17:01:14 2007
@@ -1,3 +1,9 @@
+Release history for Email-Address
+
+1.889     2007-12-19
+          even if the phrase needed quoting, do not return quoted phrase from
+          the phrase method
+
 1.888     2007-04-01
           rt 16320 - collapse multiple whitespaces to prevent speed problem
           rt 24161 - forbid backslash in dot-atom

Modified: branches/upstream/libemail-address-perl/current/MANIFEST
URL: http://svn.debian.org/wsvn/branches/upstream/libemail-address-perl/current/MANIFEST?rev=11683&op=diff
==============================================================================
--- branches/upstream/libemail-address-perl/current/MANIFEST (original)
+++ branches/upstream/libemail-address-perl/current/MANIFEST Wed Dec 26 17:01:14 2007
@@ -11,6 +11,7 @@
 t/pod.t
 t/pod-coverage.t
 t/quote-encoded.t
+t/quoting.t
 t/tests.t
 LICENSE
 META.yml                                 Module meta-data (added by MakeMaker)

Modified: branches/upstream/libemail-address-perl/current/META.yml
URL: http://svn.debian.org/wsvn/branches/upstream/libemail-address-perl/current/META.yml?rev=11683&op=diff
==============================================================================
--- branches/upstream/libemail-address-perl/current/META.yml (original)
+++ branches/upstream/libemail-address-perl/current/META.yml Wed Dec 26 17:01:14 2007
@@ -1,14 +1,14 @@
 --- #YAML:1.0
 name:                Email-Address
-version:             1.888
+version:             1.889
 abstract:            RFC 2822 Address Parsing
 license:             perl
-generated_by:        ExtUtils::MakeMaker version 6.32
+author:              
+    - Casey West <casey at geeknest.com>
+generated_by:        ExtUtils::MakeMaker version 6.42
 distribution_type:   module
 requires:     
     Test::More:                    0.47
 meta-spec:
-    url:     http://module-build.sourceforge.net/META-spec-v1.2.html
-    version: 1.2
-author:
-    - Casey West <casey at geeknest.com>
+    url:     http://module-build.sourceforge.net/META-spec-v1.3.html
+    version: 1.3

Modified: branches/upstream/libemail-address-perl/current/lib/Email/Address.pm
URL: http://svn.debian.org/wsvn/branches/upstream/libemail-address-perl/current/lib/Email/Address.pm?rev=11683&op=diff
==============================================================================
--- branches/upstream/libemail-address-perl/current/lib/Email/Address.pm (original)
+++ branches/upstream/libemail-address-perl/current/lib/Email/Address.pm Wed Dec 26 17:01:14 2007
@@ -10,7 +10,7 @@
 
 my $NOCACHE;
 
-$VERSION              = '1.888';
+$VERSION              = '1.889';
 $COMMENT_NEST_LEVEL ||= 2;
 $STRINGIFY          ||= 'format';
 $COLLAPSE_SPACES      = 1 unless defined $COLLAPSE_SPACES; # who wants //=? me!
@@ -32,7 +32,7 @@
 
 version 1.886
 
- $Id: /my/pep/Email-Address/trunk/lib/Email/Address.pm 31900 2007-06-23T01:25:34.344997Z rjbs  $
+ $Id: Address.pm 881 2007-12-19 22:08:35Z rjbs at cpan.org $
 
 =head1 DESCRIPTION
 
@@ -253,7 +253,12 @@
 
 =cut
 
-sub new { bless [@_[1..4]], $_[0] }
+sub new {
+  my ($class, $phrase, $email, $comment, $orig) = @_;
+  $phrase =~ s/\A"(.+)"\z/$1/ if $phrase;
+
+  bless [ $phrase, $email, $comment, $orig ] => $class;
+}
 
 =pod
 

Added: branches/upstream/libemail-address-perl/current/t/quoting.t
URL: http://svn.debian.org/wsvn/branches/upstream/libemail-address-perl/current/t/quoting.t?rev=11683&op=file
==============================================================================
--- branches/upstream/libemail-address-perl/current/t/quoting.t (added)
+++ branches/upstream/libemail-address-perl/current/t/quoting.t Wed Dec 26 17:01:14 2007
@@ -1,0 +1,38 @@
+#!perl
+use strict;
+
+use Email::Address;
+use Test::More tests => 6;
+
+my $phrase = q{jack!work};
+my $email  = 'jack at work.com';
+
+my $ea = Email::Address->new($phrase, $email);
+
+is(
+  $ea->format,
+  q{"jack!work" <jack at work.com>},
+  'we automatically quote a phrase with ! in it',
+);
+
+is($ea->phrase, $phrase, "the phrase method returns the right thing");
+
+my ($ea2) = Email::Address->parse($ea->format);
+
+is(
+  $ea2->format,
+  q{"jack!work" <jack at work.com>},
+  'round trip format the previously parsed email',
+);
+
+is($ea2->phrase, $phrase, "the phrase method returns the right thing");
+
+my ($ea3) = Email::Address->parse(q{jack!work <jack at work.com>});
+
+is(
+  $ea3->format,
+  q{"jack!work" <jack at work.com>},
+  'given an email with an unquoted !, we quote when formatting',
+);
+
+is($ea3->phrase, $phrase, "the phrase method returns the right thing");




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