r28149 - in /branches/upstream/libemail-abstract-perl/current: Changes META.yml Makefile.PL lib/Email/Abstract.pm lib/Email/Abstract/Plugin.pm t/abstractions.t
rmayorga-guest at users.alioth.debian.org
rmayorga-guest at users.alioth.debian.org
Sat Dec 13 01:22:40 UTC 2008
Author: rmayorga-guest
Date: Sat Dec 13 01:22:36 2008
New Revision: 28149
URL: http://svn.debian.org/wsvn/pkg-perl/?sc=1&rev=28149
Log:
[svn-upgrade] Integrating new upstream version, libemail-abstract-perl (3.001)
Modified:
branches/upstream/libemail-abstract-perl/current/Changes
branches/upstream/libemail-abstract-perl/current/META.yml
branches/upstream/libemail-abstract-perl/current/Makefile.PL
branches/upstream/libemail-abstract-perl/current/lib/Email/Abstract.pm
branches/upstream/libemail-abstract-perl/current/lib/Email/Abstract/Plugin.pm
branches/upstream/libemail-abstract-perl/current/t/abstractions.t
Modified: branches/upstream/libemail-abstract-perl/current/Changes
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libemail-abstract-perl/current/Changes?rev=28149&op=diff
==============================================================================
--- branches/upstream/libemail-abstract-perl/current/Changes (original)
+++ branches/upstream/libemail-abstract-perl/current/Changes Sat Dec 13 01:22:36 2008
@@ -1,4 +1,10 @@
Revision history for Email-Abstract.
+
+3.001 2008-12-11
+ declare our prereq on Scalar::Util
+
+3.000 2008-12-09
+ accept scalar references for more efficient msg-from-string
2.134 2007-11-16
(no code changes from previous dev release)
Modified: branches/upstream/libemail-abstract-perl/current/META.yml
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libemail-abstract-perl/current/META.yml?rev=28149&op=diff
==============================================================================
--- branches/upstream/libemail-abstract-perl/current/META.yml (original)
+++ branches/upstream/libemail-abstract-perl/current/META.yml Sat Dec 13 01:22:36 2008
@@ -1,15 +1,23 @@
--- #YAML:1.0
-name: Email-Abstract
-version: 2.134
-abstract: ~
-license: perl
-generated_by: ExtUtils::MakeMaker version 6.36_01
-distribution_type: module
-requires:
- Class::ISA: 0.20
- Email::Simple: 1.91
- Module::Pluggable: 1.5
- Test::More: 0.47
+name: Email-Abstract
+version: 3.001
+abstract: ~
+author: []
+license: perl
+distribution_type: module
+configure_requires:
+ ExtUtils::MakeMaker: 0
+requires:
+ Class::ISA: 0.20
+ Email::Simple: 1.91
+ Module::Pluggable: 1.5
+ Scalar::Util: 0
+ Test::More: 0.47
+no_index:
+ directory:
+ - t
+ - inc
+generated_by: ExtUtils::MakeMaker version 6.48
meta-spec:
- url: http://module-build.sourceforge.net/META-spec-v1.2.html
- version: 1.2
+ url: http://module-build.sourceforge.net/META-spec-v1.4.html
+ version: 1.4
Modified: branches/upstream/libemail-abstract-perl/current/Makefile.PL
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libemail-abstract-perl/current/Makefile.PL?rev=28149&op=diff
==============================================================================
--- branches/upstream/libemail-abstract-perl/current/Makefile.PL (original)
+++ branches/upstream/libemail-abstract-perl/current/Makefile.PL Sat Dec 13 01:22:36 2008
@@ -1,4 +1,6 @@
+require 5.006;
use strict;
+use warnings;
use ExtUtils::MakeMaker;
WriteMakefile(
@@ -10,5 +12,6 @@
'Email::Simple' => '1.91', # avoid undef body
'Module::Pluggable' => '1.5',
'Test::More' => '0.47',
+ 'Scalar::Util' => 0, # minimum unknown
},
);
Modified: branches/upstream/libemail-abstract-perl/current/lib/Email/Abstract.pm
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libemail-abstract-perl/current/lib/Email/Abstract.pm?rev=28149&op=diff
==============================================================================
--- branches/upstream/libemail-abstract-perl/current/lib/Email/Abstract.pm (original)
+++ branches/upstream/libemail-abstract-perl/current/lib/Email/Abstract.pm Sat Dec 13 01:22:36 2008
@@ -1,14 +1,16 @@
+require 5.006;
+use warnings;
+use strict;
package Email::Abstract;
use Carp;
use Email::Simple;
-# use 5.006;
-# use warnings;
-use strict;
-$Email::Abstract::VERSION = '2.134';
+$Email::Abstract::VERSION = '3.001';
use Module::Pluggable
search_path => [__PACKAGE__],
except => 'Email::Abstract::Plugin',
require => 1;
+
+use Scalar::Util ();
my @plugins = __PACKAGE__->plugins(); # Requires them.
my %adapter_for =
@@ -30,7 +32,8 @@
return $foreign if eval { $foreign->isa($class) };
- $foreign = Email::Simple->new($foreign) unless ref $foreign;
+ $foreign = Email::Simple->new($foreign)
+ unless Scalar::Util::blessed($foreign);
my $adapter = $class->__class_for($foreign); # dies if none available
return bless [ $foreign, $adapter ] => $class;
@@ -41,7 +44,7 @@
$method ||= 'handle';
my $f_class = ref $foreign;
- $f_class = $foreign unless $f_class;;
+ $f_class = $foreign unless $f_class;
return $f_class if ref $foreign and $f_class->isa($self);
@@ -64,7 +67,9 @@
return ($self->[1], $thing, @_);
} else {
my $thing = shift;
- my $adapter = $self->__class_for(ref $thing ? $thing : 'Email::Simple');
+ my $adapter = $self->__class_for(
+ Scalar::Util::blessed($thing) ? $thing : 'Email::Simple'
+ );
return ($adapter, $thing, @_);
}
}
@@ -81,9 +86,11 @@
# I suppose we could work around this by leaving @_ intact and assigning to
# it. That seems ... not good. -- rjbs, 2007-07-18
- unless (ref $thing) {
+ unless (Scalar::Util::blessed($thing)) {
Carp::croak "can't alter string in place" if substr($func, 0, 3) eq 'set';
- $thing = Email::Simple->new($thing);
+ $thing = Email::Simple->new(
+ ref $thing ? \do{my$str=$$thing} : $thing
+ );
}
return $adapter->$func($thing, @args);
Modified: branches/upstream/libemail-abstract-perl/current/lib/Email/Abstract/Plugin.pm
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libemail-abstract-perl/current/lib/Email/Abstract/Plugin.pm?rev=28149&op=diff
==============================================================================
--- branches/upstream/libemail-abstract-perl/current/lib/Email/Abstract/Plugin.pm (original)
+++ branches/upstream/libemail-abstract-perl/current/lib/Email/Abstract/Plugin.pm Sat Dec 13 01:22:36 2008
@@ -2,7 +2,7 @@
package Email::Abstract::Plugin;
-$Email::Abstract::Plugin::VERSION = '2.134';
+$Email::Abstract::Plugin::VERSION = '3.000';
=head1 NAME
Modified: branches/upstream/libemail-abstract-perl/current/t/abstractions.t
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libemail-abstract-perl/current/t/abstractions.t?rev=28149&op=diff
==============================================================================
--- branches/upstream/libemail-abstract-perl/current/t/abstractions.t (original)
+++ branches/upstream/libemail-abstract-perl/current/t/abstractions.t Sat Dec 13 01:22:36 2008
@@ -10,9 +10,9 @@
= qw(Email::MIME Email::Simple MIME::Entity Mail::Internet Mail::Message);
plan tests => 2
- + (@classes * 2 + 1) * Test::EmailAbstract->tests_per_object
- + (@classes + 2) * Test::EmailAbstract->tests_per_class
- + 1;
+ + (@classes * 2 + 2) * Test::EmailAbstract->tests_per_object
+ + (@classes + 4) * Test::EmailAbstract->tests_per_class
+ + 2;
use_ok("Email::Abstract");
@@ -56,24 +56,31 @@
}
}
-{
- my $email_abs = Email::Abstract->new($message);
- $tester->object_ok('plaintext', $email_abs, 0);
- $tester->class_ok('plaintext (class)', $message, 1);
+for my $ref (0..1) {
+ my $get_msg = $ref
+ ? sub { my $copy = $message; \$copy }
+ : sub { $message };
+ my $desc = 'plaintext' . ($ref ? ' (ref)' : '');
+
+ {
+ my $email_abs = Email::Abstract->new($get_msg->());
+ $tester->object_ok($desc, $email_abs, 0);
+ $tester->class_ok("$desc (class)", $get_msg->(), 1);
+ }
+
+ {
+ my $email_abs = Email::Abstract->new($get_msg->());
+ $tester->class_ok('Email::Abstract', $email_abs, 0);
+ }
+
+ {
+ # Ensure that we can use Email::Abstract->header($abstract, 'foo')
+ my $email_abs = Email::Abstract->new($get_msg->());
+
+ my $email_abs_new = Email::Abstract->new($email_abs);
+ ok(
+ $email_abs == $email_abs_new,
+ "trying to wrap a wrapper returns the wrapper; it doesn't re-wrap",
+ );
+ }
}
-
-{
- my $email_abs = Email::Abstract->new($message);
- $tester->class_ok('Email::Abstract', $email_abs, 0);
-}
-
-{
- # Ensure that we can use Email::Abstract->header($abstract, 'foo')
- my $email_abs = Email::Abstract->new($message);
-
- my $email_abs_new = Email::Abstract->new($email_abs);
- ok(
- $email_abs == $email_abs_new,
- "trying to wrap a wrapper returns the wrapper; it doesn't re-wrap",
- );
-}
More information about the Pkg-perl-cvs-commits
mailing list