roadie-rails 1.1.0.rc1 → 1.1.0.rc2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Changelog.md +7 -1
- data/README.md +1 -1
- data/lib/roadie/rails/options.rb +23 -7
- data/lib/roadie/rails/version.rb +1 -1
- data/spec/lib/roadie/rails/options_spec.rb +13 -0
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: dcb900b0ff648dc35539039d535cd4b1ab7a67d9
|
4
|
+
data.tar.gz: 8ef1f9b9bfae0fc65f6e7d383a6147f68afad7ec
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2f208d03f3541bbd090e849b95807dc73fcd572063dbec96b99e78262ccc11232126fa17f672ed30752d97d80e330fdff1535df7fc3444d8baad344f4617dd93
|
7
|
+
data.tar.gz: f84b45b790fddbae358a14049b8ee34008b175c949d2f5ca405659f5353f24c5b51176a7c8150af4a8ffbb0cd8ab8c6e6e5f25c093189b0e7cbeb7d17f7d1ace
|
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.1.0.
|
3
|
+
[full changelog](https://github.com/Mange/roadie-rails/compare/v1.1.0.rc2...master)
|
4
|
+
|
5
|
+
### development version
|
6
|
+
|
7
|
+
[full changelog](https://github.com/Mange/roadie-rails/compare/v1.1.0.rc1...v1.1.0.rc2)
|
8
|
+
|
9
|
+
* Add support for `roadie`'s `external_asset_providers` option.
|
4
10
|
|
5
11
|
### 1.1.0.rc1
|
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', '~> 1.0'
|
19
19
|
```
|
20
20
|
|
21
21
|
## Usage ##
|
data/lib/roadie/rails/options.rb
CHANGED
@@ -5,6 +5,7 @@ module Roadie
|
|
5
5
|
:after_transformation,
|
6
6
|
:asset_providers,
|
7
7
|
:before_transformation,
|
8
|
+
:external_asset_providers,
|
8
9
|
:keep_uninlinable_css,
|
9
10
|
:url_options,
|
10
11
|
]
|
@@ -13,11 +14,12 @@ module Roadie
|
|
13
14
|
|
14
15
|
def initialize(options = {})
|
15
16
|
complain_about_unknown_keys options.keys
|
16
|
-
self.after_transformation
|
17
|
-
self.asset_providers
|
18
|
-
self.before_transformation
|
19
|
-
self.
|
20
|
-
self.
|
17
|
+
self.after_transformation = options[:after_transformation]
|
18
|
+
self.asset_providers = options[:asset_providers]
|
19
|
+
self.before_transformation = options[:before_transformation]
|
20
|
+
self.external_asset_providers = options[:external_asset_providers]
|
21
|
+
self.keep_uninlinable_css = options[:keep_uninlinable_css]
|
22
|
+
self.url_options = options[:url_options]
|
21
23
|
end
|
22
24
|
|
23
25
|
def url_options=(options)
|
@@ -45,13 +47,23 @@ module Roadie
|
|
45
47
|
end
|
46
48
|
end
|
47
49
|
|
50
|
+
def external_asset_providers=(providers)
|
51
|
+
if providers
|
52
|
+
@external_asset_providers = ProviderList.wrap providers
|
53
|
+
# TODO: Raise an error when setting to nil in order to make this not a silent error.
|
54
|
+
# else
|
55
|
+
# raise ArgumentError, "Cannot set asset_providers to nil. Set to Roadie::NullProvider if you want no external assets inlined."
|
56
|
+
end
|
57
|
+
end
|
58
|
+
|
48
59
|
def apply_to(document)
|
49
60
|
document.url_options = url_options
|
50
61
|
document.before_transformation = before_transformation
|
51
62
|
document.after_transformation = after_transformation
|
52
|
-
|
53
|
-
# that is not allowed to be nil on Document.
|
63
|
+
|
54
64
|
document.asset_providers = asset_providers if asset_providers
|
65
|
+
document.external_asset_providers = external_asset_providers if external_asset_providers
|
66
|
+
|
55
67
|
document.keep_uninlinable_css = keep_uninlinable_css unless keep_uninlinable_css.nil?
|
56
68
|
end
|
57
69
|
|
@@ -83,6 +95,10 @@ module Roadie
|
|
83
95
|
before_transformation, options[:before_transformation]
|
84
96
|
)
|
85
97
|
|
98
|
+
self.external_asset_providers = combine_providers(
|
99
|
+
external_asset_providers, options[:external_asset_providers]
|
100
|
+
)
|
101
|
+
|
86
102
|
self.keep_uninlinable_css =
|
87
103
|
options[:keep_uninlinable_css] if options.has_key?(:keep_uninlinable_css)
|
88
104
|
|
data/lib/roadie/rails/version.rb
CHANGED
@@ -138,6 +138,19 @@ module Roadie
|
|
138
138
|
end
|
139
139
|
end
|
140
140
|
|
141
|
+
it_behaves_like "attribute", :external_asset_providers do
|
142
|
+
let(:provider1) { double "Asset provider 1" }
|
143
|
+
let(:provider2) { double "Asset provider 2" }
|
144
|
+
|
145
|
+
let(:valid_value) { ProviderList.new([provider1]) }
|
146
|
+
let(:other_valid_value) { ProviderList.new([provider2]) }
|
147
|
+
|
148
|
+
def expect_combinated_value(value)
|
149
|
+
expect(value).to be_instance_of(ProviderList)
|
150
|
+
expect(value.to_a).to eq([provider1, provider2])
|
151
|
+
end
|
152
|
+
end
|
153
|
+
|
141
154
|
describe "asset_providers" do
|
142
155
|
it "automatically wraps values in a ProviderList" do
|
143
156
|
provider = double "Asset provider"
|