actionmailer 4.2.2 → 4.2.3.rc1
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of actionmailer might be problematic. Click here for more details.
- checksums.yaml +4 -4
- data/CHANGELOG.md +26 -2
- data/lib/action_mailer.rb +1 -0
- data/lib/action_mailer/base.rb +3 -2
- data/lib/action_mailer/gem_version.rb +2 -2
- data/lib/action_mailer/inline_preview_interceptor.rb +61 -0
- data/lib/action_mailer/test_helper.rb +1 -1
- metadata +11 -10
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 95bf7d98e9eb4f7a05005ed8a79df1146b4635da
|
4
|
+
data.tar.gz: 1b6bb805060606d3c9244053f27322ffe0029694
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 64f27b1b83e064be1be380014cdf11937b82ac0adc533729cb1d37a698f413fee2f7bef889ff8df28e6eba445c2a1937af28100b007f971b5ab49c5765b0e30c
|
7
|
+
data.tar.gz: d5ad4425863bdfa83f624aac4199199ff3e1ac272a140afa70a20fa68c8fa20663777b51a6f80a1da708a843f6823dd97d1067747b543eb7f7fad6e87ca9f7cc
|
data/CHANGELOG.md
CHANGED
@@ -1,11 +1,35 @@
|
|
1
|
+
## Rails 4.2.3 (June 22, 2015) ##
|
2
|
+
|
3
|
+
* `assert_emails` in block form use the given number as expected value.
|
4
|
+
This makes the error message much easier to understand.
|
5
|
+
|
6
|
+
*Yuji Yaginuma*
|
7
|
+
|
8
|
+
* Mailer preview now uses `url_for` to fix links to emails for apps running on
|
9
|
+
a subdirectory.
|
10
|
+
|
11
|
+
*Remo Mueller*
|
12
|
+
|
13
|
+
* Mailer previews no longer crash when the `mail` method wasn't called
|
14
|
+
(`NullMail`).
|
15
|
+
|
16
|
+
Fixes #19849.
|
17
|
+
|
18
|
+
*Yves Senn*
|
19
|
+
|
20
|
+
* Make sure labels and values line up in mailer previews.
|
21
|
+
|
22
|
+
*Yves Senn*
|
23
|
+
|
24
|
+
|
1
25
|
## Rails 4.2.2 (June 16, 2015) ##
|
2
26
|
|
3
27
|
* No Changes *
|
4
28
|
|
5
29
|
|
6
|
-
## Rails 4.2.1 (March 19,
|
30
|
+
## Rails 4.2.1 (March 19, 2015) ##
|
7
31
|
|
8
|
-
* No
|
32
|
+
* No Changes *
|
9
33
|
|
10
34
|
|
11
35
|
## Rails 4.2.0 (December 20, 2014) ##
|
data/lib/action_mailer.rb
CHANGED
data/lib/action_mailer/base.rb
CHANGED
@@ -381,8 +381,8 @@ module ActionMailer
|
|
381
381
|
# * <tt>:password</tt> - If your mail server requires authentication, set the password in this setting.
|
382
382
|
# * <tt>:authentication</tt> - If your mail server requires authentication, you need to specify the
|
383
383
|
# authentication type here.
|
384
|
-
# This is a symbol and one of <tt>:plain</tt> (will send the password
|
385
|
-
# send password Base64 encoded) or <tt>:cram_md5</tt> (combines a Challenge/Response mechanism to exchange
|
384
|
+
# This is a symbol and one of <tt>:plain</tt> (will send the password Base64 encoded), <tt>:login</tt> (will
|
385
|
+
# send the password Base64 encoded) or <tt>:cram_md5</tt> (combines a Challenge/Response mechanism to exchange
|
386
386
|
# information and a cryptographic Message Digest 5 algorithm to hash important information)
|
387
387
|
# * <tt>:enable_starttls_auto</tt> - Detects if STARTTLS is enabled in your SMTP server and starts
|
388
388
|
# to use it. Defaults to <tt>true</tt>.
|
@@ -600,6 +600,7 @@ module ActionMailer
|
|
600
600
|
|
601
601
|
class NullMail #:nodoc:
|
602
602
|
def body; '' end
|
603
|
+
def header; {} end
|
603
604
|
|
604
605
|
def respond_to?(string, include_all=false)
|
605
606
|
true
|
@@ -0,0 +1,61 @@
|
|
1
|
+
require 'base64'
|
2
|
+
|
3
|
+
module ActionMailer
|
4
|
+
# Implements a mailer preview interceptor that converts image tag src attributes
|
5
|
+
# that use inline cid: style urls to data: style urls so that they are visible
|
6
|
+
# when previewing a HTML email in a web browser.
|
7
|
+
#
|
8
|
+
# This interceptor is not enabled by default, to use it just register it like any
|
9
|
+
# other mailer preview interceptor:
|
10
|
+
#
|
11
|
+
# ActionMailer::Base.register_preview_interceptor(ActionMailer::InlinePreviewInterceptor)
|
12
|
+
#
|
13
|
+
class InlinePreviewInterceptor
|
14
|
+
PATTERN = /src=(?:"cid:[^"]+"|'cid:[^']+')/i
|
15
|
+
|
16
|
+
include Base64
|
17
|
+
|
18
|
+
def self.previewing_email(message) #:nodoc:
|
19
|
+
new(message).transform!
|
20
|
+
end
|
21
|
+
|
22
|
+
def initialize(message) #:nodoc:
|
23
|
+
@message = message
|
24
|
+
end
|
25
|
+
|
26
|
+
def transform! #:nodoc:
|
27
|
+
return message if html_part.blank?
|
28
|
+
|
29
|
+
html_source.gsub!(PATTERN) do |match|
|
30
|
+
if part = find_part(match[9..-2])
|
31
|
+
%[src="#{data_url(part)}"]
|
32
|
+
else
|
33
|
+
match
|
34
|
+
end
|
35
|
+
end
|
36
|
+
|
37
|
+
message
|
38
|
+
end
|
39
|
+
|
40
|
+
private
|
41
|
+
def message
|
42
|
+
@message
|
43
|
+
end
|
44
|
+
|
45
|
+
def html_part
|
46
|
+
@html_part ||= message.html_part
|
47
|
+
end
|
48
|
+
|
49
|
+
def html_source
|
50
|
+
html_part.body.raw_source
|
51
|
+
end
|
52
|
+
|
53
|
+
def data_url(part)
|
54
|
+
"data:#{part.mime_type};base64,#{strict_encode64(part.body.raw_source)}"
|
55
|
+
end
|
56
|
+
|
57
|
+
def find_part(cid)
|
58
|
+
message.all_parts.find{ |p| p.attachment? && p.cid == cid }
|
59
|
+
end
|
60
|
+
end
|
61
|
+
end
|
@@ -30,7 +30,7 @@ module ActionMailer
|
|
30
30
|
original_count = ActionMailer::Base.deliveries.size
|
31
31
|
yield
|
32
32
|
new_count = ActionMailer::Base.deliveries.size
|
33
|
-
assert_equal
|
33
|
+
assert_equal number, new_count - original_count, "#{number} emails expected, but #{new_count - original_count} were sent"
|
34
34
|
else
|
35
35
|
assert_equal number, ActionMailer::Base.deliveries.size
|
36
36
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: actionmailer
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 4.2.
|
4
|
+
version: 4.2.3.rc1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- David Heinemeier Hansson
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-06-
|
11
|
+
date: 2015-06-22 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: actionpack
|
@@ -16,42 +16,42 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - '='
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: 4.2.
|
19
|
+
version: 4.2.3.rc1
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
24
|
- - '='
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version: 4.2.
|
26
|
+
version: 4.2.3.rc1
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: actionview
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
31
|
- - '='
|
32
32
|
- !ruby/object:Gem::Version
|
33
|
-
version: 4.2.
|
33
|
+
version: 4.2.3.rc1
|
34
34
|
type: :runtime
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
38
|
- - '='
|
39
39
|
- !ruby/object:Gem::Version
|
40
|
-
version: 4.2.
|
40
|
+
version: 4.2.3.rc1
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
42
|
name: activejob
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
44
44
|
requirements:
|
45
45
|
- - '='
|
46
46
|
- !ruby/object:Gem::Version
|
47
|
-
version: 4.2.
|
47
|
+
version: 4.2.3.rc1
|
48
48
|
type: :runtime
|
49
49
|
prerelease: false
|
50
50
|
version_requirements: !ruby/object:Gem::Requirement
|
51
51
|
requirements:
|
52
52
|
- - '='
|
53
53
|
- !ruby/object:Gem::Version
|
54
|
-
version: 4.2.
|
54
|
+
version: 4.2.3.rc1
|
55
55
|
- !ruby/object:Gem::Dependency
|
56
56
|
name: mail
|
57
57
|
requirement: !ruby/object:Gem::Requirement
|
@@ -108,6 +108,7 @@ files:
|
|
108
108
|
- lib/action_mailer/delivery_job.rb
|
109
109
|
- lib/action_mailer/delivery_methods.rb
|
110
110
|
- lib/action_mailer/gem_version.rb
|
111
|
+
- lib/action_mailer/inline_preview_interceptor.rb
|
111
112
|
- lib/action_mailer/log_subscriber.rb
|
112
113
|
- lib/action_mailer/mail_helper.rb
|
113
114
|
- lib/action_mailer/message_delivery.rb
|
@@ -135,9 +136,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
135
136
|
version: 1.9.3
|
136
137
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
137
138
|
requirements:
|
138
|
-
- - "
|
139
|
+
- - ">"
|
139
140
|
- !ruby/object:Gem::Version
|
140
|
-
version:
|
141
|
+
version: 1.3.1
|
141
142
|
requirements:
|
142
143
|
- none
|
143
144
|
rubyforge_project:
|