<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array">
    <added>
      <filename>vendor/mailfactory-1.2.3/lib/mailfactory.rb</filename>
    </added>
    <added>
      <filename>vendor/mailfactory-1.2.3/tests/test_mailfactory.rb</filename>
    </added>
  </added>
  <modified type="array">
    <modified>
      <diff>@@ -28,7 +28,9 @@ namespace :warehouse do
     require 'yaml'
     require 'config/initializers/svn'
     require 'lib/cache_key'
-    $LOAD_PATH &lt;&lt; 'vendor/ruby-sequel/lib' &lt;&lt; 'vendor/metaid-1.0'
+    $LOAD_PATH &lt;&lt; 'vendor/ruby-sequel/lib' &lt;&lt; 'vendor/metaid-1.0' &lt;&lt; 'vendor/mailfactory-1.2.3/lib'
+    require 'lib/warehouse'
+    require 'config/initializers/warehouse'
     require 'lib/warehouse/mailer'
     require 'lib/warehouse/command'
     require 'lib/warehouse/extension'</diff>
      <filename>lib/tasks/importer.rake</filename>
    </modified>
    <modified>
      <diff>@@ -49,18 +49,18 @@ module Warehouse
         ActionMailer::Base.delivery_method = mail_type.to_sym
         ActionMailer::Base.send(&quot;#{mail_type}_settings=&quot;, send(&quot;#{mail_type}_settings&quot;))
       elsif Warehouse.const_defined?(:Mailer)
-        Warehouse::Mailer.test_send = :test_send
+        Warehouse::Mailer.delivery_method = :test_send
         return if RAILS_ENV == 'test' || mail_type.nil? || send(&quot;#{mail_type}_settings&quot;).nil? || send(&quot;#{mail_type}_settings&quot;).empty?
-        mail_type = mail_type.to_sym
         options   = send(&quot;#{mail_type}_settings&quot;)
-        Warehouse::Mailer.delivery_method = mail_type == :smtp ? :net_smtp : :sendmail
+        Warehouse::Mailer.delivery_method = mail_type == 'smtp' ? :net_smtp : :sendmail
         Warehouse::Mailer.config = {}
         return if Warehouse::Mailer.delivery_method == :sendmail
-        Warehouse::Mailer[:host] = options[:address]
-        Warehouse::Mailer[:port] = options[:port]
-        Warehouse::Mailer[:user] = options[:user_name]
-        Warehouse::Mailer[:pass] = options[:password]
-        Warehouse::Mailer[:auth] = options[:authentication]
+        Warehouse::Mailer.config[:domain] = options[:domain]         if options[:domain] &amp;&amp; options[:domain].size &gt; 0
+        Warehouse::Mailer.config[:host]   = options[:address]        if options[:address] &amp;&amp; options[:address].size &gt; 0
+        Warehouse::Mailer.config[:port]   = options[:port]           if options[:port]
+        Warehouse::Mailer.config[:user]   = options[:user_name]      if options[:user_name] &amp;&amp; options[:user_name].size &gt; 0
+        Warehouse::Mailer.config[:pass]   = options[:password]       if options[:password] &amp;&amp; options[:password].size &gt; 0
+        Warehouse::Mailer.config[:auth]   = options[:authentication] if options[:authentication] &amp;&amp; options[:authentication].size &gt; 0
       end
     end
     </diff>
      <filename>lib/warehouse.rb</filename>
    </modified>
    <modified>
      <diff>@@ -1,10 +1,8 @@
 begin
-  require 'rubygems'
   require 'mailfactory'
   require 'net/smtp'
 rescue LoadError
-  puts &quot;You need to install the mailfactory gem to use Merb::Mailer&quot;
-  MERB_LOGGER.warn &quot;You need to install the mailfactory gem to use Merb::Mailer&quot;
+  puts &quot;You need to install the mailfactory gem to use Warehouse::Mailer&quot;
 end  
 
 class MailFactory
@@ -35,7 +33,12 @@ module Warehouse
   #   m.deliver!                     
 
   class Mailer
-    class_inheritable_accessor :config, :delivery_method, :deliveries
+    class &lt;&lt; self
+      attr_accessor :config
+      attr_accessor :delivery_method
+      attr_accessor :deliveries
+    end
+
     attr_accessor :mail
     self.deliveries = []
     
@@ -47,18 +50,18 @@ module Warehouse
   
     # :plain, :login, or :cram_md5
     def net_smtp
-      Net::SMTP.start(config[:host], config[:port].to_i, config[:domain], 
-                      config[:user], config[:pass], (config[:auth].to_sym||:plain)) { |smtp|
+      Net::SMTP.start(self.class.config[:host], self.class.config[:port].to_i, self.class.config[:domain], 
+                      self.class.config[:user], self.class.config[:pass], (self.class.config[:auth].to_sym||:plain)) { |smtp|
         smtp.send_message(@mail.to_s, @mail.from.first, @mail.to)
       }
     end
     
     def test_send
-      deliveries &lt;&lt; @mail
+      self.class.deliveries &lt;&lt; @mail
     end
     
     def deliver!
-      send(delivery_method || :net_smtp)
+      send(self.class.delivery_method || :net_smtp)
     end
       
     def attach(file_or_files, filename = file_or_files.is_a?(File) ? File.basename(file_or_files.path) : nil, 
@@ -72,8 +75,7 @@ module Warehouse
     end
       
     def initialize(o={})
-      self.config = :sendmail if config.nil?
-      o[:rawhtml] = o.delete(:html)
+      self.class.config = :sendmail if self.class.config.nil?
       m = MailFactory.new()
       o.each { |k,v| m.send &quot;#{k}=&quot;, v }
       @mail = m</diff>
      <filename>lib/warehouse/mailer.rb</filename>
    </modified>
    <modified>
      <diff>@@ -34,20 +34,20 @@ Warehouse::Hooks.define :email do
   
   body do
     html = []
-    body &lt;&lt; &quot;&lt;h2&gt;#{commit.revision}: #{CGI.escapeHTML(first_commit_line)}&lt;/h2&gt;&quot;
-    body &lt;&lt; &quot;&lt;p&gt;&lt;strong&gt;#{CGI.escapeHTML commit.author.capitalize}&lt;/strong&gt; &amp;#8212; &quot; + 
+    html &lt;&lt; &quot;&lt;h2&gt;#{commit.revision}: #{CGI.escapeHTML(first_commit_line)}&lt;/h2&gt;&quot;
+    html &lt;&lt; &quot;&lt;p&gt;&lt;strong&gt;#{CGI.escapeHTML commit.author.capitalize}&lt;/strong&gt; &amp;#8212; &quot; + 
       commit.changed_at.strftime(&quot;%I:%M%p, %a %d %b %Y&quot;) + &quot;&lt;/p&gt;&quot;
 
-    body &lt;&lt; &quot;&lt;hr /&gt;&quot;
+    html &lt;&lt; &quot;&lt;hr /&gt;&quot;
     
     if extended_commit_lines
-      body &lt;&lt; &quot;&lt;h3&gt;Complete change description:&lt;/h3&gt;&quot;
+      html &lt;&lt; &quot;&lt;h3&gt;Complete change description:&lt;/h3&gt;&quot;
       extended_commit_lines.each do |line|
-        body &lt;&lt; &quot;&lt;p&gt;#{CGI.escapeHTML(line)}&lt;/p&gt;&quot;
+        html &lt;&lt; &quot;&lt;p&gt;#{CGI.escapeHTML(line)}&lt;/p&gt;&quot;
       end
     end
     
-    body &lt;&lt; &quot;&lt;pre&gt;&quot;
+    html &lt;&lt; &quot;&lt;pre&gt;&quot;
     commit.diff.split(&quot;\n&quot;).each do |line|
       color = nil
       if line.match(/^Modified: /) || line.match(/^Added: /) || line.match(/^=+$/)
@@ -62,10 +62,10 @@ Warehouse::Hooks.define :email do
         color = &quot;#000&quot;
       end
 
-      body &lt;&lt; &quot;&lt;span style=\&quot;color:#{color};\&quot;&gt;#{CGI.escapeHTML(line)}&lt;/span&gt;\n&quot;
+      html &lt;&lt; &quot;&lt;span style=\&quot;color:#{color};\&quot;&gt;#{CGI.escapeHTML(line)}&lt;/span&gt;&quot;
     end
-    body &lt;&lt; &quot;&lt;/pre&gt;&quot;
-    body * &quot;\n&quot;
+    html &lt;&lt; &quot;&lt;/pre&gt;&quot;
+    html * &quot;\n&quot;
   end
   
   run do</diff>
      <filename>vendor/plugins/hooks/email/hook.rb</filename>
    </modified>
    <modified>
      <diff>@@ -72,7 +72,11 @@ END_XML
       when Net::HTTPSuccess, Net::HTTPRedirection
         ## all good, we submitted...
       else
-        raise &quot;#{res.inspect} - #{res.body}&quot;
+        if res.code == '422'
+          puts &quot;Validation error: #{res.body}&quot;
+        else
+          raise &quot;#{res.inspect} - #{res.body}&quot;
+        end
     end
   end
 end
\ No newline at end of file</diff>
      <filename>vendor/plugins/hooks/lighthouse/hook.rb</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>6006304bd83e39abe1c81e3cc4c466872898050e</id>
    </parent>
  </parents>
  <author>
    <name>rick</name>
    <email>rick@8456e5f2-bb15-0410-bd20-b44782a1fb1e</email>
  </author>
  <url>http://github.com/entp/warehouse/commit/2f13f04c4a3be4ab1faed349e8e7f86a35a363d5</url>
  <id>2f13f04c4a3be4ab1faed349e8e7f86a35a363d5</id>
  <committed-date>2007-10-14T16:19:05-07:00</committed-date>
  <authored-date>2007-10-14T16:19:05-07:00</authored-date>
  <message>freeze mailfactory, small tweaks to get mailing working

git-svn-id: http://activereload.svn.engineyard.com/warehouse/trunk@2231 8456e5f2-bb15-0410-bd20-b44782a1fb1e</message>
  <tree>e8f62dc168f890f0899defcb69ebffd266ba82d9</tree>
  <committer>
    <name>rick</name>
    <email>rick@8456e5f2-bb15-0410-bd20-b44782a1fb1e</email>
  </committer>
</commit>
