actionmailer_inline_css 1.5.3 → 1.6.0
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.
- checksums.yaml +7 -0
- data/.travis.yml +2 -3
- data/Gemfile +0 -6
- data/README.md +1 -1
- data/actionmailer_inline_css.gemspec +4 -3
- data/lib/overrides/premailer/premailer.rb +7 -5
- data/test/abstract_unit.rb +5 -8
- data/test/inline_css_hook_test.rb +2 -2
- metadata +39 -33
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: 970adc3ca890094c7a5f4b2f0879c5100fe3b297
|
4
|
+
data.tar.gz: d1a0b7c0732dcc7b360ef17f69e55ddf0b452b6c
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 8fb4b7213efc6f60bd9966a808e47bf95cf244145883212d31ab4989951395109922f9015410dafd74659a03b821ff0d112448e233b8fac9d988d53087006db2
|
7
|
+
data.tar.gz: cf700a48a7fc7a9b5182d5404541939c0f0f4c4b56e9e50335128cbd692af7d12ed7d83511b03ff8a2cb54897eba36fac593a0e933c54a8a6ce88c778201ae6a
|
data/.travis.yml
CHANGED
data/Gemfile
CHANGED
data/README.md
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
# ActionMailer Inline CSS [](http://travis-ci.org/premailer/actionmailer_inline_css)
|
2
2
|
|
3
3
|
Seamlessly integrate [Alex Dunae's premailer](http://premailer.dialect.ca/) gem with ActionMailer.
|
4
4
|
|
@@ -1,6 +1,6 @@
|
|
1
1
|
Gem::Specification.new do |s|
|
2
2
|
s.name = "actionmailer_inline_css"
|
3
|
-
s.version = "1.
|
3
|
+
s.version = "1.6.0"
|
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 = "[email protected]"
|
@@ -13,8 +13,9 @@ Gem::Specification.new do |s|
|
|
13
13
|
s.executables = `git ls-files -- bin/*`.split("\n").map { |f| File.basename(f) }
|
14
14
|
s.require_paths = ["lib"]
|
15
15
|
s.add_dependency('actionmailer', '>= 3.0.0')
|
16
|
-
s.add_dependency('premailer', '>= 1.
|
17
|
-
s.add_dependency('nokogiri', '>= 1.
|
16
|
+
s.add_dependency('premailer', '>= 1.11.0')
|
17
|
+
s.add_dependency('nokogiri', '>= 1.7.0')
|
18
|
+
s.add_development_dependency('test-unit')
|
18
19
|
s.add_development_dependency('mocha', '>= 0.10.0')
|
19
20
|
end
|
20
21
|
|
@@ -1,23 +1,25 @@
|
|
1
1
|
require 'premailer'
|
2
2
|
|
3
|
-
|
3
|
+
module LoadFileWithRailsPath
|
4
4
|
protected
|
5
5
|
# When using the 'stylesheet_link_tag' helper in Rails, css URIs are given with
|
6
6
|
# a leading slash and a cache buster (e.g. ?12412422).
|
7
7
|
# This override handles these cases, while falling back to the default implementation.
|
8
|
-
def
|
8
|
+
def load_css_from_local_file!(path)
|
9
9
|
# Remove query string and the path
|
10
10
|
clean_path = path.sub(/\?.*$/, '').sub(%r(^https?://[^/]*/), '')
|
11
11
|
rails_path = Rails.root.join('public', clean_path)
|
12
|
-
if File.
|
12
|
+
if File.file?(rails_path)
|
13
13
|
load_css_from_string(File.read(rails_path))
|
14
14
|
elsif (asset = Rails.application.assets.find_asset(clean_path.sub("#{Rails.configuration.assets.prefix}/", '')))
|
15
15
|
load_css_from_string(asset.source)
|
16
16
|
else
|
17
|
-
|
17
|
+
super(path)
|
18
18
|
end
|
19
19
|
end
|
20
|
-
|
20
|
+
end
|
21
21
|
|
22
|
+
class Premailer
|
23
|
+
prepend LoadFileWithRailsPath
|
22
24
|
end
|
23
25
|
|
data/test/abstract_unit.rb
CHANGED
@@ -19,14 +19,11 @@ end
|
|
19
19
|
|
20
20
|
require 'active_support/core_ext/kernel/reporting'
|
21
21
|
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
Encoding.default_internal = "UTF-8"
|
28
|
-
Encoding.default_external = "UTF-8"
|
29
|
-
end
|
22
|
+
# These are the normal settings that will be set up by Railties
|
23
|
+
# TODO: Have these tests support other combinations of these values
|
24
|
+
silence_warnings do
|
25
|
+
Encoding.default_internal = "UTF-8"
|
26
|
+
Encoding.default_external = "UTF-8"
|
30
27
|
end
|
31
28
|
|
32
29
|
lib = File.expand_path("#{File.dirname(__FILE__)}/../lib")
|
@@ -131,13 +131,13 @@ class InlineCssHookTest < ActionMailer::TestCase
|
|
131
131
|
|
132
132
|
def test_alternative_content_type
|
133
133
|
mail = HelperMailer.use_inline_css_hook_with_text_and_html_parts.deliver
|
134
|
-
assert_match /multipart\/alternative/, mail.content_type
|
134
|
+
assert_match( /multipart\/alternative/, mail.content_type )
|
135
135
|
end
|
136
136
|
|
137
137
|
def test_mixed_content_type
|
138
138
|
File.stubs(:read).returns("world")
|
139
139
|
mail = HelperMailer.with_attachment
|
140
140
|
m = ActionMailer::InlineCssHook.delivering_email(mail.deliver)
|
141
|
-
assert_equal "multipart/mixed", m.content_type
|
141
|
+
assert_equal( "multipart/mixed", m.content_type )
|
142
142
|
end
|
143
143
|
end
|
metadata
CHANGED
@@ -1,78 +1,83 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: actionmailer_inline_css
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
5
|
-
prerelease:
|
4
|
+
version: 1.6.0
|
6
5
|
platform: ruby
|
7
6
|
authors:
|
8
7
|
- Nathan Broadbent
|
9
8
|
autorequire:
|
10
9
|
bindir: bin
|
11
10
|
cert_chain: []
|
12
|
-
date:
|
11
|
+
date: 2017-10-10 00:00:00.000000000 Z
|
13
12
|
dependencies:
|
14
13
|
- !ruby/object:Gem::Dependency
|
15
14
|
name: actionmailer
|
16
15
|
requirement: !ruby/object:Gem::Requirement
|
17
|
-
none: false
|
18
16
|
requirements:
|
19
|
-
- -
|
17
|
+
- - ">="
|
20
18
|
- !ruby/object:Gem::Version
|
21
19
|
version: 3.0.0
|
22
20
|
type: :runtime
|
23
21
|
prerelease: false
|
24
22
|
version_requirements: !ruby/object:Gem::Requirement
|
25
|
-
none: false
|
26
23
|
requirements:
|
27
|
-
- -
|
24
|
+
- - ">="
|
28
25
|
- !ruby/object:Gem::Version
|
29
26
|
version: 3.0.0
|
30
27
|
- !ruby/object:Gem::Dependency
|
31
28
|
name: premailer
|
32
29
|
requirement: !ruby/object:Gem::Requirement
|
33
|
-
none: false
|
34
30
|
requirements:
|
35
|
-
- -
|
31
|
+
- - ">="
|
36
32
|
- !ruby/object:Gem::Version
|
37
|
-
version: 1.
|
33
|
+
version: 1.11.0
|
38
34
|
type: :runtime
|
39
35
|
prerelease: false
|
40
36
|
version_requirements: !ruby/object:Gem::Requirement
|
41
|
-
none: false
|
42
37
|
requirements:
|
43
|
-
- -
|
38
|
+
- - ">="
|
44
39
|
- !ruby/object:Gem::Version
|
45
|
-
version: 1.
|
40
|
+
version: 1.11.0
|
46
41
|
- !ruby/object:Gem::Dependency
|
47
42
|
name: nokogiri
|
48
43
|
requirement: !ruby/object:Gem::Requirement
|
49
|
-
none: false
|
50
44
|
requirements:
|
51
|
-
- -
|
45
|
+
- - ">="
|
52
46
|
- !ruby/object:Gem::Version
|
53
|
-
version: 1.
|
47
|
+
version: 1.7.0
|
54
48
|
type: :runtime
|
55
49
|
prerelease: false
|
56
50
|
version_requirements: !ruby/object:Gem::Requirement
|
57
|
-
none: false
|
58
51
|
requirements:
|
59
|
-
- -
|
52
|
+
- - ">="
|
60
53
|
- !ruby/object:Gem::Version
|
61
|
-
version: 1.
|
54
|
+
version: 1.7.0
|
55
|
+
- !ruby/object:Gem::Dependency
|
56
|
+
name: test-unit
|
57
|
+
requirement: !ruby/object:Gem::Requirement
|
58
|
+
requirements:
|
59
|
+
- - ">="
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: '0'
|
62
|
+
type: :development
|
63
|
+
prerelease: false
|
64
|
+
version_requirements: !ruby/object:Gem::Requirement
|
65
|
+
requirements:
|
66
|
+
- - ">="
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
version: '0'
|
62
69
|
- !ruby/object:Gem::Dependency
|
63
70
|
name: mocha
|
64
71
|
requirement: !ruby/object:Gem::Requirement
|
65
|
-
none: false
|
66
72
|
requirements:
|
67
|
-
- -
|
73
|
+
- - ">="
|
68
74
|
- !ruby/object:Gem::Version
|
69
75
|
version: 0.10.0
|
70
76
|
type: :development
|
71
77
|
prerelease: false
|
72
78
|
version_requirements: !ruby/object:Gem::Requirement
|
73
|
-
none: false
|
74
79
|
requirements:
|
75
|
-
- -
|
80
|
+
- - ">="
|
76
81
|
- !ruby/object:Gem::Version
|
77
82
|
version: 0.10.0
|
78
83
|
description: Module for ActionMailer to improve the rendering of HTML emails by using
|
@@ -82,8 +87,8 @@ executables: []
|
|
82
87
|
extensions: []
|
83
88
|
extra_rdoc_files: []
|
84
89
|
files:
|
85
|
-
- .gitignore
|
86
|
-
- .travis.yml
|
90
|
+
- ".gitignore"
|
91
|
+
- ".travis.yml"
|
87
92
|
- Gemfile
|
88
93
|
- LICENSE
|
89
94
|
- README.md
|
@@ -98,27 +103,28 @@ files:
|
|
98
103
|
- test/premailer_stylesheet_link_tag_test.rb
|
99
104
|
homepage: http://premailer.dialect.ca/
|
100
105
|
licenses: []
|
106
|
+
metadata: {}
|
101
107
|
post_install_message:
|
102
108
|
rdoc_options: []
|
103
109
|
require_paths:
|
104
110
|
- lib
|
105
111
|
required_ruby_version: !ruby/object:Gem::Requirement
|
106
|
-
none: false
|
107
112
|
requirements:
|
108
|
-
- -
|
113
|
+
- - ">="
|
109
114
|
- !ruby/object:Gem::Version
|
110
115
|
version: '0'
|
111
116
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
112
|
-
none: false
|
113
117
|
requirements:
|
114
|
-
- -
|
118
|
+
- - ">="
|
115
119
|
- !ruby/object:Gem::Version
|
116
120
|
version: '0'
|
117
121
|
requirements: []
|
118
122
|
rubyforge_project:
|
119
|
-
rubygems_version:
|
123
|
+
rubygems_version: 2.6.12
|
120
124
|
signing_key:
|
121
|
-
specification_version:
|
125
|
+
specification_version: 4
|
122
126
|
summary: Always send HTML e-mails with inline CSS, using the 'premailer' gem
|
123
|
-
test_files:
|
124
|
-
|
127
|
+
test_files:
|
128
|
+
- test/abstract_unit.rb
|
129
|
+
- test/inline_css_hook_test.rb
|
130
|
+
- test/premailer_stylesheet_link_tag_test.rb
|