r29909 - in /trunk/libemail-mime-creator-perl: Changes META.yml Makefile.PL README debian/changelog lib/Email/MIME/Creator.pm t/auto_create.t
emhn-guest at users.alioth.debian.org
emhn-guest at users.alioth.debian.org
Wed Jan 21 16:45:58 UTC 2009
Author: emhn-guest
Date: Wed Jan 21 16:45:55 2009
New Revision: 29909
URL: http://svn.debian.org/wsvn/pkg-perl/?sc=1&rev=29909
Log:
Upgraded to latest upstream release.
Modified:
trunk/libemail-mime-creator-perl/Changes
trunk/libemail-mime-creator-perl/META.yml
trunk/libemail-mime-creator-perl/Makefile.PL
trunk/libemail-mime-creator-perl/README
trunk/libemail-mime-creator-perl/debian/changelog
trunk/libemail-mime-creator-perl/lib/Email/MIME/Creator.pm
trunk/libemail-mime-creator-perl/t/auto_create.t
Modified: trunk/libemail-mime-creator-perl/Changes
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libemail-mime-creator-perl/Changes?rev=29909&op=diff
==============================================================================
--- trunk/libemail-mime-creator-perl/Changes (original)
+++ trunk/libemail-mime-creator-perl/Changes Wed Jan 21 16:45:55 2009
@@ -1,29 +1,0 @@
-1.454 2007-07-14
- fix some spurious "Date" headers in badly-written tests
-
-1.453 2007-04-19
- fix a bizarre test that broke on some OSes (at least some Win32's)
- thanks to "chris" for the report!
-
-1.452 2007-03-22
- packaging improvements
-
-1.451 2006-08-04
- require Email::MIME::Modifier 1.440 to avoid bug
-
-1.45 2006-07-06
- better detection of non-7bit parts
- don't base64-encode 7bit parts
-
-1.41 2004-12-23
- Parts can now be automatically created from non-reference strings when
- calling create(), using parts => [], for generating multi-part
- messages. Parts default to 'text/plain' unless they appear to be
- binary, then they're 'application/x-binary'.
-
-1.3 2004-09-25
- Minor documentation nits.
- Makefile.PL dependency fixes.
-
-1.1 2004-07-05
- Initial version.
Modified: trunk/libemail-mime-creator-perl/META.yml
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libemail-mime-creator-perl/META.yml?rev=29909&op=diff
==============================================================================
--- trunk/libemail-mime-creator-perl/META.yml (original)
+++ trunk/libemail-mime-creator-perl/META.yml Wed Jan 21 16:45:55 2009
@@ -1,18 +1,0 @@
---- #YAML:1.0
-name: Email-MIME-Creator
-version: 1.454
-abstract: Email::MIME constructor for starting anew
-license: perl
-generated_by: ExtUtils::MakeMaker version 6.32
-distribution_type: module
-requires:
- Email::MIME: 1.82
- Email::MIME::Modifier: 1.440
- Email::Simple: 1.92
- Email::Simple::Creator: 1.4
- 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>
Modified: trunk/libemail-mime-creator-perl/Makefile.PL
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libemail-mime-creator-perl/Makefile.PL?rev=29909&op=diff
==============================================================================
--- trunk/libemail-mime-creator-perl/Makefile.PL (original)
+++ trunk/libemail-mime-creator-perl/Makefile.PL Wed Jan 21 16:45:55 2009
@@ -1,16 +1,0 @@
-use ExtUtils::MakeMaker;
-
-WriteMakefile (
- AUTHOR => 'Casey West <casey at geeknest.com>',
- ABSTRACT => "Email::MIME constructor for starting anew",
- NAME => 'Email::MIME::Creator',
- (eval { ExtUtils::MakeMaker->VERSION(6.21) } ? (LICENSE => 'perl') : ()),
- PREREQ_PM => {
- 'Email::MIME' => '1.82',
- 'Email::MIME::Modifier' => '1.440', # allow forced multipart
- 'Email::Simple' => '1.92',
- 'Email::Simple::Creator' => '1.4',
- 'Test::More' => '0.47',
- },
- VERSION_FROM => 'lib/Email/MIME/Creator.pm',
-);
Modified: trunk/libemail-mime-creator-perl/README
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libemail-mime-creator-perl/README?rev=29909&op=diff
==============================================================================
--- trunk/libemail-mime-creator-perl/README (original)
+++ trunk/libemail-mime-creator-perl/README Wed Jan 21 16:45:55 2009
@@ -1,116 +1,0 @@
-NAME
- Email::MIME::Creator - Email::MIME constructor for starting anew.
-
-SYNOPSIS
- use Email::MIME::Creator;
- use IO::All;
-
- # multipart message
- my @parts = (
- Email::MIME->create(
- attributes => {
- filename => "report.pdf",
- content_type => "application/pdf",
- encoding => "quoted-printable",
- name => "2004-financials.pdf",
- },
- body => io( "2004-financials.pdf" )->all,
- ),
- Email::MIME->create(
- attributes => {
- content_type => "text/plain",
- disposition => "attachment",
- charset => "US-ASCII",
- },
- body => "Hello there!",
- ),
- );
-
- my $email = Email::MIME->create(
- header => [ From => 'casey at geeknest.com' ],
- parts => [ @parts ],
- );
-
- # nesting parts
- $email->parts_set(
- [
- $email->parts,
- Email::MIME->create( parts => [ @parts ] ),
- ],
- );
-
- # standard modifications
- $email->header_set( 'X-PoweredBy' => 'RT v3.0' );
- $email->header_set( To => rcpts() );
- $email->header_set( Cc => aux_rcpts() );
- $email->header_set( Bcc => sekrit_rcpts() );
-
- # more advanced
- $_->encoding_set( 'base64' ) for $email->parts;
-
- # Quick multipart creation
- my $quicky = Email::MIME->create(
- header => [
- From => 'my at address',
- To => 'your at address',
- ],
- parts => [
- q[This is part one],
- q[This is part two],
- q[These could be binary too],
- ],
- );
-
- print $email->as_string;
-
- *rcpts = *aux_rcpts = *sekrit_rcpts = sub { 'you at example.com' };
-
-DESCRIPTION
- Methods
- create
- my $single = Email::MIME->create(
- header => [ ... ],
- attributes => { ... },
- body => '...',
- );
-
- my $multi = Email::MIME->create(
- header => [ ... ],
- attributes => { ... },
- parts => [ ... ],
- );
-
- This method creates a new MIME part. The "header" parameter is a
- lis of headers to include in the message. "attributes" is a hash of
- MIME attributes to assign to the part, and may override portions of
- the header set in the "header" parameter.
-
- The "parts" parameter is a list reference containing "Email::MIME"
- objects. Elements of the "parts" list can also be a non-reference
- string of data. In that case, an "Email::MIME" object will be
- created for you. Simple checks will determine if the part is binary
- or not, and all parts created in this fashion are encoded with
- "base64", just in case.
-
- "parts" takes precedence over "body", which will set this part's
- body if assigned. So, multi part messages shold use the "parts"
- parameter and single part messages should use "body".
-
- Back to "attributes". The hash keys correspond directly to methods
- or modifying a message from "Email::MIME::Modifier". The allowed
- keys are: content_type, charset, name, format, boundary, encoding,
- disposition, and filename. They will be mapped to "$attr\_set" for
- message modification.
-
-SEE ALSO
- Email::MIME, Email::MIME::Modifier, Email::Simple::Creator, "IO::All" or
- "File::Slurp" (for file slurping to create parts from strings), perl.
-
-AUTHOR
- Casey West, <casey at geeknest.com>.
-
-COPYRIGHT
- Copyright (c) 2004 Casey West. All rights reserved.
- This module is free software; you can redistribute it and/or modify it
- under the same terms as Perl itself.
-
Modified: trunk/libemail-mime-creator-perl/debian/changelog
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libemail-mime-creator-perl/debian/changelog?rev=29909&op=diff
==============================================================================
--- trunk/libemail-mime-creator-perl/debian/changelog (original)
+++ trunk/libemail-mime-creator-perl/debian/changelog Wed Jan 21 16:45:55 2009
@@ -1,3 +1,9 @@
+libemail-mime-creator-perl (1.455-1) UNRELEASED; urgency=low
+
+ * (NOT RELEASED YET) New upstream release.
+
+ -- Ernesto Hernández-Novich (USB) <emhn at usb.ve> Wed, 21 Jan 2009 12:14:35 -0430
+
libemail-mime-creator-perl (1.454-3) UNRELEASED; urgency=low
* debian/control: Added: ${misc:Depends} to Depends: field.
Modified: trunk/libemail-mime-creator-perl/lib/Email/MIME/Creator.pm
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libemail-mime-creator-perl/lib/Email/MIME/Creator.pm?rev=29909&op=diff
==============================================================================
--- trunk/libemail-mime-creator-perl/lib/Email/MIME/Creator.pm (original)
+++ trunk/libemail-mime-creator-perl/lib/Email/MIME/Creator.pm Wed Jan 21 16:45:55 2009
@@ -1,219 +1,0 @@
-package Email::MIME::Creator;
-use strict;
-
-use vars qw[$VERSION];
-$VERSION = '1.454';
-
-use base q[Email::Simple::Creator];
-use Email::MIME;
-
-sub _construct_part {
- my ($class, $body) = @_;
-
- my $is_binary = $body =~ /[\x00\x80-\xFF]/;
-
- my $content_type = $is_binary
- ? 'application/x-binary'
- : 'text/plain';
-
- Email::MIME->create(
- attributes => {
- content_type => $content_type,
- encoding => ($is_binary ? 'base64' : ''), # be safe
- },
- body => $body,
- );
-}
-
-package Email::MIME;
-use strict;
-
-use vars qw[$CREATOR];
-$CREATOR = 'Email::MIME::Creator';
-
-use Email::MIME::Modifier;
-
-sub create {
- my ($class, %args) = @_;
-
- my $header = '';
- my %headers;
- if (exists $args{header}) {
- my @headers = @{ $args{header} };
- pop @headers if @headers % 2 == 1;
- while (my ($key, $value) = splice @headers, 0, 2) {
- $headers{$key} = 1;
- $CREATOR->_add_to_header(\$header, $key, $value);
- }
- }
- $CREATOR->_add_to_header(\$header, Date => $CREATOR->_date_header)
- unless exists $headers{Date};
- $CREATOR->_add_to_header(\$header, 'MIME-Version' => '1.0',);
-
- my $email = $class->new($header);
-
- my %attrs = $args{attributes} ? %{ $args{attributes} } : ();
- foreach (
- qw[content_type charset name format boundary
- encoding
- disposition filename]
- )
- {
- my $set = "$_\_set";
- $email->$set($attrs{$_}) if exists $attrs{$_};
- }
-
- if ($args{parts} && @{ $args{parts} }) {
- foreach my $part (@{ $args{parts} }) {
- $part = $CREATOR->_construct_part($part)
- unless ref($part);
- }
- $email->parts_set($args{parts});
- } elsif (exists $args{body}) {
- $email->body_set($args{body});
- }
-
- $email;
-}
-
-1;
-
-__END__
-
-=head1 NAME
-
-Email::MIME::Creator - Email::MIME constructor for starting anew.
-
-=head1 SYNOPSIS
-
- use Email::MIME::Creator;
- use IO::All;
-
- # multipart message
- my @parts = (
- Email::MIME->create(
- attributes => {
- filename => "report.pdf",
- content_type => "application/pdf",
- encoding => "quoted-printable",
- name => "2004-financials.pdf",
- },
- body => io( "2004-financials.pdf" )->all,
- ),
- Email::MIME->create(
- attributes => {
- content_type => "text/plain",
- disposition => "attachment",
- charset => "US-ASCII",
- },
- body => "Hello there!",
- ),
- );
-
- my $email = Email::MIME->create(
- header => [ From => 'casey at geeknest.com' ],
- parts => [ @parts ],
- );
-
- # nesting parts
- $email->parts_set(
- [
- $email->parts,
- Email::MIME->create( parts => [ @parts ] ),
- ],
- );
-
- # standard modifications
- $email->header_set( 'X-PoweredBy' => 'RT v3.0' );
- $email->header_set( To => rcpts() );
- $email->header_set( Cc => aux_rcpts() );
- $email->header_set( Bcc => sekrit_rcpts() );
-
- # more advanced
- $_->encoding_set( 'base64' ) for $email->parts;
-
- # Quick multipart creation
- my $quicky = Email::MIME->create(
- header => [
- From => 'my at address',
- To => 'your at address',
- ],
- parts => [
- q[This is part one],
- q[This is part two],
- q[These could be binary too],
- ],
- );
-
- print $email->as_string;
-
- *rcpts = *aux_rcpts = *sekrit_rcpts = sub { 'you at example.com' };
-
-=head1 DESCRIPTION
-
-=head2 Methods
-
-=over 5
-
-=item create
-
- my $single = Email::MIME->create(
- header => [ ... ],
- attributes => { ... },
- body => '...',
- );
-
- my $multi = Email::MIME->create(
- header => [ ... ],
- attributes => { ... },
- parts => [ ... ],
- );
-
-This method creates a new MIME part. The C<header> parameter is a lis of
-headers to include in the message. C<attributes> is a hash of MIME
-attributes to assign to the part, and may override portions of the
-header set in the C<header> parameter.
-
-The C<parts> parameter is a list reference containing C<Email::MIME>
-objects. Elements of the C<parts> list can also be a non-reference
-string of data. In that case, an C<Email::MIME> object will be created
-for you. Simple checks will determine if the part is binary or not, and
-all parts created in this fashion are encoded with C<base64>, just in case.
-
-C<parts> takes precedence over C<body>, which will set this part's body
-if assigned. So, multi part messages shold use the C<parts> parameter
-and single part messages should use C<body>.
-
-Back to C<attributes>. The hash keys correspond directly to methods or
-modifying a message from C<Email::MIME::Modifier>. The allowed keys are:
-content_type, charset, name, format, boundary, encoding, disposition,
-and filename. They will be mapped to C<"$attr\_set"> for message
-modification.
-
-=back
-
-=head1 SEE ALSO
-
-L<Email::MIME>,
-L<Email::MIME::Modifier>,
-L<Email::Simple::Creator>,
-C<IO::All> or C<File::Slurp> (for file slurping to create parts from strings),
-L<perl>.
-
-=head1 PERL EMAIL PROJECT
-
-This module is maintained by the Perl Email Project.
-
-L<http://emailproject.perl.org/wiki/Email::MIME::Creator>
-
-=head1 AUTHOR
-
-Casey West, <F<casey at geeknest.com>>.
-
-=head1 COPYRIGHT
-
- Copyright (c) 2004 Casey West. All rights reserved.
- This module is free software; you can redistribute it and/or modify it
- under the same terms as Perl itself.
-
-=cut
Modified: trunk/libemail-mime-creator-perl/t/auto_create.t
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libemail-mime-creator-perl/t/auto_create.t?rev=29909&op=diff
==============================================================================
--- trunk/libemail-mime-creator-perl/t/auto_create.t (original)
+++ trunk/libemail-mime-creator-perl/t/auto_create.t Wed Jan 21 16:45:55 2009
@@ -1,36 +1,0 @@
-use Test::More qw[no_plan];
-use strict;
-$^W = 1;
-
-use_ok 'Email::MIME::Creator';
-use Config;
-
-my $email = Email::MIME->create(
- header => [
- From => 'me',
- To => 'you',
- Subject => 'test',
- ],
- parts => [
- q[Part one],
- q[Part two],
- generate_binary_data(),
- ],
-);
-
-isa_ok $email, 'Email::MIME';
-is scalar($email->parts), 3, 'two parts';
-
-my @parts = $email->parts;
-
-isa_ok $_, 'Email::MIME' for @parts;
-
-like $parts[0]->body, qr/Part one/;
-like $parts[1]->body, qr/Part two/;
-
-like $parts[2]->content_type, qr/binary/, 'third part is binary';
-
-sub generate_binary_data {
- my $string = join '', map { chr } 1 .. 255;
- return $string;
-}
More information about the Pkg-perl-cvs-commits
mailing list