[Jifty-commit] r1747 - in jifty/trunk: lib/Jifty

jifty-commit at lists.jifty.org jifty-commit at lists.jifty.org
Thu Aug 3 19:40:24 EDT 2006


Author: zev
Date: Thu Aug  3 19:40:23 2006
New Revision: 1747

Modified:
   jifty/trunk/   (props changed)
   jifty/trunk/MANIFEST
   jifty/trunk/Makefile.PL
   jifty/trunk/lib/Jifty/Notification.pm
   jifty/trunk/lib/Jifty/Test.pm

Log:
 r12279 at truegrounds:  zev | 2006-08-03 19:40:08 -0400
 * added infrastructure to do mime mails


Modified: jifty/trunk/MANIFEST
==============================================================================
--- jifty/trunk/MANIFEST	(original)
+++ jifty/trunk/MANIFEST	Thu Aug  3 19:40:23 2006
@@ -54,6 +54,7 @@
 lib/Jifty/DateTime.pm
 lib/Jifty/Dispatcher.pm
 lib/Jifty/Everything.pm
+lib/Jifty/Filter/DateTime.pm
 lib/Jifty/Handle.pm
 lib/Jifty/Handler.pm
 lib/Jifty/I18N.pm
@@ -69,6 +70,7 @@
 lib/Jifty/Manual/PageRegions.pm
 lib/Jifty/Manual/Tutorial.pod
 lib/Jifty/Manual/Tutorial_ja.pod
+lib/Jifty/Manual/Upgrading.pod
 lib/Jifty/Mason/Halo.pm
 lib/Jifty/Model/Metadata.pm
 lib/Jifty/Model/Session.pm
@@ -130,6 +132,7 @@
 lib/Jifty/Web/Session.pm
 lib/Jifty/Web/Session/ClientSide.pm
 lib/Jifty/YAML.pm
+log
 Makefile.PL
 MANIFEST			This list of files
 MANIFEST.SKIP
@@ -177,6 +180,9 @@
 plugins/ProfileBehaviour/Makefile.PL
 plugins/ProfileBehaviour/share/web/static/css/behaviour-profile.css
 plugins/ProfileBehaviour/share/web/static/js/behaviour.js
+plugins/REST/lib/Jifty/Plugin/REST.pm
+plugins/REST/lib/Jifty/Plugin/REST/Dispatcher.pm
+plugins/REST/Makefile.PL
 README
 share/dtd/xhtml-lat1.ent
 share/dtd/xhtml-special.ent
@@ -207,6 +213,7 @@
 share/web/static/images/silk/bullet_arrow_up.png
 share/web/static/images/silk/calendar.png
 share/web/static/images/silk/cancel.png
+share/web/static/images/silk/cancel_grey.png
 share/web/static/images/silk/error.png
 share/web/static/images/silk/information.png
 share/web/static/images/silk/pencil.png
@@ -324,11 +331,21 @@
 t/Mapper/bin/jifty
 t/Mapper/lib/Mapper/Action/CrossBridge.pm
 t/Mapper/lib/Mapper/Action/GetGrail.pm
+t/Mapper/mapper
 t/Mapper/share/web/templates/autohandler
 t/Mapper/share/web/templates/index.html
 t/Mapper/t/00-prototype.t
 t/Mapper/t/01-raw-api.t
 t/Mapper/t/02-api.t
+t/TestApp-Plugin-REST/bin/jifty
+t/TestApp-Plugin-REST/etc/config.yml
+t/TestApp-Plugin-REST/lib/TestApp/Plugin/REST/Action/DoSomething.pm
+t/TestApp-Plugin-REST/lib/TestApp/Plugin/REST/Dispatcher.pm
+t/TestApp-Plugin-REST/lib/TestApp/Plugin/REST/Model/User.pm
+t/TestApp-Plugin-REST/t/00-model-User.t
+t/TestApp-Plugin-REST/t/00-prototype.t
+t/TestApp-Plugin-REST/t/01-config.t
+t/TestApp-Plugin-REST/t/02-basic-use.t
 t/TestApp/bin/jifty
 t/TestApp/lib/TestApp/Action/DoSomething.pm
 t/TestApp/lib/TestApp/Dispatcher.pm

