<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -1,16 +1,21 @@
 module Mack
   module Mailer
     module Adapters # :nodoc:
+      # All mail adapters need to extend this class.
       class Base
         
+        # The origina Mack::Mailer object passed in.
         attr_accessor :mack_mailer
         
-        def initialize(mail)
+        def initialize(mail) # :nodoc:
           self.mack_mailer = mail
         end
         
+        # The transformed (ie, converted, object)
         needs_method :transformed
+        # Convert the Mack::Mailer object to the adapted object.
         needs_method :convert
+        # The RAW encoded String ready for delivery via SMTP, Sendmail, etc...
         needs_method :deliverable
         
       end # Base</diff>
      <filename>mack-mailer/lib/adapters/base.rb</filename>
    </modified>
    <modified>
      <diff>@@ -3,21 +3,23 @@ require 'base64'
 module Mack
   module Mailer
     module Adapters # :nodoc:
+      # Converts a Mack::Mailer object into a TMail object.
       class Tmail &lt; Mack::Mailer::Adapters::Base
         
-        def to_s
-          
-        end
-        
+        # Returns the underlying TMail object.
+        # Raises Mack::Errors::UnconvertedMailer if the convert method hasn't
+        # been called first.
         def transformed
           raise Mack::Errors::UnconvertedMailer.new if @tmail.nil?
           @tmail
         end
         
+        # Returns the ready to be delivered encoded String
         def deliverable
           transformed.encoded
         end
         
+        # Converts the Mack::Mailer object to a TMail object.
         def convert
           @tmail = TMail::Mail.new 
           @tmail.to =           mack_mailer.to</diff>
      <filename>mack-mailer/lib/adapters/tmail.rb</filename>
    </modified>
    <modified>
      <diff>@@ -1,9 +1,11 @@
 module Mack
   module Mailer
+    # Creates an attachment for a Mack::Mailer object.
     class Attachment
       
+      # Returns a String representing the body of the attachment. This String is NOT encoded in anyway!
       attr_accessor :body
-      attr_accessor :content_type
+      # Returns the name of the attached file.
       attr_accessor :file_name
       
       def initialize(body = nil)
@@ -13,14 +15,15 @@ module Mack
         end
       end
       
+      # Takes an IO object and sets the body. You'll need to explicity set the file_name afterwards.
       def add_io(io)
         self.body = io.read
       end
       
-      def add_file(file, content_type = File.extname(file).gsub('.', ''))
+      # Takes a path to a file, reads it in, and sets the file_name based on the path.
+      def add_file(file)
         self.file_name = File.basename(file)
         self.body = File.read(file)
-        self.content_type = Mack::Utils::MimeTypes[content_type]
       end
       
     end # Attachment</diff>
      <filename>mack-mailer/lib/attachment.rb</filename>
    </modified>
    <modified>
      <diff>@@ -11,7 +11,7 @@ module Mack
           Net::SMTP.start(smtp_settings[:address], smtp_settings[:port], 
                           smtp_settings[:domain], smtp_settings[:user_name], 
                           smtp_settings[:password], smtp_settings[:authentication]) do |smtp|
-            smtp.sendmail(mail.deliverable, mail.reply_to, mail.destinations)
+            smtp.sendmail(mail.deliverable, mail.reply_to, mail.recipients)
           end
         end
         </diff>
      <filename>mack-mailer/lib/delivery_handlers/smtp.rb</filename>
    </modified>
    <modified>
      <diff>@@ -8,7 +8,7 @@ module Mack
           EmailRegistry.add(mail)
         end
         
-        class EmailRegistry &lt; Mack::Utils::Registry
+        class EmailRegistry &lt; Mack::Utils::Registry # :nodoc:
         end
         
       end # Test</diff>
      <filename>mack-mailer/lib/delivery_handlers/test.rb</filename>
    </modified>
    <modified>
      <diff>@@ -1,4 +1,5 @@
 module Mack # :nodoc:
+  # The heart and soul of the mack-mailer package.
   module Mailer
     
     attr_accessor :to
