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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 40c8821125bf4aa673a4e681867b3544f6a07b8f
4
- data.tar.gz: 8093407d979244579abefcdff28b689a1ede0911
3
+ metadata.gz: 994a732239924e9e97be2b2f6a77aa95e9b91ef3
4
+ data.tar.gz: f6385d224deba5c1a9f9c452c89535a4ea0a734d
5
5
  SHA512:
6
- metadata.gz: 4b99e1b9657ce647e83af64300d134da80fe46e8cf22f0e379b966b7d548f2a004c659ebce923805aeedcdb32031d131e06bcffc8db7c1003546cafd02d8b647
7
- data.tar.gz: 494b6a5c1934cd0074047c37f6d9ee1e4506c08f97d9db02706b71dee4a970c23c710bf91f43a1b67509793a7a7780597cf8f01a80f3bde7b9f5e1699caae0ce
6
+ metadata.gz: 37af802a5e9f09fd81935c87003c25049b3aebdd534dec781592efd00426a2906d95eb0e6210ed2c47b76db64941d7e5590d2f7b35c27f5df0eebc0c717382ad
7
+ data.tar.gz: 6538886c89dc87eb99432d43a4b1c6a90dfdd5626e49aef97176c8b21d9a302e2698848d128b044cb0b774b9d470a8f9db6cefb09989d033caaf0eb0f19c0d6b
data/.gitignore CHANGED
@@ -11,10 +11,8 @@ capybara-*.html
11
11
  /InstalledFiles
12
12
  /pkg/
13
13
  /spec/reports/
14
- /test/tmp/
15
- /spec/tmp
16
14
  /test/version_tmp/
17
- /tmp
15
+ **/tmp/*
18
16
  **.orig
19
17
  rerun.txt
20
18
  pickle-email-*.html
@@ -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
 
@@ -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
- if resource_type.to_s == "image" && type.to_s == "upload"
392
+ case
393
+ when resource_type.to_s == "image" && type.to_s == "upload"
393
394
  resource_type = "images"
394
395
  type = nil
395
- elsif resource_type.to_s == "raw" && type.to_s == "upload"
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
@@ -1,4 +1,4 @@
1
1
  # Copyright Cloudinary
2
2
  module Cloudinary
3
- VERSION = "1.1.4"
3
+ VERSION = "1.1.5"
4
4
  end
@@ -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(2)
74
- start_at = Time.now.to_s
75
- sleep(2)
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"]}) == [response["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
@@ -73,8 +73,8 @@ describe Cloudinary::Uploader do
73
73
 
74
74
 
75
75
  it "should support explicit" do
76
- result = Cloudinary::Uploader.explicit("cloudinary", :type=>"twitter_name", :eager=>[{:crop=>"scale", :width=>"2.0"}], :tags => TEST_TAG)
77
- url = Cloudinary::Utils.cloudinary_url("cloudinary", :type=>"twitter_name", :crop=>"scale", :width=>"2.0", :format=>"png", :version=>result["version"])
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
 
@@ -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
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-03-22 00:00:00.000000000 Z
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