inline_styles_mailer 0.0.9 → 1.0.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 +4 -4
- data/.gitignore +2 -0
- data/.travis.yml +16 -2
- data/README.md +23 -7
- data/lib/inline_styles_mailer.rb +17 -4
- data/lib/inline_styles_mailer/version.rb +1 -1
- data/spec/Gemfile.rails-4.2 +5 -0
- data/spec/Gemfile.rails-5.0 +5 -0
- metadata +7 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 0716b04de092e971db8003483cd43d4f8b43bc50
|
4
|
+
data.tar.gz: a04204af2d5987b52e79c2fa8845d3c58a4890f1
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 41cdd9c57cbff04f72d3178d13989a118af5093d8f700013e5b0ed798b6930e471a370e45f2ce62edbaee3afc33d5f5c69798b2bca4442e645a169bc4d003d57
|
7
|
+
data.tar.gz: aa4ea05b6b227d4242b4db8f7b341431b1ac6726f3c7dd010d08ceed61175fc561b34d68c800a58e3a96b4a6b4dc9368a77d93993d592e03e4fa9840bf61e621
|
data/.gitignore
CHANGED
data/.travis.yml
CHANGED
@@ -1,2 +1,16 @@
|
|
1
|
-
|
2
|
-
|
1
|
+
language: ruby
|
2
|
+
matrix:
|
3
|
+
include:
|
4
|
+
- rvm: 2.0.0
|
5
|
+
gemfile: spec/Gemfile.rails-4.2
|
6
|
+
- rvm: 2.1.8
|
7
|
+
gemfile: spec/Gemfile.rails-4.2
|
8
|
+
- rvm: 2.2.4
|
9
|
+
gemfile: spec/Gemfile.rails-4.2
|
10
|
+
- rvm: 2.2.4
|
11
|
+
gemfile: spec/Gemfile.rails-5.0
|
12
|
+
- rvm: 2.3.0
|
13
|
+
gemfile: spec/Gemfile.rails-4.2
|
14
|
+
- rvm: 2.3.0
|
15
|
+
gemfile: spec/Gemfile.rails-5.0
|
16
|
+
sudo: false
|
data/README.md
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
## Inline Styles Mailer [](http://travis-ci.org/billhorsman/inline_styles_mailer)
|
2
2
|
|
3
|
-
Using Jack Danger's excellent [Inline Styles](https://github.com/jackdanger/inline_styles) gem is even easier if you're using Rails 3.1 and this gem.
|
3
|
+
Using Jack Danger's excellent [Inline Styles](https://github.com/jackdanger/inline_styles) gem is even easier if you're using Rails 3.1+ and this gem.
|
4
4
|
|
5
5
|
The Inline Styles gem helps you embed CSS styles into your markup so that you can send pretty HTML emails that won't get butchered by email clients that strip out CSS. Or, more precisely, will help reduce the amount of butchering (even with inline CSS some styles, like background images, are often cut out).
|
6
6
|
|
@@ -92,17 +92,33 @@ class FooMailer < ActionMailer::Base
|
|
92
92
|
end
|
93
93
|
```
|
94
94
|
|
95
|
-
##
|
95
|
+
## Upgrading to Version 1.0
|
96
96
|
|
97
|
-
|
97
|
+
We decided to bump up the major version because of a fix (5d0b6f4) we made to the way the template was found. We were incorrectly assuming that all mail templates were only nested one deep in `app/views` but that's not always the case. It now works correctly but you might have worked around this bug (issue #8) by moving your templates. You don't need to do that any more.
|
98
98
|
|
99
|
-
## Rails
|
99
|
+
## What versions of Rails does this work with?
|
100
100
|
|
101
|
-
|
101
|
+
We run tests using Rails `4.2.6` and `5.0.0.beta3`.
|
102
102
|
|
103
|
-
|
103
|
+
| Version | Working? |
|
104
|
+
| --- | --- |
|
105
|
+
| 3.0 | No * |
|
106
|
+
| 3.1 | Yes |
|
107
|
+
| 3.2 | Yes |
|
108
|
+
| 4.0 | Yes |
|
109
|
+
| 4.1 | Yes |
|
110
|
+
| 4.2 | Yes |
|
111
|
+
| 5.0 | Yes |
|
104
112
|
|
105
|
-
|
113
|
+
\* It relies on the asset pipeline so I'd be surprised if it works. Not tested.
|
114
|
+
|
115
|
+
## What about Ruby?
|
116
|
+
|
117
|
+
Anything later than Ruby `1.9.2` should be fine. We test using Ruby 2.0.0`, `2.1.8`, `2.2.4` and `2.3.0`.
|
118
|
+
|
119
|
+
### 1.9 Support
|
120
|
+
|
121
|
+
We don't test with Ruby `1.9` because there is a dependency on the `mime-types-data` gem for which the latest version requires Ruby `2.0` or later. That doesn't mean you can't use Ruby `1.9.3` but you'll need to make sure you're using a version of `mime-types-data` less than `3`.
|
106
122
|
|
107
123
|
## Development
|
108
124
|
|
data/lib/inline_styles_mailer.rb
CHANGED
@@ -72,7 +72,8 @@ module InlineStylesMailer
|
|
72
72
|
}.each do |template|
|
73
73
|
# templates.each do |template|
|
74
74
|
# e.g. template = app/views/user_mailer/welcome.html.erb
|
75
|
-
|
75
|
+
# e.g. template = app/views/namespace/user_mailer/welcome.html.erb
|
76
|
+
template_path = template.inspect.split("views")[1][1..-1] # e.g. user_mailer/welcome.html.erb
|
76
77
|
parts = template_path.split('.')
|
77
78
|
handler = parts.pop.to_sym # e.g. erb
|
78
79
|
extension = parts.pop.to_sym # e.g. html
|
@@ -92,11 +93,23 @@ module InlineStylesMailer
|
|
92
93
|
end
|
93
94
|
|
94
95
|
def layout_to_use
|
95
|
-
case
|
96
|
+
case call_layout
|
96
97
|
when ActionView::Template
|
97
|
-
|
98
|
+
call_layout.inspect.split("/").last.split(".").first
|
98
99
|
when String
|
99
|
-
|
100
|
+
call_layout.split("/").last.split(".").first
|
101
|
+
end
|
102
|
+
end
|
103
|
+
|
104
|
+
# Hack to call _layout the right way depending on the Rails version. This is a code smell
|
105
|
+
# telling us that we shouldn't be doing this at all...
|
106
|
+
def call_layout
|
107
|
+
if method(:_layout).arity == 1
|
108
|
+
# Rails 5?
|
109
|
+
_layout([:html])
|
110
|
+
else
|
111
|
+
# < Rails 5?
|
112
|
+
_layout
|
100
113
|
end
|
101
114
|
end
|
102
115
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: inline_styles_mailer
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0
|
4
|
+
version: 1.0.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Bill Horsman
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2016-03-25 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rspec
|
@@ -91,6 +91,8 @@ files:
|
|
91
91
|
- inline_styles_mailer.gemspec
|
92
92
|
- lib/inline_styles_mailer.rb
|
93
93
|
- lib/inline_styles_mailer/version.rb
|
94
|
+
- spec/Gemfile.rails-4.2
|
95
|
+
- spec/Gemfile.rails-5.0
|
94
96
|
- spec/fixtures/assets/stylesheets/_foo_mailer.css.scss
|
95
97
|
- spec/fixtures/assets/stylesheets/_override.css
|
96
98
|
- spec/fixtures/assets/stylesheets/_override.css.sass
|
@@ -123,11 +125,13 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
123
125
|
version: '0'
|
124
126
|
requirements: []
|
125
127
|
rubyforge_project: inline_styles_mailer
|
126
|
-
rubygems_version: 2.
|
128
|
+
rubygems_version: 2.4.5.1
|
127
129
|
signing_key:
|
128
130
|
specification_version: 4
|
129
131
|
summary: Convenient use of inline_styles gem with Rails 3.1+ and Rails 4
|
130
132
|
test_files:
|
133
|
+
- spec/Gemfile.rails-4.2
|
134
|
+
- spec/Gemfile.rails-5.0
|
131
135
|
- spec/fixtures/assets/stylesheets/_foo_mailer.css.scss
|
132
136
|
- spec/fixtures/assets/stylesheets/_override.css
|
133
137
|
- spec/fixtures/assets/stylesheets/_override.css.sass
|