paperclip-cloudinary 1.3.1 → 1.3.2

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: e2c4446aa2b6a0704bd424769d7533e058515c3f
4
- data.tar.gz: 9e890898c667652c347dbcee0ba85d9d05d27103
3
+ metadata.gz: 01bdd4e1a7ec7e3aa2deb41d65116aca76444c28
4
+ data.tar.gz: 7755929a5d0a0582caae311b797af7c051129511
5
5
  SHA512:
6
- metadata.gz: 7a2cdc10ee8a707105267f0dbdccee1e1395d085609f84ae22f0c6cbee22fa6224fb31896e4bb6efa843a4c85ce44d661b7c56b4938d54ba27a952b29a2a4138
7
- data.tar.gz: f39c17d00fff9f16dc860aa5d2b7b1c137df4e157a5dd0e29a7e6233e048faad7d86362dd5d676da9e8d83a766be8099a58ecb840c814e8a8f46d6d9c438616b
6
+ metadata.gz: dc12b6186fd4335fb06be4f18da73132abb8fbf6c7fc68db876a2e24c1647699f956895cc8dd79eba6f63846718d2815fea2c68ac8d75232c54c6b067b4da463
7
+ data.tar.gz: 65c6c87dffd0975e9c484b195ebfe251a8ed2b2fd883f79a5e358b47ff9ffb71f7d6b666566d70bc80fc9b557723462bf873208683bf2f08ac3d7c27c96ed9c0
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- paperclip-cloudinary (1.3.1)
4
+ paperclip-cloudinary (1.3.2)
5
5
  cloudinary (~> 1.1)
6
6
 
7
7
  GEM
@@ -35,4 +35,4 @@ DEPENDENCIES
35
35
  rake (~> 10.0)
36
36
 
37
37
  BUNDLED WITH
38
- 1.11.2
38
+ 1.16.0
data/README.md CHANGED
@@ -91,8 +91,7 @@ of options.
91
91
  Cloudinary supports a number of resource types for your attachments, including:
92
92
 
93
93
  * image
94
- * audio
95
- * video
94
+ * video (note: video now also supports audio attachments like `.mp3`)
96
95
  * raw
97
96
 
98
97
  By default, this gem assumes that your resource type is an image, but if
@@ -1,5 +1,5 @@
1
1
  module Paperclip
2
2
  module Cloudinary
3
- VERSION = "1.3.1"
3
+ VERSION = "1.3.2"
4
4
  end
5
5
  end
@@ -32,9 +32,10 @@ module Paperclip
32
32
  options = {}
33
33
  [default_opts, style_opts].each do |opts|
34
34
  options.deep_merge!(opts) do |key, existing_value, new_value|
35
- new_value.try(:call, style_name, self) || new_value
35
+ new_value
36
36
  end
37
37
  end
38
+ execute_lambdas options, style_name, self
38
39
  options.merge! defaults
39
40
  ::Cloudinary::Uploader.upload file, options
40
41
  end
@@ -158,6 +159,16 @@ module Paperclip
158
159
  end
159
160
  end
160
161
 
162
+ def execute_lambdas hash, style_name, attachment
163
+ hash.each do |key, value|
164
+ if value.is_a? Hash
165
+ execute_lambdas value, style_name, attachment
166
+ elsif value.respond_to?(:call)
167
+ hash[key] = value.call(style_name, attachment)
168
+ end
169
+ end
170
+ end
171
+
161
172
  end
162
173
  end
163
174
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: paperclip-cloudinary
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.3.1
4
+ version: 1.3.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Carl Scott
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2017-11-05 00:00:00.000000000 Z
11
+ date: 2018-02-11 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: cloudinary