roadie-rails 1.0.6 → 1.1.0.rc1
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/.travis.yml +3 -3
- data/Changelog.md +7 -1
- data/README.md +9 -6
- data/lib/roadie/rails/options.rb +37 -12
- data/lib/roadie/rails/version.rb +1 -1
- data/roadie-rails.gemspec +1 -1
- data/spec/lib/roadie/rails/options_spec.rb +15 -0
- metadata +15 -9
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b6e069d2ab9315717c52c90b8546ceaed0e11886
|
4
|
+
data.tar.gz: ef744fe87053f03b4f01d4c30433b4bc1bb57e6c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5a92864739208eab2125a21d3b89de11a113c784bf48ee44ed51b41a227109addb71ad98eab4898914f58657a3c909ba8cc5eba7da6c1f279e36ca79371329c3
|
7
|
+
data.tar.gz: 74da180802daf9f9ed9c73d1e8de4dd21461dc9be39fc64514e8f7fca6eecf0c10090aa9974cce6deed3e787d6179d816054e4491bf9587e09312ac55291efd3
|
data/.travis.yml
CHANGED
data/Changelog.md
CHANGED
@@ -1,6 +1,12 @@
|
|
1
1
|
### development version
|
2
2
|
|
3
|
-
[full changelog](https://github.com/Mange/roadie-rails/compare/v1.0.
|
3
|
+
[full changelog](https://github.com/Mange/roadie-rails/compare/v1.1.0.rc1...master)
|
4
|
+
|
5
|
+
### 1.1.0.rc1
|
6
|
+
|
7
|
+
[full changelog](https://github.com/Mange/roadie-rails/compare/v1.0.6...v1.1.0.rc1)
|
8
|
+
|
9
|
+
* Add support for `roadie`'s `keep_uninlinable_css` option.
|
4
10
|
|
5
11
|
### 1.0.6
|
6
12
|
|
data/README.md
CHANGED
@@ -15,7 +15,7 @@ This gem hooks up your Rails application with Roadie to help you generate HTML e
|
|
15
15
|
[Add this gem to your Gemfile as recommended by Rubygems][gem] and run `bundle install`.
|
16
16
|
|
17
17
|
```ruby
|
18
|
-
gem 'roadie-rails', '~>
|
18
|
+
gem 'roadie-rails', '~> 3.1'
|
19
19
|
```
|
20
20
|
|
21
21
|
## Usage ##
|
@@ -247,7 +247,7 @@ class Admin::EmailsController < AdminController
|
|
247
247
|
private
|
248
248
|
def render_email(email)
|
249
249
|
respond_to do |format|
|
250
|
-
format.html { render html: email.html_part.decoded }
|
250
|
+
format.html { render html: email.html_part.decoded.html_safe }
|
251
251
|
format.text { render text: email.text_part.decoded }
|
252
252
|
end
|
253
253
|
end
|
@@ -277,8 +277,11 @@ Tested with [Travis CI](http://travis-ci.org) using [almost all combinations of]
|
|
277
277
|
|
278
278
|
* Ruby:
|
279
279
|
* MRI 1.9.3
|
280
|
-
* MRI 2.0
|
281
|
-
* MRI 2.1
|
280
|
+
* MRI 2.0
|
281
|
+
* MRI 2.1
|
282
|
+
* MRI 2.2
|
283
|
+
* JRuby (latest)
|
284
|
+
* Rubinius (experimental)
|
282
285
|
* Rails
|
283
286
|
* 3.0
|
284
287
|
* 3.1
|
@@ -291,7 +294,7 @@ Let me know if you want any other combination supported officially.
|
|
291
294
|
|
292
295
|
### Versioning ###
|
293
296
|
|
294
|
-
This project follows [Semantic Versioning][semver].
|
297
|
+
This project follows [Semantic Versioning][semver].
|
295
298
|
|
296
299
|
## Documentation ##
|
297
300
|
|
@@ -312,7 +315,7 @@ rake spec
|
|
312
315
|
|
313
316
|
(The MIT License)
|
314
317
|
|
315
|
-
Copyright © 2013-
|
318
|
+
Copyright © 2013-2015
|
316
319
|
|
317
320
|
* [Magnus Bergmark](https://github.com/Mange) <magnus.bergmark@gmail.com>
|
318
321
|
|
data/lib/roadie/rails/options.rb
CHANGED
@@ -1,18 +1,23 @@
|
|
1
1
|
module Roadie
|
2
2
|
module Rails
|
3
3
|
class Options
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
4
|
+
ATTRIBUTE_NAMES = [
|
5
|
+
:after_transformation,
|
6
|
+
:asset_providers,
|
7
|
+
:before_transformation,
|
8
|
+
:keep_uninlinable_css,
|
9
|
+
:url_options,
|
10
|
+
]
|
11
|
+
private_constant :ATTRIBUTE_NAMES
|
12
|
+
attr_reader(*ATTRIBUTE_NAMES)
|
9
13
|
|
10
14
|
def initialize(options = {})
|
11
15
|
complain_about_unknown_keys options.keys
|
12
|
-
self.url_options = options[:url_options]
|
13
|
-
self.before_transformation = options[:before_transformation]
|
14
16
|
self.after_transformation = options[:after_transformation]
|
15
17
|
self.asset_providers = options[:asset_providers]
|
18
|
+
self.before_transformation = options[:before_transformation]
|
19
|
+
self.keep_uninlinable_css = options[:keep_uninlinable_css]
|
20
|
+
self.url_options = options[:url_options]
|
16
21
|
end
|
17
22
|
|
18
23
|
def url_options=(options)
|
@@ -27,6 +32,10 @@ module Roadie
|
|
27
32
|
@after_transformation = callback
|
28
33
|
end
|
29
34
|
|
35
|
+
def keep_uninlinable_css=(bool)
|
36
|
+
@keep_uninlinable_css = bool
|
37
|
+
end
|
38
|
+
|
30
39
|
def asset_providers=(providers)
|
31
40
|
if providers
|
32
41
|
@asset_providers = ProviderList.wrap providers
|
@@ -43,6 +52,7 @@ module Roadie
|
|
43
52
|
# #asset_providers default to nil in this class and it's the one option
|
44
53
|
# that is not allowed to be nil on Document.
|
45
54
|
document.asset_providers = asset_providers if asset_providers
|
55
|
+
document.keep_uninlinable_css = keep_uninlinable_css unless keep_uninlinable_css.nil?
|
46
56
|
end
|
47
57
|
|
48
58
|
def merge(options)
|
@@ -50,7 +60,7 @@ module Roadie
|
|
50
60
|
end
|
51
61
|
|
52
62
|
def merge!(options)
|
53
|
-
|
63
|
+
ATTRIBUTE_NAMES.each do |attribute|
|
54
64
|
send "#{attribute}=", options.fetch(attribute, send(attribute))
|
55
65
|
end
|
56
66
|
self
|
@@ -61,10 +71,25 @@ module Roadie
|
|
61
71
|
end
|
62
72
|
|
63
73
|
def combine!(options)
|
64
|
-
self.
|
65
|
-
|
66
|
-
|
67
|
-
|
74
|
+
self.after_transformation = combine_callable(
|
75
|
+
after_transformation, options[:after_transformation]
|
76
|
+
)
|
77
|
+
|
78
|
+
self.asset_providers = combine_providers(
|
79
|
+
asset_providers, options[:asset_providers]
|
80
|
+
)
|
81
|
+
|
82
|
+
self.before_transformation = combine_callable(
|
83
|
+
before_transformation, options[:before_transformation]
|
84
|
+
)
|
85
|
+
|
86
|
+
self.keep_uninlinable_css =
|
87
|
+
options[:keep_uninlinable_css] if options.has_key?(:keep_uninlinable_css)
|
88
|
+
|
89
|
+
self.url_options = combine_hash(
|
90
|
+
url_options, options[:url_options]
|
91
|
+
)
|
92
|
+
|
68
93
|
self
|
69
94
|
end
|
70
95
|
|
data/lib/roadie/rails/version.rb
CHANGED
data/roadie-rails.gemspec
CHANGED
@@ -19,7 +19,7 @@ Gem::Specification.new do |spec|
|
|
19
19
|
spec.extra_rdoc_files = %w[README.md Changelog.md LICENSE.txt]
|
20
20
|
spec.require_paths = ["lib"]
|
21
21
|
|
22
|
-
spec.add_dependency "roadie", "
|
22
|
+
spec.add_dependency "roadie", ">= 3.1.0.rc1", "< 4.0"
|
23
23
|
spec.add_dependency "railties", ">= 3.0", "< 4.3"
|
24
24
|
|
25
25
|
spec.add_development_dependency "rails", ">= 3.0", "< 4.3"
|
@@ -66,6 +66,12 @@ module Roadie
|
|
66
66
|
options.combine(name => other_valid_value)
|
67
67
|
expect(options.send(name)).to eq(valid_value)
|
68
68
|
end
|
69
|
+
|
70
|
+
it "does not touch initial value if no new value is passed" do
|
71
|
+
options = Options.new(name => valid_value)
|
72
|
+
combined = options.combine({})
|
73
|
+
expect(combined.send(name)).to eq(valid_value)
|
74
|
+
end
|
69
75
|
end
|
70
76
|
|
71
77
|
describe "destructive combining" do
|
@@ -87,6 +93,15 @@ module Roadie
|
|
87
93
|
end
|
88
94
|
end
|
89
95
|
|
96
|
+
it_behaves_like "attribute", :keep_uninlinable_css do
|
97
|
+
let(:valid_value) { true }
|
98
|
+
let(:other_valid_value) { false }
|
99
|
+
|
100
|
+
def expect_combinated_value(value)
|
101
|
+
expect(value).to eq other_valid_value
|
102
|
+
end
|
103
|
+
end
|
104
|
+
|
90
105
|
it_behaves_like "attribute", :before_transformation do
|
91
106
|
let(:valid_value) { Proc.new { } }
|
92
107
|
let(:other_valid_value) { Proc.new { } }
|
metadata
CHANGED
@@ -1,29 +1,35 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: roadie-rails
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.1.0.rc1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Magnus Bergmark
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-
|
11
|
+
date: 2015-09-14 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: roadie
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
|
-
- - "
|
17
|
+
- - ">="
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version:
|
19
|
+
version: 3.1.0.rc1
|
20
|
+
- - "<"
|
21
|
+
- !ruby/object:Gem::Version
|
22
|
+
version: '4.0'
|
20
23
|
type: :runtime
|
21
24
|
prerelease: false
|
22
25
|
version_requirements: !ruby/object:Gem::Requirement
|
23
26
|
requirements:
|
24
|
-
- - "
|
27
|
+
- - ">="
|
25
28
|
- !ruby/object:Gem::Version
|
26
|
-
version:
|
29
|
+
version: 3.1.0.rc1
|
30
|
+
- - "<"
|
31
|
+
- !ruby/object:Gem::Version
|
32
|
+
version: '4.0'
|
27
33
|
- !ruby/object:Gem::Dependency
|
28
34
|
name: railties
|
29
35
|
requirement: !ruby/object:Gem::Requirement
|
@@ -278,12 +284,12 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
278
284
|
version: '0'
|
279
285
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
280
286
|
requirements:
|
281
|
-
- - "
|
287
|
+
- - ">"
|
282
288
|
- !ruby/object:Gem::Version
|
283
|
-
version:
|
289
|
+
version: 1.3.1
|
284
290
|
requirements: []
|
285
291
|
rubyforge_project:
|
286
|
-
rubygems_version: 2.
|
292
|
+
rubygems_version: 2.4.8
|
287
293
|
signing_key:
|
288
294
|
specification_version: 4
|
289
295
|
summary: Making HTML emails comfortable for the Rails rockstars
|