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 CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- NGM4YmEyMGE3NWMyZjliNWJiYzI1OWZhYjU5ZTYxYTk2ZWMzZDMxMg==
4
+ NjljOWM1ZTk5ODJmZDAyMzc3Y2Y0MGU0OGY0NTE5NTI5N2FkZjA3OA==
5
5
  data.tar.gz: !binary |-
6
- OGNhYmI2ZDM3ZWM5NjZhMjJjNDlkY2E0MzkzOTJkZTJkOWNhNmZiNQ==
6
+ MmFiZjlmNzJjMDQwZDI4YzUzZmJkZjA0NjRjMzk0MzI2YzVhNDk1Yw==
7
7
  !binary "U0hBNTEy":
8
8
  metadata.gz: !binary |-
9
- NjAyMDk1OTNkNWVmMGFkODkxZDYxNjIxNzRmNThiY2FiNmQ0MjhhMzIwNmMx
10
- MmViOGJmMGZkN2Q5ZmFlYmFjZjk4OGY3ZmY1MzU2Mjk5MDQ3ZTBkMmM0YmUz
11
- YjYzYjc3ZThlNDVhZDQ1N2VhZTU3OGJiMjczNmI4ZmYwYzc3NTg=
9
+ MWNkY2Y0MzQ1YjljZWM4OTYwZjkxNWY0ZGI1OWRmNjAwOWZlZjRkZTgxOGFm
10
+ NmI3YjVhMDJlM2Y2MGJmYjk0NmFiNjVkMmI2NzkxNjM3NmViNTdkM2ZhNDc2
11
+ MTE5MzQ1MjM0ZTY5OGJiMmU0NDliYzBhNDI4N2I0YTY2ZDNmMTM=
12
12
  data.tar.gz: !binary |-
13
- NjExMzBkZGMxMDFmNGI3Y2QzOWI0YTJhMTRhMzE3MWQ3ZWJmZmY0MDBiYjAx
14
- NTM5ZDYxYzQ0MzZmOTU4MzhjZWMwYjI3ODMwNzc4NDg1ODBkMzkzNjM2OGFk
15
- MWQ2Y2MyZDI4ODAyOWZlNzQwMzUzNjZkYjE5NmM4NTYzMDhlMjU=
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
@@ -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={})
@@ -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],
@@ -1,4 +1,4 @@
1
1
  # Copyright Cloudinary
2
2
  module Cloudinary
3
- VERSION = "1.0.65"
3
+ VERSION = "1.0.66"
4
4
  end
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
@@ -2,4 +2,5 @@
2
2
  RSpec.configure do |config|
3
3
  config.treat_symbols_as_metadata_keys_with_true_values = true
4
4
  config.run_all_when_everything_filtered = true
5
+ config.filter_run_excluding :delete_all => true
5
6
  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.65
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-04 00:00:00.000000000 Z
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