cloudinary 1.0.47 → 1.0.48
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.
- data/lib/cloudinary/api.rb +2 -0
- data/lib/cloudinary/carrier_wave.rb +5 -0
- data/lib/cloudinary/carrier_wave/remote.rb +1 -0
- data/lib/cloudinary/helper.rb +14 -0
- data/lib/cloudinary/uploader.rb +3 -3
- data/lib/cloudinary/version.rb +1 -1
- data/spec/utils_spec.rb +6 -0
- metadata +2 -2
data/lib/cloudinary/api.rb
CHANGED
@@ -103,6 +103,11 @@ module Cloudinary::CarrierWave
|
|
103
103
|
def delete_remote?
|
104
104
|
true
|
105
105
|
end
|
106
|
+
|
107
|
+
# Let Cloudinary download remote URLs directly
|
108
|
+
def cloudinary_should_handle_remote?
|
109
|
+
true
|
110
|
+
end
|
106
111
|
|
107
112
|
class CloudinaryFile
|
108
113
|
attr_reader :identifier, :public_id, :filename, :format, :version, :storage_type, :resource_type
|
data/lib/cloudinary/helper.rb
CHANGED
@@ -210,6 +210,20 @@ module Cloudinary::FormBuilder
|
|
210
210
|
end
|
211
211
|
end
|
212
212
|
|
213
|
+
if defined? ActionView::Helpers::AssetUrlHelper
|
214
|
+
module ActionView::Helpers::AssetUrlHelper
|
215
|
+
alias :original_path_to_asset :path_to_asset
|
216
|
+
|
217
|
+
def path_to_asset(source, options)
|
218
|
+
options ||= {}
|
219
|
+
if Cloudinary.config.enhance_image_tag && options[:type] == :image
|
220
|
+
source = Cloudinary::Utils.cloudinary_url(source, options.merge(:type=>:asset))
|
221
|
+
end
|
222
|
+
original_path_to_asset(source, options)
|
223
|
+
end
|
224
|
+
end
|
225
|
+
end
|
226
|
+
|
213
227
|
ActionView::Base.send :include, CloudinaryHelper
|
214
228
|
|
215
229
|
begin
|
data/lib/cloudinary/uploader.rb
CHANGED
@@ -16,7 +16,7 @@ class Cloudinary::Uploader
|
|
16
16
|
|
17
17
|
def self.build_upload_params(options)
|
18
18
|
params = {:timestamp=>Time.now.to_i,
|
19
|
-
:transformation => Cloudinary::Utils.generate_transformation_string(options),
|
19
|
+
:transformation => Cloudinary::Utils.generate_transformation_string(options.clone),
|
20
20
|
:public_id=> options[:public_id],
|
21
21
|
:callback=> options[:callback],
|
22
22
|
:format=>options[:format],
|
@@ -123,7 +123,7 @@ class Cloudinary::Uploader
|
|
123
123
|
:format=>options[:format],
|
124
124
|
:async=>options[:async],
|
125
125
|
:notification_url=>options[:notification_url],
|
126
|
-
:transformation => Cloudinary::Utils.generate_transformation_string(options)
|
126
|
+
:transformation => Cloudinary::Utils.generate_transformation_string(options.clone)
|
127
127
|
}
|
128
128
|
end
|
129
129
|
end
|
@@ -136,7 +136,7 @@ class Cloudinary::Uploader
|
|
136
136
|
:type=>options[:type],
|
137
137
|
:format=>options[:format],
|
138
138
|
:notification_url=>options[:notification_url],
|
139
|
-
:transformation => Cloudinary::Utils.generate_transformation_string(options)
|
139
|
+
:transformation => Cloudinary::Utils.generate_transformation_string(options.clone)
|
140
140
|
}
|
141
141
|
end
|
142
142
|
end
|
data/lib/cloudinary/version.rb
CHANGED
data/spec/utils_spec.rb
CHANGED
@@ -372,4 +372,10 @@ describe Cloudinary::Utils do
|
|
372
372
|
options.should == {}
|
373
373
|
result.should == "http://res.cloudinary.com/test123/image/upload/fl_abc.def/test"
|
374
374
|
end
|
375
|
+
|
376
|
+
it "build_upload_params should not destroy options" do
|
377
|
+
options = {:width=>100, :crop=>:scale}
|
378
|
+
Cloudinary::Uploader.build_upload_params(options)[:transformation].should == "c_scale,w_100"
|
379
|
+
options.length.should == 2
|
380
|
+
end
|
375
381
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: cloudinary
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.48
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -11,7 +11,7 @@ authors:
|
|
11
11
|
autorequire:
|
12
12
|
bindir: bin
|
13
13
|
cert_chain: []
|
14
|
-
date: 2013-03-
|
14
|
+
date: 2013-03-20 00:00:00.000000000 Z
|
15
15
|
dependencies:
|
16
16
|
- !ruby/object:Gem::Dependency
|
17
17
|
name: rest-client
|