cloudinary 1.1.4 → 1.1.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitignore +1 -3
- data/CHANGELOG.md +7 -0
- data/lib/cloudinary/utils.rb +7 -3
- data/lib/cloudinary/version.rb +1 -1
- data/spec/api_spec.rb +4 -5
- data/spec/uploader_spec.rb +2 -2
- data/spec/utils_spec.rb +9 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 994a732239924e9e97be2b2f6a77aa95e9b91ef3
|
4
|
+
data.tar.gz: f6385d224deba5c1a9f9c452c89535a4ea0a734d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 37af802a5e9f09fd81935c87003c25049b3aebdd534dec781592efd00426a2906d95eb0e6210ed2c47b76db64941d7e5590d2f7b35c27f5df0eebc0c717382ad
|
7
|
+
data.tar.gz: 6538886c89dc87eb99432d43a4b1c6a90dfdd5626e49aef97176c8b21d9a302e2698848d128b044cb0b774b9d470a8f9db6cefb09989d033caaf0eb0f19c0d6b
|
data/.gitignore
CHANGED
data/CHANGELOG.md
CHANGED
@@ -1,4 +1,11 @@
|
|
1
1
|
|
2
|
+
1.1.5 / 2016-04-12
|
3
|
+
==================
|
4
|
+
|
5
|
+
* Add `url_suffix` support for private images.
|
6
|
+
* Replace explicit twitter test with explicit transformation
|
7
|
+
* Fix "should allow listing resources by start date" test
|
8
|
+
|
2
9
|
1.1.4 / 2016-03-22
|
3
10
|
==================
|
4
11
|
|
data/lib/cloudinary/utils.rb
CHANGED
@@ -389,14 +389,18 @@ class Cloudinary::Utils
|
|
389
389
|
def self.finalize_resource_type(resource_type, type, url_suffix, use_root_path, shorten)
|
390
390
|
type ||= :upload
|
391
391
|
if !url_suffix.blank?
|
392
|
-
|
392
|
+
case
|
393
|
+
when resource_type.to_s == "image" && type.to_s == "upload"
|
393
394
|
resource_type = "images"
|
394
395
|
type = nil
|
395
|
-
|
396
|
+
when resource_type.to_s == "image" && type.to_s == "private"
|
397
|
+
resource_type = "private_images"
|
398
|
+
type = nil
|
399
|
+
when resource_type.to_s == "raw" && type.to_s == "upload"
|
396
400
|
resource_type = "files"
|
397
401
|
type = nil
|
398
402
|
else
|
399
|
-
raise(CloudinaryException, "URL Suffix only supported for image/upload and raw/upload")
|
403
|
+
raise(CloudinaryException, "URL Suffix only supported for image/upload, image/private and raw/upload")
|
400
404
|
end
|
401
405
|
end
|
402
406
|
if use_root_path
|
data/lib/cloudinary/version.rb
CHANGED
data/spec/api_spec.rb
CHANGED
@@ -70,12 +70,11 @@ describe Cloudinary::Api do
|
|
70
70
|
end
|
71
71
|
|
72
72
|
it "should allow listing resources by start date", :start_at => true do
|
73
|
-
sleep(
|
74
|
-
|
75
|
-
|
76
|
-
response = Cloudinary::Uploader.upload("spec/logo.png")
|
73
|
+
sleep(1)
|
74
|
+
response = Cloudinary::Uploader.upload("spec/logo.png", :tags => TEST_TAG)
|
75
|
+
start_at = Time.parse( response["created_at"]) - 0.5
|
77
76
|
resources = @api.resources(:type=>"upload", :start_at=>start_at, :direction => "asc")["resources"]
|
78
|
-
expect(resources.map{|resource| resource["public_id"]})
|
77
|
+
expect(resources.map{|resource| resource["public_id"]}).to eq([response["public_id"]])
|
79
78
|
end
|
80
79
|
|
81
80
|
it "should allow listing resources in both directions" do
|
data/spec/uploader_spec.rb
CHANGED
@@ -73,8 +73,8 @@ describe Cloudinary::Uploader do
|
|
73
73
|
|
74
74
|
|
75
75
|
it "should support explicit" do
|
76
|
-
result = Cloudinary::Uploader.explicit("
|
77
|
-
url = Cloudinary::Utils.cloudinary_url("
|
76
|
+
result = Cloudinary::Uploader.explicit("sample", :type=>"upload", :eager=>[{:crop=>"scale", :width=>"2.0"}], :tags => TEST_TAG)
|
77
|
+
url = Cloudinary::Utils.cloudinary_url("sample", :type=>"upload", :crop=>"scale", :width=>"2.0", :format=>"jpg", :version=>result["version"])
|
78
78
|
expect(result["eager"][0]["url"]).to eq(url)
|
79
79
|
end
|
80
80
|
|
data/spec/utils_spec.rb
CHANGED
@@ -133,6 +133,15 @@ describe Cloudinary::Utils do
|
|
133
133
|
.and empty_options
|
134
134
|
end
|
135
135
|
|
136
|
+
it "should support url_suffix for private uploads" do
|
137
|
+
expect(["test", { :url_suffix => "hello", :private_cdn => true, :resource_type => :image, :type => :private }])
|
138
|
+
.to produce_url("http://#{cloud_name}-res.cloudinary.com/private_images/test/hello")
|
139
|
+
.and empty_options
|
140
|
+
expect(["test", { :url_suffix => "hello", :private_cdn => true, :format => "jpg", :resource_type => :image, :type => :private }])
|
141
|
+
.to produce_url("http://#{cloud_name}-res.cloudinary.com/private_images/test/hello.jpg")
|
142
|
+
.and empty_options
|
143
|
+
end
|
144
|
+
|
136
145
|
describe 'root_path support' do
|
137
146
|
|
138
147
|
it "should allow use_root_path in shared distribution" do
|
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.1.
|
4
|
+
version: 1.1.5
|
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: 2016-
|
13
|
+
date: 2016-04-12 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: aws_cf_signer
|