cloudinary 1.0.65 → 1.0.66
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +8 -8
- data/CHANGELOG +5 -0
- data/lib/cloudinary/api.rb +10 -3
- data/lib/cloudinary/uploader.rb +1 -0
- data/lib/cloudinary/version.rb +1 -1
- data/spec/api_spec.rb +12 -0
- data/spec/spec_helper.rb +1 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
---
|
2
2
|
!binary "U0hBMQ==":
|
3
3
|
metadata.gz: !binary |-
|
4
|
-
|
4
|
+
NjljOWM1ZTk5ODJmZDAyMzc3Y2Y0MGU0OGY0NTE5NTI5N2FkZjA3OA==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
6
|
+
MmFiZjlmNzJjMDQwZDI4YzUzZmJkZjA0NjRjMzk0MzI2YzVhNDk1Yw==
|
7
7
|
!binary "U0hBNTEy":
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
MWNkY2Y0MzQ1YjljZWM4OTYwZjkxNWY0ZGI1OWRmNjAwOWZlZjRkZTgxOGFm
|
10
|
+
NmI3YjVhMDJlM2Y2MGJmYjk0NmFiNjVkMmI2NzkxNjM3NmViNTdkM2ZhNDc2
|
11
|
+
MTE5MzQ1MjM0ZTY5OGJiMmU0NDliYzBhNDI4N2I0YTY2ZDNmMTM=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
ZTk2ZGUwMTA5MjYyZmFkMWEzZmIzMTQ4NTQ5MjdhMzliMjk5YmQzNzNhZDhh
|
14
|
+
NTBiNGM0MDcyZWVhOGMzODk5NDQ2ZTcxMWI3MTFlMDkzZDkyNTYzOGM5NDI5
|
15
|
+
Yzc4Yjc1MmQ0ZGUxMTcwNDViNjI0ZmUyMTk4NTM2Njg0NDMyMjA=
|
data/CHANGELOG
CHANGED
@@ -1,3 +1,8 @@
|
|
1
|
+
= Version 1.0.66 - 2013-11-14
|
2
|
+
* Support overwrite flag in upload
|
3
|
+
* Support tags flag in resources_by_tag
|
4
|
+
* Support for deletion cursor and delete all
|
5
|
+
|
1
6
|
= Version 1.0.65 - 2013-11-04
|
2
7
|
* Support for unique_filename upload parameter
|
3
8
|
* Support the color parameter
|
data/lib/cloudinary/api.rb
CHANGED
@@ -42,7 +42,7 @@ class Cloudinary::Api
|
|
42
42
|
def self.resources_by_tag(tag, options={})
|
43
43
|
resource_type = options[:resource_type] || "image"
|
44
44
|
uri = "resources/#{resource_type}/tags/#{tag}"
|
45
|
-
call_api(:get, uri, only(options, :next_cursor, :max_results), options)
|
45
|
+
call_api(:get, uri, only(options, :next_cursor, :max_results, :tags), options)
|
46
46
|
end
|
47
47
|
|
48
48
|
def self.resource(public_id, options={})
|
@@ -63,13 +63,20 @@ class Cloudinary::Api
|
|
63
63
|
resource_type = options[:resource_type] || "image"
|
64
64
|
type = options[:type] || "upload"
|
65
65
|
uri = "resources/#{resource_type}/#{type}"
|
66
|
-
call_api(:delete, uri, {:prefix=>prefix}.merge(only(options, :keep_original)), options)
|
66
|
+
call_api(:delete, uri, {:prefix=>prefix}.merge(only(options, :keep_original, :next_cursor)), options)
|
67
|
+
end
|
68
|
+
|
69
|
+
def self.delete_all_resources(options={})
|
70
|
+
resource_type = options[:resource_type] || "image"
|
71
|
+
type = options[:type] || "upload"
|
72
|
+
uri = "resources/#{resource_type}/#{type}"
|
73
|
+
call_api(:delete, uri, {:all=>true}.merge(only(options, :keep_original, :next_cursor)), options)
|
67
74
|
end
|
68
75
|
|
69
76
|
def self.delete_resources_by_tag(tag, options={})
|
70
77
|
resource_type = options[:resource_type] || "image"
|
71
78
|
uri = "resources/#{resource_type}/tags/#{tag}"
|
72
|
-
call_api(:delete, uri, only(options, :keep_original), options)
|
79
|
+
call_api(:delete, uri, only(options, :keep_original, :next_cursor), options)
|
73
80
|
end
|
74
81
|
|
75
82
|
def self.delete_derived_resources(derived_resource_ids, options={})
|
data/lib/cloudinary/uploader.rb
CHANGED
@@ -31,6 +31,7 @@ class Cloudinary::Uploader
|
|
31
31
|
:headers=>build_custom_headers(options[:headers]),
|
32
32
|
:use_filename=>Cloudinary::Utils.as_safe_bool(options[:use_filename]),
|
33
33
|
:unique_filename=>Cloudinary::Utils.as_safe_bool(options[:unique_filename]),
|
34
|
+
:overwrite=>Cloudinary::Utils.as_safe_bool(options[:overwrite]),
|
34
35
|
:discard_original_filename=>Cloudinary::Utils.as_safe_bool(options[:discard_original_filename]),
|
35
36
|
:notification_url=>options[:notification_url],
|
36
37
|
:eager_notification_url=>options[:eager_notification_url],
|
data/lib/cloudinary/version.rb
CHANGED
data/spec/api_spec.rb
CHANGED
@@ -165,5 +165,17 @@ describe Cloudinary::Api do
|
|
165
165
|
@api.delete_transformation("c_scale,w_100")
|
166
166
|
lambda{@api.transformation("c_scale,w_100")}.should raise_error(Cloudinary::Api::NotFound)
|
167
167
|
end
|
168
|
+
|
169
|
+
# this test must be last because it deletes (potentially) all dependent transformations which some tests rely on. Excluded by default.
|
170
|
+
it "should allow deleting all resources", :delete_all=>true do
|
171
|
+
Cloudinary::Uploader.upload("spec/logo.png", :public_id=>"api_test5", :eager=>[:width=>101,:crop=>:scale])
|
172
|
+
resource = @api.resource("api_test5")
|
173
|
+
resource.should_not be_blank
|
174
|
+
resource["derived"].length.should == 1
|
175
|
+
@api.delete_all_resources(:keep_original => true)
|
176
|
+
resource = @api.resource("api_test5")
|
177
|
+
resource.should_not be_blank
|
178
|
+
resource["derived"].length.should == 0
|
179
|
+
end
|
168
180
|
|
169
181
|
end
|
data/spec/spec_helper.rb
CHANGED
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.66
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Nadav Soferman
|
@@ -10,7 +10,7 @@ authors:
|
|
10
10
|
autorequire:
|
11
11
|
bindir: bin
|
12
12
|
cert_chain: []
|
13
|
-
date: 2013-11-
|
13
|
+
date: 2013-11-14 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
requirement: !ruby/object:Gem::Requirement
|