Skip to content
This repository
Browse code

Removing utils, and updating requires to match

  • Loading branch information...
commit a6eed86c33fbd074a08b76a678e968f521cf37b0 1 parent 3cb46b4
Mikel Lindsaar authored November 23, 2009
14  actionmailer/CHANGELOG
... ...
@@ -1,13 +1,16 @@
1 1
 *Mail Integration
2 2
 
3  
-* Mail does not have "quoted_body", "quoted_subject" etc.  All of these are accessed via body.encoded, subject.encoded etc
  3
+* Mail does not have "quoted_body", "quoted_subject" etc.  All of these are accessed via body.encoded, 
  4
+  subject.encoded etc
4 5
 
5  
-* Every part of a Mail object returns an object, never a string.  So Mail.body returns a Mail::Body class object, need to call #encoded or #decoded to get the string you want
  6
+* Every part of a Mail object returns an object, never a string.  So Mail.body returns a Mail::Body
  7
+  class object, need to call #encoded or #decoded to get the string you want
6 8
 
7 9
 * Mail::Message#set_content_type does not exist, it is simply Mail::Message#content_type
8 10
 
9  
-* Every mail message gets a unique message_id unless you specify one, had to change all the tests that check for
10  
-  equality with expected.encoded == actual.encoded to first replace their message_ids with control values
  11
+* Every mail message gets a unique message_id unless you specify one, had to change all the tests that
  12
+  check for equality with expected.encoded == actual.encoded to first replace their message_ids with
  13
+  control values
11 14
 
12 15
 * Mail now has a proper concept of parts, remove the ActionMailer::Part and ActionMailer::PartContainer classes
13 16
 
@@ -20,9 +23,6 @@
20 23
   
21 24
 * There is no idea of a "sub_head" in Mail.  A part is just a Message with some extra functionality, so it 
22 25
   just has a "header" like a normal mail message
23  
-  
24  
-* When you want to add a nested part, you now need to use "add_part(params)" instead of "part(params)"  This
25  
-  creates a Mail gem Part object
26 26
 
27 27
 *2.3.2 [Final] (March 15, 2009)*
28 28
 
5  actionmailer/lib/action_mailer.rb
@@ -40,7 +40,6 @@ def self.load_all!
40 40
   autoload :Quoting, 'action_mailer/quoting'
41 41
   autoload :TestCase, 'action_mailer/test_case'
42 42
   autoload :TestHelper, 'action_mailer/test_helper'
43  
-  autoload :Utils, 'action_mailer/utils'
44 43
 
45 44
 end
46 45
 
@@ -54,5 +53,5 @@ module Net
54 53
 
55 54
 autoload :MailHelper, 'action_mailer/mail_helper'
56 55
 
57  
-gem 'mail', '>= 1.2.8'
58  
-require 'mail'
  56
+gem 'mail', '>= 1.2.9'
  57
+require 'mail'
6  actionmailer/lib/action_mailer/base.rb
@@ -251,7 +251,7 @@ module ActionMailer #:nodoc:
251 251
   #   and appear last in the mime encoded message. You can also pick a different order from inside a method with
252 252
   #   +implicit_parts_order+.
253 253
   class Base
254  
-    include AdvAttrAccessor, Quoting, Utils
  254
+    include AdvAttrAccessor, Quoting
255 255
 
256 256
     include AbstractController::RenderingController
257 257
     include AbstractController::LocalizedCache
@@ -617,11 +617,11 @@ def create_mail
617 617
         if @parts.empty?
618 618
           main_type, sub_type = split_content_type(real_content_type)
619 619
           m.content_type([main_type, sub_type, ctype_attrs])
620  
-          m.body = normalize_new_lines(body)
  620
+          m.body = body
621 621
         elsif @parts.size == 1 && @parts.first.parts.empty?
622 622
           main_type, sub_type = split_content_type(real_content_type)
623 623
           m.content_type([main_type, sub_type, ctype_attrs])
624  
-          m.body = normalize_new_lines(@parts.first.body)
  624
+          m.body = @parts.first.body.encoded
625 625
         else
626 626
           @parts.each do |p|
627 627
             m.add_part(p)
7  actionmailer/lib/action_mailer/utils.rb
... ...
@@ -1,7 +0,0 @@
1  
-module ActionMailer
2  
-  module Utils #:nodoc:
3  
-    def normalize_new_lines(text)
4  
-      text.to_s.gsub(/\r\n?/, "\n")
5  
-    end
6  
-  end
7  
-end

0 notes on commit a6eed86

Please sign in to comment.
Something went wrong with that request. Please try again.