actionmailer_inline_css 1.5.0 → 1.5.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/.gitignore +1 -0
- data/.travis.yml +1 -0
- data/actionmailer_inline_css.gemspec +1 -1
- data/lib/action_mailer/inline_css_hook.rb +4 -2
- data/test/inline_css_hook_test.rb +9 -4
- metadata +10 -10
data/.gitignore
CHANGED
data/.travis.yml
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
Gem::Specification.new do |s|
|
2
2
|
s.name = "actionmailer_inline_css"
|
3
|
-
s.version = "1.5.
|
3
|
+
s.version = "1.5.1"
|
4
4
|
s.date = Time.now.strftime('%Y-%m-%d')
|
5
5
|
s.summary = "Always send HTML e-mails with inline CSS, using the 'premailer' gem"
|
6
6
|
s.email = "nathan.f77@gmail.com"
|
@@ -16,19 +16,21 @@ module ActionMailer
|
|
16
16
|
:base_url => message.header[:host].to_s)
|
17
17
|
existing_text_part = message.text_part && message.text_part.body.to_s
|
18
18
|
existing_attachments = message.attachments
|
19
|
+
msg_charset = message.charset
|
19
20
|
|
20
21
|
# Reset the body
|
21
22
|
message.body = nil
|
23
|
+
message.body.instance_variable_set("@parts", Mail::PartsList.new)
|
22
24
|
|
23
25
|
# Add an HTML part with CSS inlined.
|
24
26
|
message.html_part do
|
25
|
-
content_type "text/
|
27
|
+
content_type "text/plain; charset=#{charset}"
|
26
28
|
body premailer.to_inline_css
|
27
29
|
end
|
28
30
|
|
29
31
|
# Add a text part with either the pre-existing text part, or one generated with premailer.
|
30
32
|
message.text_part do
|
31
|
-
content_type "text/plain; charset
|
33
|
+
content_type "text/plain; charset=#{charset}"
|
32
34
|
body existing_text_part || premailer.to_plain_text
|
33
35
|
end
|
34
36
|
|
@@ -98,15 +98,20 @@ class InlineCssHookTest < ActionMailer::TestCase
|
|
98
98
|
mail = HelperMailer.use_inline_css_hook_with_text_and_html_parts.deliver
|
99
99
|
assert_match '<div id="test" style="color: #123456;">Test</div>', mail.html_part.body.encoded
|
100
100
|
# Test specified text part
|
101
|
-
assert_match 'Different Text Part', mail.text_part.
|
101
|
+
assert_match 'Different Text Part', mail.text_part.decoded
|
102
102
|
end
|
103
103
|
|
104
104
|
def test_inline_css_hook_with_utf_8_characters
|
105
105
|
mail = nil
|
106
106
|
mail = HelperMailer.use_inline_css_hook_with_utf_8.deliver
|
107
|
-
|
108
|
-
assert_match '
|
109
|
-
assert_match '
|
107
|
+
|
108
|
+
assert_match 'ᚠᛇᚻ᛫ᛒᛦᚦ᛫ᚠᚱᚩᚠᚢᚱ', mail.html_part.decoded
|
109
|
+
assert_match 'Gonçalves', mail.html_part.decoded
|
110
|
+
assert_match 'ᚠᛇᚻ᛫ᛒᛦᚦ᛫ᚠᚱᚩᚠᚢᚱ', mail.text_part.decoded
|
111
|
+
assert_match '=E1=9A=A0=E1=9B=87=E1=9A=BB=', mail.html_part.encoded
|
112
|
+
|
113
|
+
assert_equal mail.html_part.content_transfer_encoding, "quoted-printable"
|
114
|
+
assert_equal mail.text_part.content_transfer_encoding, "base64"
|
110
115
|
end
|
111
116
|
|
112
117
|
def test_inline_css_hook_with_base_url
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: actionmailer_inline_css
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.5.
|
4
|
+
version: 1.5.1
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,11 +9,11 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2012-01-
|
12
|
+
date: 2012-01-07 00:00:00.000000000Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: actionmailer
|
16
|
-
requirement: &
|
16
|
+
requirement: &83824600 !ruby/object:Gem::Requirement
|
17
17
|
none: false
|
18
18
|
requirements:
|
19
19
|
- - ! '>='
|
@@ -21,10 +21,10 @@ dependencies:
|
|
21
21
|
version: 3.0.0
|
22
22
|
type: :runtime
|
23
23
|
prerelease: false
|
24
|
-
version_requirements: *
|
24
|
+
version_requirements: *83824600
|
25
25
|
- !ruby/object:Gem::Dependency
|
26
26
|
name: premailer
|
27
|
-
requirement: &
|
27
|
+
requirement: &83824360 !ruby/object:Gem::Requirement
|
28
28
|
none: false
|
29
29
|
requirements:
|
30
30
|
- - ! '>='
|
@@ -32,10 +32,10 @@ dependencies:
|
|
32
32
|
version: 1.7.1
|
33
33
|
type: :runtime
|
34
34
|
prerelease: false
|
35
|
-
version_requirements: *
|
35
|
+
version_requirements: *83824360
|
36
36
|
- !ruby/object:Gem::Dependency
|
37
37
|
name: nokogiri
|
38
|
-
requirement: &
|
38
|
+
requirement: &83824130 !ruby/object:Gem::Requirement
|
39
39
|
none: false
|
40
40
|
requirements:
|
41
41
|
- - ! '>='
|
@@ -43,10 +43,10 @@ dependencies:
|
|
43
43
|
version: 1.4.4
|
44
44
|
type: :runtime
|
45
45
|
prerelease: false
|
46
|
-
version_requirements: *
|
46
|
+
version_requirements: *83824130
|
47
47
|
- !ruby/object:Gem::Dependency
|
48
48
|
name: mocha
|
49
|
-
requirement: &
|
49
|
+
requirement: &83823900 !ruby/object:Gem::Requirement
|
50
50
|
none: false
|
51
51
|
requirements:
|
52
52
|
- - ! '>='
|
@@ -54,7 +54,7 @@ dependencies:
|
|
54
54
|
version: 0.10.0
|
55
55
|
type: :development
|
56
56
|
prerelease: false
|
57
|
-
version_requirements: *
|
57
|
+
version_requirements: *83823900
|
58
58
|
description: Module for ActionMailer to improve the rendering of HTML emails by using
|
59
59
|
the 'premailer' gem, which inlines CSS and makes relative links absolute.
|
60
60
|
email: nathan.f77@gmail.com
|