roadie-rails 1.0.6 → 1.1.0.rc1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: fced095e9fe73e6a92eb55d780a42c06460a3486
4
- data.tar.gz: dcd230517d07a86435ccf5c0fa861511e22722b4
3
+ metadata.gz: b6e069d2ab9315717c52c90b8546ceaed0e11886
4
+ data.tar.gz: ef744fe87053f03b4f01d4c30433b4bc1bb57e6c
5
5
  SHA512:
6
- metadata.gz: 56363e116f1c696afdeb9acf7cd8b3451de312137cbc92e681d754725ee4e41627c7fefa6b550fcb26e0da1f7fb8df9f19c9969fb491c83ebc95346e886cc6c4
7
- data.tar.gz: da2dc4683b3f24d4572c43cdcc4f3f427420efc28554f67b156ae24c7d4eb633e41b5abed0bb03c9e89292c521515f4f0f32f33446168602ea197b341d2c1b5d
6
+ metadata.gz: 5a92864739208eab2125a21d3b89de11a113c784bf48ee44ed51b41a227109addb71ad98eab4898914f58657a3c909ba8cc5eba7da6c1f279e36ca79371329c3
7
+ data.tar.gz: 74da180802daf9f9ed9c73d1e8de4dd21461dc9be39fc64514e8f7fca6eecf0c10090aa9974cce6deed3e787d6179d816054e4491bf9587e09312ac55291efd3
data/.travis.yml CHANGED
@@ -1,8 +1,9 @@
1
1
  language: ruby
2
2
  rvm:
3
3
  - 1.9.3
4
- - 2.0.0
5
- - 2.1.2
4
+ - 2.0
5
+ - 2.1
6
+ - 2.2
6
7
  - jruby
7
8
  - rbx
8
9
 
@@ -12,4 +13,3 @@ script: "rake"
12
13
  matrix:
13
14
  allow_failures:
14
15
  - rvm: rbx
15
- - rvm: jruby
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.6...master)
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', '~> x.y.0'
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.0
281
- * MRI 2.1.0
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]. The 0.x branch is considered unstable.
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-2014
318
+ Copyright © 2013-2015
316
319
 
317
320
  * [Magnus Bergmark](https://github.com/Mange) <magnus.bergmark@gmail.com>
318
321
 
@@ -1,18 +1,23 @@
1
1
  module Roadie
2
2
  module Rails
3
3
  class Options
4
- private
5
- ATTRIBUTE_NAMES = [:url_options, :before_transformation, :after_transformation, :asset_providers]
6
-
7
- public
8
- attr_reader *ATTRIBUTE_NAMES
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
- [:url_options, :before_transformation, :after_transformation, :asset_providers].each do |attribute|
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.url_options = combine_hash url_options, options[:url_options]
65
- self.before_transformation = combine_callable before_transformation, options[:before_transformation]
66
- self.after_transformation = combine_callable after_transformation, options[:after_transformation]
67
- self.asset_providers = combine_providers asset_providers, options[:asset_providers]
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
 
@@ -1,5 +1,5 @@
1
1
  module Roadie
2
2
  module Rails
3
- VERSION = "1.0.6"
3
+ VERSION = "1.1.0.rc1"
4
4
  end
5
5
  end
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", "~> 3.0"
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.6
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-05-07 00:00:00.000000000 Z
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: '3.0'
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: '3.0'
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: '0'
289
+ version: 1.3.1
284
290
  requirements: []
285
291
  rubyforge_project:
286
- rubygems_version: 2.2.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