@@ -11,13 +12,17 @@ module Mack # :nodoc:
     attr_accessor :html_body
     attr_accessor :date_sent
     attr_accessor :mime_version
+    attr_accessor :content_type
     
+    # A helper method that takes a Hash and will populate the email with the key/value pairs of that Hash.
     def build(options = {})
       options.each do |k,v|
         self.send(&quot;#{k}=&quot;, v)
       end
     end
     
+    # Returns the text_body of the email. If there is no text_body set it will attempt to build one using
+    # the text.erb template for this mailer.
     def text_body
       if @text_body.blank?
         @text_body = build_template(:text)
@@ -25,6 +30,8 @@ module Mack # :nodoc:
       return @text_body
     end
     
+    # Returns the html_body of the email. If there is no html_body set it will attempt to build one using
+    # the html.erb template for this mailer.
     def html_body
       if @html_body.blank?
         @html_body = build_template(:html)
@@ -32,10 +39,12 @@ module Mack # :nodoc:
       @html_body
     end
     
+    # Returns the mime_version of the email, defaults to &quot;1.0&quot;
     def mime_version
       (@mime_version ||= &quot;1.0&quot;)
     end
     
+    # This will attempt to determine the content type of the email, unless one is already specified. 
     def content_type
       return @content_type unless @content_type.blank?
       if has_attachments?
@@ -49,35 +58,44 @@ module Mack # :nodoc:
       end
     end
     
+    # Returns the date sent, defaults to Time.now
     def date_sent
       (@date_sent ||= Time.now)
     end
     
+    # Returns the reply to address, defaults to the from address.
     def reply_to
       (@reply_to || self.from)
     end
     
+    # Adds a Mack::Mailer::Attachment to the email.
+    # Raise ArgumentError if the parameter is not a Mack::Mailer::Attachment
     def attach(file)
       raise ArgumentError.new unless file.is_a?(Mack::Mailer::Attachment)
       attachments &lt;&lt; file
     end
     
+    # Returns true if there are attachments.
     def has_attachments?
       !attachments.empty?
     end
     
+    # Returns the attachments Array.
     def attachments
       @attachments ||= []
     end
     
+    # Delivers the email with the configured Mack::Mailer::DeliveryHandlers class.
     def deliver(handler = app_config.mailer.deliver_with)
       &quot;Mack::Mailer::DeliveryHandlers::#{handler.camelcase}&quot;.constantize.deliver(self)
     end
     
-    def destinations
+    # Returns all the recipients of this email.
+    def recipients
       [self.to, self.cc, self.bcc].flatten.compact
     end
     
+    # Returns a ready to be delivered, encoded, version of the email.
     def deliverable(adapter = app_config.mailer.adapter)
       adap = &quot;Mack::Mailer::Adapters::#{adapter.camelcase}&quot;.constantize.new(self)
       adap.convert</diff>
      <filename>mack-mailer/lib/mailer.rb</filename>
    </modified>
    <modified>
      <diff>@@ -1,12 +1,22 @@
+# Generates the necessary files for a basic mailer.
+# 
+# Example:
+#   rake generate:mailer name=welcome_email
+# generates the following files:
+#   app/mailers/welcome_email.rb
+#   app/mailers/templates/welcome_email/text.erb
+#   app/mailers/templates/welcome_email/html.erb
+#   test/unit/welcome_email_spec.rb # =&gt; if using RSpec
+#   test/unit/welcome_email_test.rb # =&gt; if using Test::Unit::TestCase
 class MailerGenerator &lt; Genosaurus
   
   require_param :name
   
-  def file_name
+  def file_name # :nodoc:
     param(:name).underscore.downcase
   end
   
-  def class_name
+  def class_name # :nodoc:
     param(:name).camelcase
   end
   </diff>
      <filename>mack-mailer/lib/mailer_generator/mailer_generator.rb</filename>
    </modified>
    <modified>
      <diff>@@ -1,9 +1,15 @@
 module Mack # :nodoc:
   module Paths
     
+    # The path to the app/mailers directory.
     def self.mailers(*args)
       File.join(Mack.root, &quot;app&quot;, &quot;mailers&quot;, args)
     end
     
+    # The path to the app/mailers/templates directory.
+    def self.mailer_templates(*args)
+      Mack::Paths.mailers(&quot;templates&quot;, args)
+    end
+    
   end
 end
\ No newline at end of file</diff>
      <filename>mack-mailer/lib/paths.rb</filename>
    </modified>
    <modified>
      <diff>@@ -1,10 +1,10 @@
 module Mack
-  module Rendering
-    module Type
-      class Mailer &lt; Mack::Rendering::Type::FileBase
+  module Rendering # :nodoc:
+    module Type # :nodoc:
+      class Mailer &lt; Mack::Rendering::Type::FileBase # :nodoc:
         
         def render
-          x_file = Mack::Paths.mailers(&quot;templates&quot;, self.render_value, self.options[:format])
+          x_file = Mack::Paths.mailer_templates(self.render_value, self.options[:format])
           render_file(x_file)
         end
         </diff>
      <filename>mack-mailer/lib/rendering/type/mailer.rb</filename>
    </modified>
    <modified>
      <diff>@@ -11,7 +11,6 @@ describe Mack::Mailer::Attachment do
     it &quot;should read in a file and set the content_type based on the extension&quot; do
       at = Mack::Mailer::Attachment.new
       at.add_file(@my_file)
-      at.content_type.should == &quot;image/png&quot;
       at.body.should == File.read(@my_file)
     end
     
@@ -31,14 +30,11 @@ describe Mack::Mailer::Attachment do
     
     it &quot;should take a string and read call add_file&quot; do
       at = Mack::Mailer::Attachment.new(@my_file)
-      at.content_type.should == &quot;image/png&quot;
       at.body.should == File.read(@my_file)
     end
     
     it &quot;should take an IO and call add_io&quot; do
       at = Mack::Mailer::Attachment.new(File.open(@my_file))
-      at.content_type = &quot;image/png&quot;
-      at.content_type.should == &quot;image/png&quot;
       at.body.should == File.read(@my_file)
     end
     </diff>
      <filename>mack-mailer/spec/lib/attachment_spec.rb</filename>
    </modified>
    <modified>
      <diff>@@ -60,7 +60,7 @@ describe Mack::Mailer do
       @we.to = &quot;mark@mackframework.com&quot;
       @we.cc = [&quot;foo@example.com&quot;, &quot;bar@example.com&quot;]
       @we.bcc = &quot;fubar@example.com&quot;
-      @we.destinations.should == [&quot;mark@mackframework.com&quot;, &quot;foo@example.com&quot;, &quot;bar@example.com&quot;, &quot;fubar@example.com&quot;]
+      @we.recipients.should == [&quot;mark@mackframework.com&quot;, &quot;foo@example.com&quot;, &quot;bar@example.com&quot;, &quot;fubar@example.com&quot;]
     end
     
   end</diff>
      <filename>mack-mailer/spec/lib/mack_mailer_spec.rb</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>424c5613226bbbc5876f4b3c5737420eebc77745</id>
    </parent>
  </parents>
  <author>
    <name>Mark Bates</name>
    <email>mark@markbates.com</email>
  </author>
  <url>http://github.com/markbates/mack-more/commit/3fe046b8d040265fea50835c2cc2dd5b935f87af</url>
  <id>3fe046b8d040265fea50835c2cc2dd5b935f87af</id>
  <committed-date>2008-07-24T13:01:21-07:00</committed-date>
  <authored-date>2008-07-24T13:01:21-07:00</authored-date>
  <message>Feature: Mailer Support. [#24 state:resolved]</message>
  <tree>8ce18741489a1dea3bfaab847ed20128bddaf9a4</tree>
  <committer>
    <name>Mark Bates</name>
    <email>mark@markbates.com</email>
  </committer>
</commit>
