roadie 5.1.0 → 5.2.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/workflows/main.yml +20 -10
- data/.rubocop.yml +8 -4
- data/.solargraph.yml +0 -4
- data/.standard.yml +1 -0
- data/Changelog.md +200 -181
- data/Gemfile +1 -0
- data/README.md +2 -2
- data/lib/roadie/errors.rb +4 -2
- data/lib/roadie/null_url_rewriter.rb +1 -0
- data/lib/roadie/selector.rb +1 -0
- data/lib/roadie/version.rb +1 -1
- data/roadie.gemspec +3 -3
- data/spec/integration_spec.rb +24 -2
- data/spec/lib/roadie/style_block_spec.rb +1 -1
- metadata +22 -43
- data/.autotest +0 -10
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: bf21805d618315993a32ce718e78c756c82627d3139c5ad9823e539d183c244f
|
4
|
+
data.tar.gz: 2d440a7a8f27d4ab08b4f5795222b329863816f4c55c593b217488ef0b97b5b0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2c411ae8897ebbcf2e57dea6c1dd265c8d4c6e5ed43ca9dc20b085cb3cac084e7e92189ae2f621609a406621e7ebea4676d13d6ef38dde88394bd004a57d836e
|
7
|
+
data.tar.gz: cedc2284f27ab48522989550440235af8c39c86ff4d6f437d722b971d4356f36db674a116c3427d71374a7075d358bb478c759f5178125e6ae53e0c38072892a
|
data/.github/workflows/main.yml
CHANGED
@@ -11,15 +11,19 @@ on:
|
|
11
11
|
jobs:
|
12
12
|
base:
|
13
13
|
name: Ruby ${{ matrix.ruby }}
|
14
|
-
runs-on: ubuntu-
|
14
|
+
runs-on: ubuntu-latest
|
15
15
|
strategy:
|
16
16
|
fail-fast: false
|
17
17
|
matrix:
|
18
|
-
ruby:
|
18
|
+
ruby:
|
19
|
+
- "2.7"
|
20
|
+
- "3.0"
|
21
|
+
- "3.1"
|
22
|
+
- "3.2"
|
19
23
|
|
20
24
|
steps:
|
21
25
|
- name: Checkout code
|
22
|
-
uses: actions/checkout@
|
26
|
+
uses: actions/checkout@v4
|
23
27
|
|
24
28
|
# This setup is not compatible with the way Travis CI was
|
25
29
|
# setup, so the cache will only work for the root folder.
|
@@ -32,15 +36,21 @@ jobs:
|
|
32
36
|
- name: Rake
|
33
37
|
run: bundle exec rake
|
34
38
|
|
35
|
-
- uses: codecov/codecov-action@
|
39
|
+
- uses: codecov/codecov-action@v3
|
36
40
|
|
37
41
|
lint:
|
38
42
|
runs-on: ubuntu-latest
|
39
43
|
steps:
|
44
|
+
- name: Checkout code
|
45
|
+
uses: actions/checkout@v4
|
46
|
+
|
47
|
+
# This setup is not compatible with the way Travis CI was
|
48
|
+
# setup, so the cache will only work for the root folder.
|
49
|
+
- name: Setup Ruby
|
50
|
+
uses: ruby/setup-ruby@v1
|
51
|
+
with:
|
52
|
+
ruby-version: "3.2"
|
53
|
+
bundler-cache: true
|
54
|
+
|
40
55
|
- name: standardrb
|
41
|
-
|
42
|
-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
43
|
-
uses: amoeba/standardrb-action@v2
|
44
|
-
permissions:
|
45
|
-
checks: write
|
46
|
-
contents: read
|
56
|
+
run: bundle exec standardrb
|
data/.rubocop.yml
CHANGED
data/.solargraph.yml
CHANGED
data/.standard.yml
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
ruby_version: 2.7
|
data/Changelog.md
CHANGED
@@ -1,19 +1,35 @@
|
|
1
1
|
### dev
|
2
2
|
|
3
|
-
[full changelog](https://github.com/Mange/roadie/compare/v5.1
|
3
|
+
[full changelog](https://github.com/Mange/roadie/compare/v5.2.1...master)
|
4
|
+
|
5
|
+
Nothing yet.
|
6
|
+
|
7
|
+
### dev
|
8
|
+
|
9
|
+
[full changelog](https://github.com/Mange/roadie/compare/v5.2.0...v5.2.1)
|
10
|
+
|
11
|
+
- Don't strip the [`:root` pseudo-class](https://developer.mozilla.org/en-US/docs/Web/CSS/:root) - [Asger Behncke Jacobsen](https://github.com/asgerb) (#173)
|
12
|
+
|
13
|
+
### 5.2.0
|
14
|
+
|
15
|
+
[full changelog](https://github.com/Mange/roadie/compare/v5.1.0...v5.2.0)
|
16
|
+
|
17
|
+
- Upgrade to Nokogiri `~>` 1.15.
|
18
|
+
- Drop support for Ruby 2.6.
|
19
|
+
- Add official support for Ruby 3.2.
|
4
20
|
|
5
21
|
### 5.1.0
|
6
22
|
|
7
23
|
[full changelog](https://github.com/Mange/roadie/compare/v5.0.1...v5.1.0)
|
8
24
|
|
9
|
-
|
25
|
+
- Support passing serialization options to Nokogiri with `serialization_options=` method -
|
10
26
|
[Dmytro Savochkin](https://github.com/dmytro-savochkin). (#171)
|
11
27
|
|
12
28
|
### 5.0.1
|
13
29
|
|
14
30
|
[full changelog](https://github.com/Mange/roadie/compare/v5.0.0...v5.0.1)
|
15
31
|
|
16
|
-
|
32
|
+
- Don't try to inline [the `:host`
|
17
33
|
pseudo-class](https://developer.mozilla.org/en-US/docs/Web/CSS/:host) -
|
18
34
|
[viamin (Bart Agapinan)](https://github.com/viamin). (#170)
|
19
35
|
|
@@ -21,28 +37,28 @@
|
|
21
37
|
|
22
38
|
[full changelog](https://github.com/Mange/roadie/compare/v4.0.0...v5.0.0)
|
23
39
|
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
40
|
+
- Drop support for Ruby 2.4 and Ruby 2.5
|
41
|
+
- Drop support for JRuby and Rubinius
|
42
|
+
- Test with Ruby 2.7 - [aried3r (Anton Rieder)](https://github.com/aried3r) (#167)
|
43
|
+
- Test with Ruby 3.0 and Ruby 3.1
|
44
|
+
- Add standardrb as code formatter
|
45
|
+
- Drop support for callbacks that accepts only a single argument.
|
46
|
+
- Change signature of `Roadie::CssNotFound` and `Roadie::ProvidersFailed`.
|
31
47
|
|
32
48
|
### 4.0.0
|
33
49
|
|
34
50
|
[full changelog](https://github.com/Mange/roadie/compare/v3.5.1...v4.0.0)
|
35
51
|
|
36
|
-
|
52
|
+
- Drop support for Ruby 2.1, 2.2, and 2.3 and
|
37
53
|
add support for frozen string literals and Ruby 2.6 - [adamkiczula (Adam
|
38
54
|
Kiczula)](https://github.com/adamkiczula) (#164)
|
39
|
-
|
55
|
+
- `Roadie::Stylesheet#each_inlinable_block` is now removed.
|
40
56
|
|
41
57
|
### 3.5.1
|
42
58
|
|
43
59
|
[full changelog](https://github.com/Mange/roadie/compare/v3.5.0...v3.5.1)
|
44
60
|
|
45
|
-
|
61
|
+
- Gracefully handle empty string email body, such as those provided by
|
46
62
|
`ActionMailer::Base::NullMail` objects - [adamkiczula (Adam
|
47
63
|
Kiczula)](https://github.com/adamkiczula) (#163).
|
48
64
|
|
@@ -50,14 +66,15 @@
|
|
50
66
|
|
51
67
|
[full changelog](https://github.com/Mange/roadie/compare/v3.4.0...v3.5.0)
|
52
68
|
|
53
|
-
|
69
|
+
- Drop support for Nokogiri before 1.8.
|
54
70
|
|
55
71
|
### 3.4.0
|
56
72
|
|
57
73
|
[full changelog](https://github.com/Mange/roadie/compare/v3.3.0...v3.4.0)
|
58
74
|
|
59
|
-
|
60
|
-
|
75
|
+
- Enhancements
|
76
|
+
|
77
|
+
- Better support for media queries - [BroiSatse (Stanislaw
|
61
78
|
Klajn)](https://github.com/BroiSatse) and [jeznag (Jeremy
|
62
79
|
Nagel)](https://github.com/jeznag) (#157).
|
63
80
|
|
@@ -67,7 +84,7 @@
|
|
67
84
|
might change specificity), but this behavior can be disabled by setting
|
68
85
|
`merge_media_queries` to `false`.
|
69
86
|
|
70
|
-
|
87
|
+
- Remove Guard as a development dependency. Tests run fast anyway, and I
|
71
88
|
never liked that this tool "infected" the dependencies of the project when
|
72
89
|
it should remain a user-specific tool unless the project wants to enforce
|
73
90
|
it.
|
@@ -76,138 +93,140 @@
|
|
76
93
|
|
77
94
|
[full changelog](https://github.com/Mange/roadie/compare/v3.2.2...v3.3.0)
|
78
95
|
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
96
|
+
- Enhancements
|
97
|
+
- Allow transforming to XHTML instead of HTML - [Zhivko Draganov](https://github.com/zdraganov) (#144).
|
98
|
+
- Support partial HTML documents (fragments) - #147
|
99
|
+
- With the help of [andfx](https://github.com/andfx) - #115
|
100
|
+
- With the help of [Frida Sjoholm](https://github.com/FridaSjoholm) - #146
|
101
|
+
- Skip URL rewriting on elements with `data-roadie-ignore` - #154.
|
102
|
+
- With the help of [Hamed Asghari](https://github.com/hasghari) - #138.
|
103
|
+
- Bug fixes:
|
104
|
+
- Apply correct string encoding / charset in `NetHttpProvider` - [Jeremy Nagel](https://github.com/jeznag) (#152).
|
88
105
|
|
89
106
|
### 3.2.2
|
90
107
|
|
91
108
|
[full changelog](https://github.com/Mange/roadie/compare/v3.2.1...v3.2.2)
|
92
109
|
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
110
|
+
- Enhancements
|
111
|
+
- Support Nokogiri 1.x.
|
112
|
+
- Support `css_parser` 1.x.
|
113
|
+
- Make tests pass on Ruby 2.4.0 (upgrade Webmock).
|
97
114
|
|
98
115
|
### 3.2.1
|
99
116
|
|
100
117
|
[full changelog](https://github.com/Mange/roadie/compare/v3.2.0...v3.2.1)
|
101
118
|
|
102
|
-
|
103
|
-
|
119
|
+
- Enhancements
|
120
|
+
- Support Nokogiri 1.7.x.
|
104
121
|
|
105
122
|
### 3.2.0
|
106
123
|
|
107
124
|
[full changelog](https://github.com/Mange/roadie/compare/v3.1.1...v3.2.0)
|
108
125
|
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
|
126
|
+
- Deprecations:
|
127
|
+
- Dropped support for MRI 1.9.3.
|
128
|
+
- Dropped support for MRI 2.0.
|
129
|
+
- Upgrades:
|
130
|
+
- Use `css_parser` 1.4.x instead of 1.3.x.
|
131
|
+
- Bug fixes:
|
132
|
+
- Strip UTF-8 BOM (Byte Order Mark) from stylesheets before parsing / concatenating - [Bartłomiej Wójtowicz](https://github.com/qbart) (#128)
|
133
|
+
- Enhancements:
|
134
|
+
- Build against Ruby MRI 2.3.0 too.
|
135
|
+
- Don't add extra whitespace between table cells.
|
119
136
|
|
120
137
|
### 3.1.1
|
121
138
|
|
122
139
|
[full changelog](https://github.com/Mange/roadie/compare/v3.1.0...v3.1.1)
|
123
140
|
|
124
|
-
|
125
|
-
|
126
|
-
|
127
|
-
|
141
|
+
- Enhancements:
|
142
|
+
- Duplicate style properties are now removed when inlining.
|
143
|
+
- This means that `color: green; color: red; color: green` will now be `color: red; color: green`.
|
144
|
+
- The size of your emails should be the same, or smaller.
|
128
145
|
|
129
146
|
### 3.1.0
|
130
147
|
|
131
148
|
[full changelog](https://github.com/Mange/roadie/compare/v3.1.0.rc1...v3.1.0)
|
132
149
|
|
133
|
-
|
134
|
-
|
135
|
-
|
150
|
+
- Enchancements:
|
151
|
+
- `NetHttpProvider` validates the whitelist hostnames; passing an invalid hostname will raise `ArgumentError`.
|
152
|
+
- `NetHttpProvider` supports scheme-less URLs (`//foo.com/`), defaulting to `https`.
|
136
153
|
|
137
154
|
### 3.1.0.rc1
|
138
155
|
|
139
156
|
[full changelog](https://github.com/Mange/roadie/compare/v3.0.5...v3.1.0.rc1)
|
140
157
|
|
141
|
-
|
142
|
-
|
143
|
-
|
144
|
-
|
145
|
-
|
146
|
-
|
147
|
-
|
148
|
-
|
149
|
-
|
150
|
-
|
151
|
-
|
152
|
-
|
153
|
-
|
154
|
-
|
158
|
+
- Enhancements:
|
159
|
+
- Allow user to specify asset providers for referenced assets with full URLs and inline them (#107)
|
160
|
+
- Pass `Document` instance to transformation callbacks (#86)
|
161
|
+
- Made `nokogiri` dependency more forgiving.
|
162
|
+
- Supports `1.5.0`...`1.7.0` now instead of `1.6.0`...`1.7.0`. Some people out there are stuck on this older version of Nokogiri, and I don't want to leave them out.
|
163
|
+
- Output better errors when no assets can be found.
|
164
|
+
- The error will now show which providers were tried and in which order, along with the error message from the specific providers.
|
165
|
+
- `Roadie::FilesystemProvider` shows the given path when inspected.
|
166
|
+
- `data-roadie-ignore` attributes will now be removed from markup; hiding "development markers" in the final email.
|
167
|
+
- Add a `Roadie::CachedProvider` asset provider that wraps other providers and cache them.
|
168
|
+
- Add a `Roadie::PathRewriterProvider` asset provider that rewrites asset names for other providers.
|
169
|
+
- This saves you from having to create custom providers if you require small tweaks to the lookup in order to use an official provider.
|
170
|
+
- **Deprecations:**
|
171
|
+
- `Roadie::Stylesheet#each_inlinable_block` is now deprecated. You can iterate and filter the `blocks` at your own discresion.
|
155
172
|
|
156
173
|
### 3.0.5
|
157
174
|
|
158
175
|
[full changelog](https://github.com/Mange/roadie/compare/v3.0.4...v3.0.5)
|
159
176
|
|
160
|
-
|
161
|
-
|
162
|
-
|
177
|
+
- Bug fixes:
|
178
|
+
- Don't try to inline external stylesheets. (#106)
|
179
|
+
- Don't generate absolute URLs for anchor links. (Mange/roadie-rails#40)
|
163
180
|
|
164
181
|
### 3.0.4
|
165
182
|
|
166
183
|
[full changelog](https://github.com/Mange/roadie/compare/v3.0.3...v3.0.4)
|
167
184
|
|
168
|
-
|
169
|
-
|
185
|
+
- Bug fixes:
|
186
|
+
- Schemeless URLs was accepted as-is, which isn't supported in a lot of email clients. (#104)
|
170
187
|
|
171
188
|
### 3.0.3
|
172
189
|
|
173
190
|
[full changelog](https://github.com/Mange/roadie/compare/v3.0.2...v3.0.3)
|
174
191
|
|
175
|
-
|
176
|
-
|
192
|
+
- Bug fixes:
|
193
|
+
- CSS was mutated when parsed, breaking caches and memoized sources - [Brendan Mulholland (bmulholland)](https://github.com/bmulholland) (Mange/roadie-rails#32)
|
177
194
|
|
178
195
|
### 3.0.2
|
179
196
|
|
180
197
|
[full changelog](https://github.com/Mange/roadie/compare/v3.0.1...v3.0.2)
|
181
198
|
|
182
|
-
|
183
|
-
|
184
|
-
|
199
|
+
- Bug fixes:
|
200
|
+
- Some `data:` URLs could cause exceptions. (#97)
|
201
|
+
- Correctly parse properties with semicolons in their values - [Aidan Feldman (afeld)](https://github.com/afeld) (#100)
|
185
202
|
|
186
203
|
### 3.0.1
|
187
204
|
|
188
205
|
[full changelog](https://github.com/Mange/roadie/compare/v3.0.0...v3.0.1)
|
189
206
|
|
190
|
-
|
191
|
-
|
192
|
-
|
193
|
-
|
194
|
-
|
195
|
-
|
207
|
+
- Enhancements:
|
208
|
+
- `CssNotFound` can take a provider which will be shown in error messages.
|
209
|
+
- Bug fixes:
|
210
|
+
- URL rewriter no longer raises on absolute URLs that cannot be parsed by `URI`. Absolute URLs are completely ignored.
|
211
|
+
- URL rewriter supports urls without a scheme (like `//assets.myapp.com/foo`).
|
212
|
+
- URL rewriter no longer crashes on absolute URLs without a path (like `myapp://`).
|
196
213
|
|
197
214
|
### 3.0.0
|
198
215
|
|
199
216
|
[full changelog](https://github.com/Mange/roadie/compare/v3.0.0.pre1...v3.0.0)
|
200
217
|
|
201
|
-
|
202
|
-
|
203
|
-
|
218
|
+
- Enhancements:
|
219
|
+
|
220
|
+
- `Roadie::ProviderList` responds to `#empty?` and `#last`
|
221
|
+
- `Roadie::FilesystemProvider` ignores query string in filename.
|
222
|
+
|
223
|
+
Older versions of Rails generated `<link>` tags with query strings in their URLs, like such:
|
224
|
+
`/stylesheets/email.css?1380694096`
|
204
225
|
|
205
|
-
|
206
|
-
|
207
|
-
|
208
|
-
|
209
|
-
* Try to detect an upgrade from Roadie 2 and mention how to make it work with the new version.
|
210
|
-
* Styles emitted in the `style` attribute should now be ordered as they were in the source CSS.
|
226
|
+
- Blacklist `:enabled`, `:disabled` and `:checked` pseudo functions - [Tyler Hunt (tylerhunt)](https://github.com/tylerhunt).
|
227
|
+
- Add MRI 2.1.2 to Travis build matrix - [Grey Baker (greysteil)](https://github.com/greysteil).
|
228
|
+
- Try to detect an upgrade from Roadie 2 and mention how to make it work with the new version.
|
229
|
+
- Styles emitted in the `style` attribute should now be ordered as they were in the source CSS.
|
211
230
|
|
212
231
|
### 3.0.0.pre1
|
213
232
|
|
@@ -215,188 +234,188 @@
|
|
215
234
|
|
216
235
|
Complete rewrite of most of the code and a new direction for the gem.
|
217
236
|
|
218
|
-
|
219
|
-
|
220
|
-
|
221
|
-
|
222
|
-
|
223
|
-
|
224
|
-
|
225
|
-
|
226
|
-
|
227
|
-
|
228
|
-
|
229
|
-
|
230
|
-
|
237
|
+
- Breaking changes:
|
238
|
+
- Removed Rails support into a separate Gem (`roadie-rails`).
|
239
|
+
- Removed Sprockets dependency and AssetPipelineProvider.
|
240
|
+
- Changed the entire public API.
|
241
|
+
- Changed the API of custom providers.
|
242
|
+
- Dropped support for Ruby 1.8.7.
|
243
|
+
- Change `data-immutable` to `data-roadie-ignore`.
|
244
|
+
- New features:
|
245
|
+
- Rewriting the URLs of `img[src]`.
|
246
|
+
- A way to inject stylesheets without having to adjust template.
|
247
|
+
- A before callback to compliment the after callback.
|
248
|
+
- Enhancements:
|
249
|
+
- Better support for stylesheets using CSS fallbacks.
|
231
250
|
This means that styles like this is now inlined: `width: 5em; width: 3rem;`, while Roadie would previously remove the first of the two.
|
232
251
|
This sadly means that the HTML file will be much larger than before if you're using a non-optimized stylesheet (for example including your application stylesheet to the email). This was a bad idea even before this change, and this might get you to change.
|
233
|
-
|
234
|
-
|
235
|
-
|
252
|
+
- Using HTML5 doctype instead of XHTML
|
253
|
+
- Full support for JRuby
|
254
|
+
- Experimental support for Rubinius
|
236
255
|
|
237
256
|
### 2.4.2
|
238
257
|
|
239
258
|
[full changelog](https://github.com/Mange/roadie/compare/v2.4.1...v2.4.2)
|
240
259
|
|
241
|
-
|
242
|
-
|
243
|
-
|
244
|
-
|
260
|
+
- Bug fixes:
|
261
|
+
- Fix Nokogiri version to allow only 1.5.x on ruby 1.8.7
|
262
|
+
- Blacklist :before, :after, :-ms-input-placeholder, :-moz-placeholder selectors – [Brian Bauer (bbauer)][https://github.com/bbauer].
|
263
|
+
- Build failed on 1.8.7 due to a change in `css_parser`
|
245
264
|
|
246
265
|
### 2.4.1
|
247
266
|
|
248
267
|
[full changelog](https://github.com/Mange/roadie/compare/v2.4.0...v2.4.1)
|
249
268
|
|
250
|
-
|
251
|
-
|
269
|
+
- Bug fixes:
|
270
|
+
- Allow Nokogiri 1.5.x again; 1.6.x is unsupported in Ruby 1.8.7.
|
252
271
|
|
253
272
|
### 2.4.0
|
254
273
|
|
255
274
|
[full changelog](https://github.com/Mange/roadie/compare/v2.3.4...v2.4.0)
|
256
275
|
|
257
|
-
|
258
|
-
|
259
|
-
|
260
|
-
|
261
|
-
|
262
|
-
|
263
|
-
|
264
|
-
|
265
|
-
|
266
|
-
|
267
|
-
|
268
|
-
|
269
|
-
|
270
|
-
|
271
|
-
|
276
|
+
- Enhancements:
|
277
|
+
- Support Rails 4.0, with the help of:
|
278
|
+
- [Ryunosuke SATO (tricknotes)](https://github.com/tricknotes)
|
279
|
+
- [Dylan Markow](https://github.com/dmarkow)
|
280
|
+
- Keep `!important` when outputting styles to help combat web mail styles being `!important`
|
281
|
+
- Support `:nth-child`, `:last-child`, etc.
|
282
|
+
- To make this work, Roadie have to catch errors from Nokogiri and ignore them. A warning will be printed when this happens so users can open issues with the project and tests can be expanded.
|
283
|
+
- Support for custom inliner (#58) — [Harish Shetty (kandadaboggu)](https://github.com/kandadaboggu) with friends
|
284
|
+
- Bug fixes:
|
285
|
+
- Don't crash when URL options have protocols with "://" in them (#52).
|
286
|
+
- Other:
|
287
|
+
- Be more specific on which versions are required; require newer `css_parser`
|
288
|
+
- Officially support MRI 2.0.0
|
289
|
+
- Add experimental support for JRuby
|
290
|
+
- Remove documentation that talks about passing CSS filenames as symbols; unsupported in Rails 4. (Thanks to [PikachuEXE](https://github.com/PikachuEXE))
|
272
291
|
|
273
292
|
### 2.3.4
|
274
293
|
|
275
294
|
[full changelog](https://github.com/Mange/roadie/compare/v2.3.3...v2.3.4)
|
276
295
|
|
277
|
-
|
278
|
-
|
279
|
-
|
280
|
-
|
281
|
-
|
282
|
-
|
283
|
-
|
296
|
+
- Enhancements:
|
297
|
+
- Add `config.roadie.enabled` that can be set to `false` to disable Roadie completely.
|
298
|
+
- Bug fixes:
|
299
|
+
- Proc objects to the `:css` option is now run in the context of the mailer instance, mirroring similar options from ActionMailer.
|
300
|
+
- Fix some tests that would always pass
|
301
|
+
- Improve JRuby compatibility
|
302
|
+
- Update Gemfile.lock and fix issues with newer gem versions
|
284
303
|
|
285
304
|
### 2.3.3
|
286
305
|
|
287
306
|
[full changelog](https://github.com/Mange/roadie/compare/v2.3.2...v2.3.3)
|
288
307
|
|
289
|
-
|
290
|
-
|
291
|
-
|
292
|
-
|
308
|
+
- Enhancements:
|
309
|
+
- Allow proc objects to the `:css` option
|
310
|
+
- Bug fixes:
|
311
|
+
- Ignore HTML comments and CDATA sections in CSS (support TinyMCE)
|
293
312
|
|
294
313
|
### 2.3.2
|
295
314
|
|
296
315
|
[full changelog](https://github.com/Mange/roadie/compare/v2.3.1...v2.3.2)
|
297
316
|
|
298
|
-
|
299
|
-
|
317
|
+
- Bug fixes:
|
318
|
+
- Don't fail on selectors which start with @ (#28) — [Roman Shterenzon (romanbsd)](https://github.com/romanbsd)
|
300
319
|
|
301
320
|
### 2.3.1
|
302
321
|
|
303
322
|
[full changelog](https://github.com/Mange/roadie/compare/v2.3.0...v2.3.1)
|
304
323
|
|
305
|
-
|
306
|
-
|
324
|
+
- Bug fixes:
|
325
|
+
- Does not work with Rails 3.0 unless provider set specifically (#23)
|
307
326
|
|
308
327
|
### 2.3.0
|
309
328
|
|
310
329
|
[full changelog](https://github.com/Mange/roadie/compare/v2.3.0.pre1...v2.3.0)
|
311
330
|
|
312
|
-
|
331
|
+
- Nothing, really
|
313
332
|
|
314
333
|
### 2.3.0.pre1
|
315
334
|
|
316
335
|
[full changelog](https://github.com/Mange/roadie/compare/v2.2.0...v2.3.0.pre1)
|
317
336
|
|
318
|
-
|
319
|
-
|
320
|
-
|
321
|
-
|
322
|
-
|
323
|
-
|
337
|
+
- Enhancements:
|
338
|
+
- Support Rails 3.2.pre1 - [Morton Jonuschat (yabawock)](https://github.com/yabawock)
|
339
|
+
- Sped up the Travis builds
|
340
|
+
- Official support for Rails 3.0 again
|
341
|
+
- Dependencies allow 3.0
|
342
|
+
- Travis builds 3.0 among the others
|
324
343
|
|
325
344
|
### 2.2.0
|
326
345
|
|
327
346
|
[full changelog](https://github.com/Mange/roadie/compare/v2.1.0...v2.2.0)
|
328
347
|
|
329
|
-
|
330
|
-
|
331
|
-
|
348
|
+
- Enhancements:
|
349
|
+
- Support for the `url_options` method inside mailer instances
|
350
|
+
- You can now dynamically alter the URL options on a per-email basis
|
332
351
|
|
333
352
|
### 2.1.0
|
334
353
|
|
335
354
|
[full changelog](https://github.com/Mange/roadie/compare/v2.1.0.pre2...v2.1.0)
|
336
355
|
|
337
|
-
|
356
|
+
- Full release!
|
338
357
|
|
339
358
|
### 2.1.0.pre2
|
340
359
|
|
341
360
|
[full changelog](https://github.com/Mange/roadie/compare/v2.1.0.pre1...v2.1.0.pre2)
|
342
361
|
|
343
|
-
|
362
|
+
- Bug: Roadie broke `url_for` inside mailer views
|
344
363
|
|
345
364
|
### 2.1.0.pre1
|
346
365
|
|
347
366
|
[full changelog](https://github.com/Mange/roadie/compare/v2.0.0...v2.1.0.pre1)
|
348
367
|
|
349
|
-
|
350
|
-
|
351
|
-
|
352
|
-
|
353
|
-
|
354
|
-
|
368
|
+
- Enhancements:
|
369
|
+
- Support normal filesystem instead of only Asset pipeline
|
370
|
+
- Enable users to create their own way of fetching CSS
|
371
|
+
- Improve test coverage a bit
|
372
|
+
- Use a railtie to hook into Rails
|
373
|
+
- Use real Rails for testing integration
|
355
374
|
|
356
375
|
### 2.0.0
|
357
376
|
|
358
377
|
[full changelog](https://github.com/Mange/roadie/compare/v1.1.3...v2.0.0)
|
359
378
|
|
360
|
-
|
361
|
-
|
362
|
-
|
363
|
-
|
379
|
+
- Enhancements:
|
380
|
+
- Support the Asset pipeline - [Arttu Tervo (arttu)](https://github.com/arttu)
|
381
|
+
- Dependencies:
|
382
|
+
- Requires Rails 3.1 to work. You can keep on using the 1.x series in Rails 3.0
|
364
383
|
|
365
384
|
### 1.1.3
|
366
385
|
|
367
386
|
[full changelog](https://github.com/Mange/roadie/compare/v1.1.2...v1.1.3)
|
368
387
|
|
369
|
-
|
388
|
+
- Do not add another ".css" to filenames if already present - [Aliaxandr (saks)](https://github.com/saks)
|
370
389
|
|
371
390
|
### 1.1.2
|
372
391
|
|
373
392
|
[full changelog](https://github.com/Mange/roadie/compare/v1.1.1...v1.1.2)
|
374
393
|
|
375
|
-
|
394
|
+
- Support for Rails 3.1.0 and later inside gemspec
|
376
395
|
|
377
396
|
### 1.1.1
|
378
397
|
|
379
398
|
[full changelog](https://github.com/Mange/roadie/compare/v1.1.0...v1.1.1)
|
380
399
|
|
381
|
-
|
382
|
-
|
383
|
-
|
400
|
+
- Support for Rails 3.1.x (up to and including RC4)
|
401
|
+
- Rails 3.0.x is still supported
|
402
|
+
- Added CI via [Travis CI](http://travis-ci.org)
|
384
403
|
|
385
404
|
### 1.1.0
|
386
405
|
|
387
406
|
[full changelog](https://github.com/Mange/roadie/compare/v1.0.1...v1.1.0)
|
388
407
|
|
389
|
-
|
390
|
-
|
408
|
+
- Enhancements:
|
409
|
+
- Support for inlining `<link>` elements (thanks to [aliix](https://github.com/aliix))
|
391
410
|
|
392
411
|
### 1.0.1
|
393
412
|
|
394
413
|
[full changelog](https://github.com/Mange/roadie/compare/v1.0.0...v1.0.1)
|
395
414
|
|
396
|
-
|
397
|
-
|
398
|
-
|
399
|
-
|
415
|
+
- Enhancements:
|
416
|
+
- Full, official support for Ruby 1.9.2 (in addition to 1.8.7)
|
417
|
+
- Dependencies:
|
418
|
+
- Explicilty depend on nokogiri >= 1.4.4
|
400
419
|
|
401
420
|
### 1.0.0
|
402
421
|
|
@@ -404,11 +423,11 @@ Complete rewrite of most of the code and a new direction for the gem.
|
|
404
423
|
|
405
424
|
Roadie fork!
|
406
425
|
|
407
|
-
|
408
|
-
|
409
|
-
|
410
|
-
|
411
|
-
|
412
|
-
|
413
|
-
|
414
|
-
|
426
|
+
- Enhancements:
|
427
|
+
- Support for Rails 3.0
|
428
|
+
- Code cleanup
|
429
|
+
- Support `!important`
|
430
|
+
- Tests
|
431
|
+
- - some other enhancements
|
432
|
+
- Deprecations:
|
433
|
+
- Removed support for Rails 2.x
|
data/Gemfile
CHANGED
@@ -8,3 +8,4 @@ gem "codecov", group: :test, require: false
|
|
8
8
|
# Not actually required to run the tests for the gem, but a real convenience
|
9
9
|
# for local development.
|
10
10
|
gem "standard", group: [:test, :development], require: false
|
11
|
+
gem "solargraph", group: [:test, :development], require: false
|
data/README.md
CHANGED
@@ -54,7 +54,7 @@ Install & Usage
|
|
54
54
|
[Add this gem to your Gemfile as recommended by Rubygems](http://rubygems.org/gems/roadie) and run `bundle install`.
|
55
55
|
|
56
56
|
```ruby
|
57
|
-
gem 'roadie', '~>
|
57
|
+
gem 'roadie', '~> 5.2'
|
58
58
|
```
|
59
59
|
|
60
60
|
You can then create a new instance of a Roadie document:
|
@@ -450,10 +450,10 @@ Build Status
|
|
450
450
|
|
451
451
|
Tested with Github CI using:
|
452
452
|
|
453
|
-
* MRI 2.6
|
454
453
|
* MRI 2.7
|
455
454
|
* MRI 3.0
|
456
455
|
* MRI 3.1
|
456
|
+
* MRI 3.2
|
457
457
|
|
458
458
|
Let me know if you want any other runtime supported officially.
|
459
459
|
|
data/lib/roadie/errors.rb
CHANGED
@@ -23,7 +23,9 @@ module Roadie
|
|
23
23
|
else
|
24
24
|
""
|
25
25
|
end
|
26
|
-
super
|
26
|
+
super(
|
27
|
+
"Cannot use path \"#{given_path}\" in URL generation.#{cause_message}"
|
28
|
+
)
|
27
29
|
end
|
28
30
|
end
|
29
31
|
|
@@ -47,7 +49,7 @@ module Roadie
|
|
47
49
|
@css_name = css_name
|
48
50
|
@provider = provider
|
49
51
|
@extra_message = message
|
50
|
-
super
|
52
|
+
super(build_message)
|
51
53
|
end
|
52
54
|
|
53
55
|
protected
|
data/lib/roadie/selector.rb
CHANGED
data/lib/roadie/version.rb
CHANGED
data/roadie.gemspec
CHANGED
@@ -15,19 +15,19 @@ Gem::Specification.new do |s|
|
|
15
15
|
s.description = "Roadie tries to make sending HTML emails a little less painful by inlining stylesheets and rewriting relative URLs for you."
|
16
16
|
s.license = "MIT"
|
17
17
|
|
18
|
-
s.required_ruby_version = ">= 2.
|
18
|
+
s.required_ruby_version = ">= 2.7"
|
19
19
|
|
20
|
-
s.add_dependency "nokogiri", "~> 1.
|
20
|
+
s.add_dependency "nokogiri", "~> 1.15"
|
21
21
|
s.add_dependency "css_parser", "~> 1.4"
|
22
22
|
|
23
23
|
s.add_development_dependency "rake"
|
24
24
|
s.add_development_dependency "rspec", "~> 3.0"
|
25
25
|
s.add_development_dependency "rspec-collection_matchers", "~> 1.0"
|
26
26
|
s.add_development_dependency "webmock", "~> 3.0"
|
27
|
+
s.add_development_dependency "standardrb"
|
27
28
|
|
28
29
|
s.extra_rdoc_files = %w[README.md Changelog.md]
|
29
30
|
s.require_paths = %w[lib]
|
30
31
|
|
31
32
|
s.files = `git ls-files`.split("\n")
|
32
|
-
s.test_files = `git ls-files -- spec/*`.split("\n")
|
33
33
|
end
|
data/spec/integration_spec.rb
CHANGED
@@ -67,6 +67,29 @@ describe "Roadie functionality" do
|
|
67
67
|
expect(styles).to include Roadie::Stylesheet.new("", css).to_s
|
68
68
|
end
|
69
69
|
|
70
|
+
it "does not strip :root pseudo-class" do
|
71
|
+
document = Roadie::Document.new <<-HTML
|
72
|
+
<html>
|
73
|
+
<head>
|
74
|
+
<title>Hello world!</title>
|
75
|
+
</head>
|
76
|
+
<body>
|
77
|
+
<h1>Hello world!</h1>
|
78
|
+
</body>
|
79
|
+
</html>
|
80
|
+
HTML
|
81
|
+
css = <<-CSS
|
82
|
+
:root { --color: red; }
|
83
|
+
CSS
|
84
|
+
document.add_css css
|
85
|
+
|
86
|
+
result = parse_html document.transform
|
87
|
+
expect(result).to have_selector("html > head > style")
|
88
|
+
|
89
|
+
styles = result.at_css("html > head > style").text
|
90
|
+
expect(styles).to include Roadie::Stylesheet.new("", css).to_s
|
91
|
+
end
|
92
|
+
|
70
93
|
it "can be configured to skip styles that cannot be inlined" do
|
71
94
|
document = Roadie::Document.new <<-HTML
|
72
95
|
<html>
|
@@ -251,8 +274,7 @@ describe "Roadie functionality" do
|
|
251
274
|
result = parse_html document.transform
|
252
275
|
|
253
276
|
expect(result.at_css("a.one")["href"]).to eq("https://myapp.com/rails/app/about_us")
|
254
|
-
|
255
|
-
expect(result.at_css("a.two")["href"]).to eq("%24UNSUBSCRIBE_URL")
|
277
|
+
expect(result.at_css("a.two")["href"]).to eq("$UNSUBSCRIBE_URL")
|
256
278
|
|
257
279
|
expect(result).to have_styling("color" => "green").at_selector("a.one")
|
258
280
|
expect(result).to have_styling("color" => "green").at_selector("a.two")
|
@@ -39,7 +39,7 @@ module Roadie
|
|
39
39
|
context "when one of media queries includes feature condition" do
|
40
40
|
it "returns false" do
|
41
41
|
selector = double "Selector", inlinable?: "maybe"
|
42
|
-
expect(StyleBlock.new(selector, [], [:all, :
|
42
|
+
expect(StyleBlock.new(selector, [], [:all, :"screen (min-width: 300px)"]).inlinable?).to be(false)
|
43
43
|
end
|
44
44
|
end
|
45
45
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: roadie
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 5.1
|
4
|
+
version: 5.2.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Magnus Bergmark
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 1980-01-01 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: nokogiri
|
@@ -16,14 +16,14 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - "~>"
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: '1.
|
19
|
+
version: '1.15'
|
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: '1.
|
26
|
+
version: '1.15'
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: css_parser
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
@@ -94,6 +94,20 @@ dependencies:
|
|
94
94
|
- - "~>"
|
95
95
|
- !ruby/object:Gem::Version
|
96
96
|
version: '3.0'
|
97
|
+
- !ruby/object:Gem::Dependency
|
98
|
+
name: standardrb
|
99
|
+
requirement: !ruby/object:Gem::Requirement
|
100
|
+
requirements:
|
101
|
+
- - ">="
|
102
|
+
- !ruby/object:Gem::Version
|
103
|
+
version: '0'
|
104
|
+
type: :development
|
105
|
+
prerelease: false
|
106
|
+
version_requirements: !ruby/object:Gem::Requirement
|
107
|
+
requirements:
|
108
|
+
- - ">="
|
109
|
+
- !ruby/object:Gem::Version
|
110
|
+
version: '0'
|
97
111
|
description: Roadie tries to make sending HTML emails a little less painful by inlining
|
98
112
|
stylesheets and rewriting relative URLs for you.
|
99
113
|
email:
|
@@ -104,11 +118,11 @@ extra_rdoc_files:
|
|
104
118
|
- README.md
|
105
119
|
- Changelog.md
|
106
120
|
files:
|
107
|
-
- ".autotest"
|
108
121
|
- ".github/workflows/main.yml"
|
109
122
|
- ".gitignore"
|
110
123
|
- ".rubocop.yml"
|
111
124
|
- ".solargraph.yml"
|
125
|
+
- ".standard.yml"
|
112
126
|
- ".yardopts"
|
113
127
|
- Changelog.md
|
114
128
|
- Gemfile
|
@@ -190,50 +204,15 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
190
204
|
requirements:
|
191
205
|
- - ">="
|
192
206
|
- !ruby/object:Gem::Version
|
193
|
-
version: '2.
|
207
|
+
version: '2.7'
|
194
208
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
195
209
|
requirements:
|
196
210
|
- - ">="
|
197
211
|
- !ruby/object:Gem::Version
|
198
212
|
version: '0'
|
199
213
|
requirements: []
|
200
|
-
rubygems_version: 3.
|
214
|
+
rubygems_version: 3.5.5
|
201
215
|
signing_key:
|
202
216
|
specification_version: 4
|
203
217
|
summary: Making HTML emails comfortable for the Ruby rockstars
|
204
|
-
test_files:
|
205
|
-
- spec/fixtures/big_em.css
|
206
|
-
- spec/fixtures/stylesheets/green.css
|
207
|
-
- spec/hash_as_cache_store_spec.rb
|
208
|
-
- spec/integration_spec.rb
|
209
|
-
- spec/lib/roadie/asset_scanner_spec.rb
|
210
|
-
- spec/lib/roadie/cached_provider_spec.rb
|
211
|
-
- spec/lib/roadie/css_not_found_spec.rb
|
212
|
-
- spec/lib/roadie/deduplicator_spec.rb
|
213
|
-
- spec/lib/roadie/document_spec.rb
|
214
|
-
- spec/lib/roadie/filesystem_provider_spec.rb
|
215
|
-
- spec/lib/roadie/inliner_spec.rb
|
216
|
-
- spec/lib/roadie/markup_improver_spec.rb
|
217
|
-
- spec/lib/roadie/net_http_provider_spec.rb
|
218
|
-
- spec/lib/roadie/null_provider_spec.rb
|
219
|
-
- spec/lib/roadie/null_url_rewriter_spec.rb
|
220
|
-
- spec/lib/roadie/path_rewriter_provider_spec.rb
|
221
|
-
- spec/lib/roadie/provider_list_spec.rb
|
222
|
-
- spec/lib/roadie/selector_spec.rb
|
223
|
-
- spec/lib/roadie/style_attribute_builder_spec.rb
|
224
|
-
- spec/lib/roadie/style_block_spec.rb
|
225
|
-
- spec/lib/roadie/style_property_spec.rb
|
226
|
-
- spec/lib/roadie/stylesheet_spec.rb
|
227
|
-
- spec/lib/roadie/test_provider_spec.rb
|
228
|
-
- spec/lib/roadie/url_generator_spec.rb
|
229
|
-
- spec/lib/roadie/url_rewriter_spec.rb
|
230
|
-
- spec/lib/roadie/utils_spec.rb
|
231
|
-
- spec/shared_examples/asset_provider.rb
|
232
|
-
- spec/shared_examples/url_rewriter.rb
|
233
|
-
- spec/spec_helper.rb
|
234
|
-
- spec/support/have_attribute_matcher.rb
|
235
|
-
- spec/support/have_node_matcher.rb
|
236
|
-
- spec/support/have_selector_matcher.rb
|
237
|
-
- spec/support/have_styling_matcher.rb
|
238
|
-
- spec/support/have_xpath_matcher.rb
|
239
|
-
- spec/support/test_provider.rb
|
218
|
+
test_files: []
|
data/.autotest
DELETED