cloudinary 1.0.23 → 1.0.24
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/cloudinary/utils.rb +5 -2
- data/lib/cloudinary/version.rb +1 -1
- data/spec/utils_spec.rb +16 -2
- metadata +2 -2
data/lib/cloudinary/utils.rb
CHANGED
@@ -30,9 +30,12 @@ class Cloudinary::Utils
|
|
30
30
|
named_transformation = base_transformations.join(".")
|
31
31
|
base_transformations = []
|
32
32
|
end
|
33
|
+
|
34
|
+
effect = options.delete(:effect)
|
35
|
+
effect = Array(effect).flatten.join(":") if effect.is_a?(Array) || effect.is_a?(Hash)
|
33
36
|
|
34
|
-
params = {:w=>width, :h=>height, :t=>named_transformation, :c=>crop, :b=>background}
|
35
|
-
{ :x=>:x, :y=>:y, :r=>:radius, :d=>:default_image, :g=>:gravity, :q=>:quality, :p=>:prefix, :a=>:angle, :l=>:overlay, :f=>:fetch_format
|
37
|
+
params = {:w=>width, :h=>height, :t=>named_transformation, :c=>crop, :b=>background, :e=>effect}
|
38
|
+
{ :x=>:x, :y=>:y, :r=>:radius, :d=>:default_image, :g=>:gravity, :q=>:quality, :p=>:prefix, :a=>:angle, :l=>:overlay, :f=>:fetch_format }.each do
|
36
39
|
|param, option|
|
37
40
|
params[param] = options.delete(option)
|
38
41
|
end
|
data/lib/cloudinary/version.rb
CHANGED
data/spec/utils_spec.rb
CHANGED
@@ -206,11 +206,25 @@ describe Cloudinary::Utils do
|
|
206
206
|
result.should == "http://res.cloudinary.com/test123/image/fetch/f_jpg/http://cloudinary.com/images/logo.png"
|
207
207
|
end
|
208
208
|
|
209
|
-
it "should support
|
210
|
-
options = {:
|
209
|
+
it "should support effect" do
|
210
|
+
options = {:effect=>"sepia"}
|
211
211
|
result = Cloudinary::Utils.cloudinary_url("test", options)
|
212
212
|
options.should == {}
|
213
213
|
result.should == "http://res.cloudinary.com/test123/image/upload/e_sepia/test"
|
214
214
|
end
|
215
|
+
|
216
|
+
it "should support effect with hash param" do
|
217
|
+
options = {:effect=>{"sepia"=>10}}
|
218
|
+
result = Cloudinary::Utils.cloudinary_url("test", options)
|
219
|
+
options.should == {}
|
220
|
+
result.should == "http://res.cloudinary.com/test123/image/upload/e_sepia:10/test"
|
221
|
+
end
|
222
|
+
|
223
|
+
it "should support effect with array param" do
|
224
|
+
options = {:effect=>["sepia", 10]}
|
225
|
+
result = Cloudinary::Utils.cloudinary_url("test", options)
|
226
|
+
options.should == {}
|
227
|
+
result.should == "http://res.cloudinary.com/test123/image/upload/e_sepia:10/test"
|
228
|
+
end
|
215
229
|
|
216
230
|
end
|
metadata
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
name: cloudinary
|
3
3
|
version: !ruby/object:Gem::Version
|
4
4
|
prerelease:
|
5
|
-
version: 1.0.
|
5
|
+
version: 1.0.24
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
8
8
|
- Nadav Soferman
|
@@ -12,7 +12,7 @@ autorequire:
|
|
12
12
|
bindir: bin
|
13
13
|
cert_chain: []
|
14
14
|
|
15
|
-
date: 2012-05-
|
15
|
+
date: 2012-05-17 00:00:00 +03:00
|
16
16
|
default_executable:
|
17
17
|
dependencies:
|
18
18
|
- !ruby/object:Gem::Dependency
|