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.
- data/CHANGELOG.rdoc +14 -0
- data/README.rdoc +6 -6
- data/Rakefile +1 -1
- data/lib/mail/body.rb +2 -2
- data/lib/mail/field.rb +1 -1
- data/lib/mail/fields/bcc_field.rb +5 -6
- data/lib/mail/fields/cc_field.rb +5 -4
- data/lib/mail/fields/comments_field.rb +3 -7
- data/lib/mail/fields/common/common_address.rb +8 -0
- data/lib/mail/fields/common/common_date.rb +4 -0
- data/lib/mail/fields/common/common_field.rb +5 -1
- data/lib/mail/fields/common/common_message_id.rb +8 -0
- data/lib/mail/fields/content_transfer_encoding_field.rb +1 -1
- data/lib/mail/fields/content_type_field.rb +4 -0
- data/lib/mail/fields/date_field.rb +7 -7
- data/lib/mail/fields/from_field.rb +5 -4
- data/lib/mail/fields/in_reply_to_field.rb +2 -3
- data/lib/mail/fields/keywords_field.rb +4 -0
- data/lib/mail/fields/message_id_field.rb +3 -4
- data/lib/mail/fields/references_field.rb +2 -3
- data/lib/mail/fields/reply_to_field.rb +5 -4
- data/lib/mail/fields/resent_bcc_field.rb +5 -4
- data/lib/mail/fields/resent_cc_field.rb +5 -4
- data/lib/mail/fields/resent_date_field.rb +9 -1
- data/lib/mail/fields/resent_from_field.rb +6 -5
- data/lib/mail/fields/resent_sender_field.rb +1 -1
- data/lib/mail/fields/resent_to_field.rb +5 -4
- data/lib/mail/fields/sender_field.rb +6 -5
- data/lib/mail/fields/structured_field.rb +4 -0
- data/lib/mail/fields/to_field.rb +5 -4
- data/lib/mail/fields/unstructured_field.rb +4 -0
- data/lib/mail/header.rb +4 -3
- data/lib/mail/message.rb +619 -105
- data/lib/mail/network/delivery_methods/smtp.rb +1 -1
- data/lib/mail/utilities.rb +14 -3
- data/lib/mail/version.rb +2 -2
- 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.
|
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?
|
data/lib/mail/utilities.rb
CHANGED
@@ -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
|
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 =
|
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
|
data/lib/mail/version.rb
CHANGED
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
|
+
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:
|
12
|
+
date: 2010-01-03 00:00:00 +11:00
|
13
13
|
default_executable:
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|