Modified: jifty/trunk/Makefile.PL
==============================================================================
--- jifty/trunk/Makefile.PL	(original)
+++ jifty/trunk/Makefile.PL	Thu Aug  3 19:40:23 2006
@@ -20,9 +20,10 @@
 requires('Date::Manip');
 requires('Email::Folder');
 requires('Email::LocalDelivery');
+requires('Email::MIME');
+requires('Email::MIME::Creator');
 requires('Email::Send' => '1.99_01'); # Email::Send::Jifty::Test
 requires('Email::Simple');
-requires('Email::Simple::Creator');
 requires('Exporter::Lite');
 requires('File::Find::Rule');
 requires('File::MMagic');

Modified: jifty/trunk/lib/Jifty/Notification.pm
==============================================================================
--- jifty/trunk/lib/Jifty/Notification.pm	(original)
+++ jifty/trunk/lib/Jifty/Notification.pm	Thu Aug  3 19:40:23 2006
@@ -5,8 +5,7 @@
 
 use base qw/Jifty::Object Class::Accessor::Fast/;
 use Email::Send            ();
-use Email::Simple          ();
-use Email::Simple::Creator ();
+use Email::MIME::Creator;
 
 __PACKAGE__->mk_accessors(
     qw/body preface footer subject from _recipients _to_list to/);
@@ -86,13 +85,13 @@
     my $to         = join( ', ',
         map { ( $_->can('email') ? $_->email : $_ ) } grep {$_} @recipients );
     return unless ($to);
-    my $message = Email::Simple->create(
+    my $message = Email::MIME->create(
         header => [
             From    => $self->from    || 'A Jifty Application <nobody>',
             To      => $to,
             Subject => $self->subject || 'No subject',
         ],
-        body => join( "\n", $self->preface, $self->body, $self->footer )
+        parts => $self->parts
     );
     $self->set_headers($message);
 
@@ -114,7 +113,7 @@
 
 =head2 set_headers MESSAGE
 
-Takes a L<Email::Simple> object C<MESSAGE>, and modifies it as
+Takes a L<Email::MIME> object C<MESSAGE>, and modifies it as
 necessary before sending it out.  As the method name implies, this is
 usually used to add or modify headers.  By default, does nothing; this
 method is meant to be overridden.
@@ -240,6 +239,33 @@
 
 =cut
 
+=head2 full_body
+
+The main, plain-text part of the message.  This is the preface,
+body, and footer joined by newlines.
+
+=cut
+
+sub full_body {
+  my $self = shift;
+  return join( "\n", $self->preface, $self->body, $self->footer );
+}
+
+=head2 parts
+
+The parts of the message.  You want to override this if you want to
+send multi-part mail.  By default, this method returns a single
+part consisting of the result of calling C<< $self->full_body >>.
+
+Returns the parts as an array reference.
+
+=cut
+
+sub parts {
+  my $self = shift;
+  return [$self->full_body];
+}
+
 =head2 magic_letme_token_for PATH
 
 Returns a L<Jifty::LetMe> token which allows the current user to access a path on the

Modified: jifty/trunk/lib/Jifty/Test.pm
==============================================================================
--- jifty/trunk/lib/Jifty/Test.pm	(original)
+++ jifty/trunk/lib/Jifty/Test.pm	Thu Aug  3 19:40:23 2006
@@ -191,7 +191,9 @@
 
 =head2 messages
 
-Returns the messages in the test mailbox, as a list of L<Email::Simple> objects.
+Returns the messages in the test mailbox, as a list of
+L<Email::Simple> objects.  You may have to use a module like
+L<Email::MIME> to parse multi-part messages stored in the mailbox.
 
 =cut
 


More information about the Jifty-commit mailing list