mail 1.4.3 → 1.5.0

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of mail might be problematic. Click here for more details.

Files changed (37) hide show
  1. data/CHANGELOG.rdoc +14 -0
  2. data/README.rdoc +6 -6
  3. data/Rakefile +1 -1
  4. data/lib/mail/body.rb +2 -2
  5. data/lib/mail/field.rb +1 -1
  6. data/lib/mail/fields/bcc_field.rb +5 -6
  7. data/lib/mail/fields/cc_field.rb +5 -4
  8. data/lib/mail/fields/comments_field.rb +3 -7
  9. data/lib/mail/fields/common/common_address.rb +8 -0
  10. data/lib/mail/fields/common/common_date.rb +4 -0
  11. data/lib/mail/fields/common/common_field.rb +5 -1
  12. data/lib/mail/fields/common/common_message_id.rb +8 -0
  13. data/lib/mail/fields/content_transfer_encoding_field.rb +1 -1
  14. data/lib/mail/fields/content_type_field.rb +4 -0
  15. data/lib/mail/fields/date_field.rb +7 -7
  16. data/lib/mail/fields/from_field.rb +5 -4
  17. data/lib/mail/fields/in_reply_to_field.rb +2 -3
  18. data/lib/mail/fields/keywords_field.rb +4 -0
  19. data/lib/mail/fields/message_id_field.rb +3 -4
  20. data/lib/mail/fields/references_field.rb +2 -3
  21. data/lib/mail/fields/reply_to_field.rb +5 -4
  22. data/lib/mail/fields/resent_bcc_field.rb +5 -4
  23. data/lib/mail/fields/resent_cc_field.rb +5 -4
  24. data/lib/mail/fields/resent_date_field.rb +9 -1
  25. data/lib/mail/fields/resent_from_field.rb +6 -5
  26. data/lib/mail/fields/resent_sender_field.rb +1 -1
  27. data/lib/mail/fields/resent_to_field.rb +5 -4
  28. data/lib/mail/fields/sender_field.rb +6 -5
  29. data/lib/mail/fields/structured_field.rb +4 -0
  30. data/lib/mail/fields/to_field.rb +5 -4
  31. data/lib/mail/fields/unstructured_field.rb +4 -0
  32. data/lib/mail/header.rb +4 -3
  33. data/lib/mail/message.rb +619 -105
  34. data/lib/mail/network/delivery_methods/smtp.rb +1 -1
  35. data/lib/mail/utilities.rb +14 -3
  36. data/lib/mail/version.rb +2 -2
  37. metadata +2 -2
@@ -62,7 +62,7 @@ module Mail
62
62
  config = Mail.defaults
63
63
 
64
64
  # TODO: use the "return-path" field by default instead of the "from" field ? (see ActionMailer)
65
- from = mail.from.addresses.first if mail.respond_to?(:from) && mail.from
65
+ from = mail.from_addrs.first
66
66
  raise ArgumentError.new('An author -from- is required to send a message') if from.blank?
67
67
  to ||= mail.destinations if mail.respond_to?(:destinations) && mail.destinations
68
68
  raise ArgumentError.new('At least one recipient -to, cc, bcc- is required to send a message') if to.blank?
@@ -130,16 +130,27 @@ module Mail
130
130
  def constantize( str )
131
131
  str.to_s.split(/[-_]/).map { |v| v.capitalize }.to_s
132
132
  end
133
+
134
+ # Swaps out all underscores (_) for hyphens (-) good for stringing from symbols
135
+ # a field name.
136
+ #
137
+ # Example:
138
+ #
139
+ # string = :resent_from_field
140
+ # dasherize ( string ) #=> 'resent_from_field'
141
+ def dasherize( str )
142
+ str.to_s.downcase.gsub('_', '-')
143
+ end
133
144
 
134
- # Swaps out all hyphens (-) for underscores (_) good for symbolizing
145
+ # Swaps out all underscores (_) for hyphens (-) good for stringing from symbols
135
146
  # a field name.
136
147
  #
137
148
  # Example:
138
149
  #
139
- # string = 'Resent-From-Field'
150
+ # string = :resent_from_field
140
151
  # underscoreize ( string ) #=> 'resent_from_field'
141
152
  def underscoreize( str )
142
- str.to_s.downcase.gsub('_', '-')
153
+ str.to_s.downcase.gsub('-', '_')
143
154
  end
144
155
 
145
156
  end
@@ -2,8 +2,8 @@
2
2
  module Mail
3
3
  module VERSION
4
4
  MAJOR = 1
5
- MINOR = 4
6
- TINY = 3
5
+ MINOR = 5
6
+ TINY = 0
7
7
 
8
8
  STRING = [MAJOR, MINOR, TINY].join('.')
9
9
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mail
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.4.3
4
+ version: 1.5.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Mike Lindsaar
@@ -9,7 +9,7 @@ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
 
12
- date: 2009-12-31 00:00:00 +11:00
12
+ date: 2010-01-03 00:00:00 +11:00
13
13
  default_executable:
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency