cloudinary 1.0.83 → 1.0.84
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/{CHANGELOG → CHANGELOG.md} +100 -96
- data/lib/cloudinary/version.rb +1 -1
- data/lib/cloudinary/video_helper.rb +7 -25
- data/spec/video_tag_spec.rb +75 -15
- data/spec/video_url_spec.rb +4 -50
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7c79153af87d4d75ce4114bbb80dbfb6ce85a0a7
|
4
|
+
data.tar.gz: 74668b2bf8a870a5c324f961aeb1d533b2fa4fac
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2e40e79acabc3e04dda3dfd09e6c3f92ec4bf510c581aae80993581e4ed06f402dec78aca3475b6f3a2f61b57b795a42a7fc5f3d46d9e5363d5f4ff94d539444
|
7
|
+
data.tar.gz: 4481a71e524ee7645ade6a2f12335ba59c08d522fa6989a146d94cb4f00532f8864973e1db06752c12c7df219e396d873b4404f2ffd1ff43dc30d632dfd32ed4
|
data/{CHANGELOG → CHANGELOG.md}
RENAMED
@@ -1,4 +1,8 @@
|
|
1
|
-
|
1
|
+
# Version 1.0.84 - 2015-03-29
|
2
|
+
* Fixed sources tag url.
|
3
|
+
* Added video thumbnail and video tags to the sample project.
|
4
|
+
* CHANGELOG renamed to CHANGELOG.md
|
5
|
+
# Version 1.0.83 - 2015-03-22
|
2
6
|
* Added Video Support
|
3
7
|
* `cl_video_tag` creates an HTML video tag with optionally inner `source` tags
|
4
8
|
* `cl_video_path` provides a url to the video resource
|
@@ -6,25 +10,25 @@
|
|
6
10
|
* `cl_video_thumbnail_path` provides a url to the video resource's thumbnail
|
7
11
|
* Added `:zoom` transformation parameter
|
8
12
|
* Applied Pull Requests:
|
9
|
-
* Fix image closing tags
|
10
|
-
* Fix callback path.
|
13
|
+
* Fix image closing tags [#144](https://github.com/cloudinary/cloudinary_gem/issues/144)
|
14
|
+
* Fix callback path. [#138](https://github.com/cloudinary/cloudinary_gem/issues/138)
|
11
15
|
* Update Cloudinary's jQuery plugin to v1.0.22.
|
12
16
|
* Update .gitignore file
|
13
17
|
|
14
|
-
|
18
|
+
# Version 1.0.82 - 2015-02-05
|
15
19
|
* Solve problem with CarrierWave integration to newer versions on the mongoid and carrierwave-mongoid gems.
|
16
20
|
* Enable root path for shared CDN:
|
17
21
|
* Modified restriction in utils so that it doesn't fail for root path with shared CDN.
|
18
22
|
* Added Object::present? predicate. Check if Object::present doesn't exist before defining it.
|
19
23
|
* Checking for `defined?(Rails)` is not enough if we want to invoke `Rails.version` etc. It was changed to `defined? Rails::version`.
|
20
24
|
|
21
|
-
|
25
|
+
# Version 1.0.81 - 2015-01-08
|
22
26
|
* CarrierWave - support default_format if format is unknown, support arbitrary format for resource_type raw.
|
23
27
|
|
24
|
-
|
28
|
+
# Version 1.0.80 - 2015-01-01
|
25
29
|
* Support upload_chunked direct upload for large raw files.
|
26
30
|
|
27
|
-
|
31
|
+
# Version 1.0.79 - 2014-12-11
|
28
32
|
* Support folder listing API.
|
29
33
|
* Add support for conditional processing in CarrierWave plugin.
|
30
34
|
* Support tags in upload_large.
|
@@ -34,30 +38,30 @@
|
|
34
38
|
* Support for new domain sharding syntax and secure domain sharding. Support for secure_cdn_subdomain flag.
|
35
39
|
* Update Cloudinary's jQuery plugin to v1.0.21.
|
36
40
|
|
37
|
-
|
41
|
+
# Version 1.0.78 - 2014-11-04
|
38
42
|
* Add app_root method that handled Rails.root, which is a String in old Rails versions.
|
39
|
-
* Issue
|
43
|
+
* Issue [#127](https://github.com/cloudinary/cloudinary_gem/issues/127) - solve cyclical dependency in case cloudinary was included after Rails was initialized.
|
40
44
|
|
41
|
-
|
45
|
+
# Version 1.0.77 - 2014-09-22
|
42
46
|
* Update Cloudinary's jQuery plugin to v1.0.20.
|
43
47
|
* Support invalidation in bulk deletion requests.
|
44
48
|
|
45
|
-
|
49
|
+
# Version 1.0.76 - 2014-08-24
|
46
50
|
* Added supported image types for rake cloudinary:sync_static.
|
47
51
|
|
48
|
-
|
52
|
+
# Version 1.0.75 - 2014-07-30
|
49
53
|
* Don't use Rails' image_tag for repsponsive/hidpi to prevent wrong alt and data URIs.
|
50
54
|
|
51
|
-
|
55
|
+
# Version 1.0.74 - 2014-07-14
|
52
56
|
* Support custom_coordinates in upload and update. Support coordinates in resource details.
|
53
57
|
* Support delete_by_token for direct uploads.
|
54
58
|
* Support shorthand blank for cl_image_tag with responsive/hidpi.
|
55
59
|
* Correctly encode one-level double arrays.
|
56
|
-
* Support non-upload resources in signed_preloaded_image (Issue
|
60
|
+
* Support non-upload resources in signed_preloaded_image (Issue [#117](https://github.com/cloudinary/cloudinary_gem/issues/117)).
|
57
61
|
* Support background removal upload and admin API parameter.
|
58
62
|
* Update Cloudinary's jQuery plugin to v1.0.19.
|
59
63
|
|
60
|
-
|
64
|
+
# Version 1.0.73 - 2014-06-30
|
61
65
|
* Support dpr transformation parameter.
|
62
66
|
* Support automatic dpr (for HiDPI) and automatic width (for responsive).
|
63
67
|
* Accept timestamp parameter in upload method options.
|
@@ -67,24 +71,24 @@
|
|
67
71
|
* Make api_key and api_secret optional in unsigned upload.
|
68
72
|
* Support the case Rails is defined but Rails.root isn't.
|
69
73
|
|
70
|
-
|
74
|
+
# Version 1.0.72 - 2014-04-15
|
71
75
|
* Fixing broken sign_request.
|
72
76
|
|
73
|
-
|
77
|
+
# Version 1.0.71 - 2014-04-15
|
74
78
|
* Upload preset support.
|
75
79
|
* Unsigned upload support.
|
76
80
|
* phash upload parameter support.
|
77
81
|
* Resource listing by start_at support.
|
78
82
|
* Updating to jQuery plugin v1.0.14.
|
79
83
|
|
80
|
-
|
84
|
+
# Version 1.0.70 - 2014-03-25
|
81
85
|
* Support upload_large without public_id.
|
82
86
|
* Remove public_id from method parameters.
|
83
87
|
* Backward compatibility for old upload_large API.
|
84
|
-
* Issue
|
88
|
+
* Issue [#95](https://github.com/cloudinary/cloudinary_gem/issues/95) - exception when using storage_type :private
|
85
89
|
* Updating to jQuery plugin v1.0.13.
|
86
90
|
|
87
|
-
|
91
|
+
# Version 1.0.69 - 2014-02-25
|
88
92
|
* Admin API update method.
|
89
93
|
* Admin API listing by moderation kind and status.
|
90
94
|
* Support moderation status in admin API listing.
|
@@ -93,12 +97,12 @@
|
|
93
97
|
* Allow CloudinaryHelper to be included into standalone classes.
|
94
98
|
* Added support for Sequel models using CarrierWave.
|
95
99
|
|
96
|
-
|
100
|
+
# Version 1.0.68 - 2014-02-16
|
97
101
|
* Support for uploading large raw files.
|
98
102
|
* Correct support for image_tag and image_path override.
|
99
103
|
* Add direction support to Admin API listings.
|
100
104
|
|
101
|
-
|
105
|
+
# Version 1.0.67 - 2014-01-09
|
102
106
|
* Support specifying face coordinates in upload API.
|
103
107
|
* Support specifying context (currently alt and caption) in upload API and returning context in API.
|
104
108
|
* Support specifying allowed image formats in upload API.
|
@@ -106,118 +110,118 @@
|
|
106
110
|
* Send User-Agent header with client library version in API request.
|
107
111
|
* Support for signed-URLs to override restricted dynamic URLs.
|
108
112
|
|
109
|
-
|
113
|
+
# Version 1.0.66 - 2013-11-14
|
110
114
|
* Support overwrite flag in upload
|
111
115
|
* Support tags flag in resources_by_tag
|
112
116
|
* Support for deletion cursor and delete all
|
113
117
|
|
114
|
-
|
118
|
+
# Version 1.0.65 - 2013-11-04
|
115
119
|
* Support for unique_filename upload parameter
|
116
120
|
* Support the color parameter
|
117
121
|
* Support for uploading Pathname
|
118
122
|
* Support for stored files
|
119
123
|
* Updated Cloudinary's jQuery plugin to v1.0.11: Support color parameter
|
120
124
|
|
121
|
-
|
125
|
+
# Version 1.0.64 - 2013-10-17
|
122
126
|
* Extracted upload_tag_params and upload_url from image_upload_tag. Extracted common code to sign_request.
|
123
127
|
* Updated Cloudinary's jQuery plugin to v1.0.10: Binding jQuery file upload events.
|
124
128
|
* Support line_spacing text parameter.
|
125
129
|
* Added code documentation for cl_image_tag.
|
126
130
|
|
127
|
-
|
131
|
+
# Version 1.0.63 - 2013-08-07
|
128
132
|
* Support folder parameter.
|
129
133
|
* Escape non-http public_ids.
|
130
134
|
* Correct escaping of space and '-'.
|
131
135
|
|
132
|
-
|
136
|
+
# Version 1.0.62 - 2013-07-30
|
133
137
|
* Change secure urls to use *res.cloudinary.com.
|
134
138
|
|
135
|
-
|
139
|
+
# Version 1.0.61 - 2013-07-18
|
136
140
|
* Mongoid 4 compatibility fix.
|
137
141
|
* Support raw data URI.
|
138
|
-
* Issue
|
142
|
+
* Issue [#81](https://github.com/cloudinary/cloudinary_gem/issues/81) - Error on bootstrap + rails under Rails 4.
|
139
143
|
* Support admin ping API.
|
140
144
|
* Include updated jQuery plugin.
|
141
145
|
|
142
|
-
|
146
|
+
# Version 1.0.60 - 2013-07-01
|
143
147
|
* Upgrade to latest jQuery file upload.
|
144
148
|
* Support whitelisted S3 URLs in upload.
|
145
149
|
|
146
|
-
|
150
|
+
# Version 1.0.59 - 2013-06-13
|
147
151
|
* Support discard_original_filename.
|
148
152
|
* Support proxy parameter in upload.
|
149
153
|
|
150
|
-
|
154
|
+
# Version 1.0.58 - 2013-05-16
|
151
155
|
* cloudinary_url helper should protect options from modification.
|
152
156
|
* Add jpc jp2 psd to list of support image formats.
|
153
157
|
* Crop mode lfill support.
|
154
158
|
|
155
|
-
|
159
|
+
# Version 1.0.57 - 2013-05-01
|
156
160
|
* Allow my_public_id to be called from versions.
|
157
161
|
* Fix for giving :version parameters to url in version while overriding public_id.
|
158
162
|
|
159
|
-
|
163
|
+
# Version 1.0.56 - 2013-04-24
|
160
164
|
* Support for uploading raw files in direct upload with CarrierWave.
|
161
165
|
* Support overriding stored version.
|
162
166
|
|
163
|
-
|
167
|
+
# Version 1.0.55 - 2013-04-19
|
164
168
|
* Support folders in PreloadedFile.
|
165
169
|
* Allow cloudinary helpers to work directly with CarrierWave uploaders.
|
166
|
-
* Issue
|
170
|
+
* Issue [#70](https://github.com/cloudinary/cloudinary_gem/issues/70) - Return parsed error message for 401,403 and 404 error codes as well.
|
167
171
|
* CarrierWave - allow returning format in dynamic methods.
|
168
172
|
|
169
|
-
|
173
|
+
# Version 1.0.54 - 2013-04-05
|
170
174
|
* Support auto-rename when public_id has random component.
|
171
175
|
|
172
|
-
|
176
|
+
# Version 1.0.53 - 2013-04-04
|
173
177
|
* Fix handling of non-fetch http urls.
|
174
178
|
* Support attachment flag in private download links.
|
175
179
|
|
176
|
-
|
180
|
+
# Version 1.0.52 - 2013-03-29
|
177
181
|
* Support for unsafe transformation update (Admin API).
|
178
182
|
|
179
|
-
|
180
|
-
* Fixing issue
|
181
|
-
* Fixing issue
|
183
|
+
# Version 1.0.51 - 2013-03-28
|
184
|
+
* Fixing issue [#66](https://github.com/cloudinary/cloudinary_gem/issues/66) - folder names are not respected in non-direct uploads.
|
185
|
+
* Fixing issue [#65](https://github.com/cloudinary/cloudinary_gem/issues/65) - allow overwriting existing images when updating preloaded images.
|
182
186
|
* Support ERB in cloudinary.yml.
|
183
187
|
|
184
|
-
|
188
|
+
# Version 1.0.50 - 2013-03-24
|
185
189
|
* Support folders.
|
186
190
|
* Short URLs.
|
187
191
|
* Auto rename of preloaded resources in CarrierWave.
|
188
192
|
|
189
|
-
|
193
|
+
# Version 1.0.49 - 2013-03-21
|
190
194
|
* Support for renaming public_ids.
|
191
195
|
* Safe handling of booleans to prevent issues with Firefox json deserialization.
|
192
196
|
* Uploader tests.
|
193
197
|
|
194
|
-
|
198
|
+
# Version 1.0.48 - 2013-03-20
|
195
199
|
* Add missing require of rest_client.
|
196
200
|
* Support for rails4 sass asset path integration.
|
197
201
|
* Flag to prevent cloudinary from downloading remote urls directly.
|
198
|
-
* Issue
|
202
|
+
* Issue [#61](https://github.com/cloudinary/cloudinary_gem/issues/61) build_upload_params destructively updates options.
|
199
203
|
|
200
|
-
|
204
|
+
# Version 1.0.47 - 2013-03-14
|
201
205
|
* Allow overriding config with nil/false.
|
202
206
|
* Akamai CDN support.
|
203
207
|
|
204
|
-
|
208
|
+
# Version 1.0.46 - 2013-03-10
|
205
209
|
* Support for tags flag in resources listing API.
|
206
210
|
* Initial partial support for Rails 4.
|
207
211
|
|
208
|
-
|
212
|
+
# Version 1.0.45 - 2013-02-28
|
209
213
|
* Ignore blank URI to support empty string in remote_image_url.
|
210
|
-
* Issue
|
214
|
+
* Issue [#48](https://github.com/cloudinary/cloudinary_gem/issues/48) - Allow carrier wave upload to be given to url/image methods.
|
211
215
|
* Support for explode and multi API. Support async and notification, Correctly delete raw resources uploaded via CarrierWave.
|
212
216
|
|
213
|
-
|
217
|
+
# Version 1.0.44 - 2013-02-05
|
214
218
|
* Support new usage API call.
|
215
219
|
* Support image_metadata in upload and API.
|
216
220
|
* Javascript index file for client side processing in jQuery File Upload.
|
217
221
|
* Support use_filename flag.
|
218
222
|
* Added license to the gems specification.
|
219
223
|
|
220
|
-
|
224
|
+
# Version 1.0.43 - 2012-12-18
|
221
225
|
* Support fallback to html border attribute.
|
222
226
|
* Added Google+ Helpers.
|
223
227
|
* Additional Helper Methods.
|
@@ -225,126 +229,126 @@
|
|
225
229
|
* Allow giving pages flag to resource details API.
|
226
230
|
* Support opacity flag.
|
227
231
|
|
228
|
-
|
232
|
+
# Version 1.0.42 - 2012-11-14
|
229
233
|
* Raise CloudinaryException instead of string everywhere.
|
230
234
|
* Support expires_at in private download.
|
231
235
|
* Support info flags directly on upload.
|
232
236
|
|
233
|
-
|
237
|
+
# Version 1.0.41 - 2012-10-28
|
234
238
|
* Allow Cloudinary.config_from_url to be called before Cloudinary.config.
|
235
239
|
* Normalize file extensions in carrier wave upload.
|
236
240
|
* Support keep_original in resource deletion.
|
237
241
|
* Support delete_resources_by_tag, Support for transformation flags.
|
238
242
|
|
239
|
-
|
243
|
+
# Version 1.0.40 - 2012-10-10
|
240
244
|
* Carrierwave - downcase wanted format.
|
241
245
|
|
242
|
-
|
246
|
+
# Version 1.0.39 - 2012-10-08
|
243
247
|
* Support max_results in resource drilldown.
|
244
248
|
* Change delete_resources_by_prefix to match other signatures.
|
245
249
|
* Add Cloudinary.config_from_url to use CLOUDINARY_URL even if not from env.
|
246
250
|
|
247
|
-
|
251
|
+
# Version 1.0.38 - 2012-10-02
|
248
252
|
* Support additional parameters (border, color space, delay).
|
249
253
|
* Admin API enhancements.
|
250
254
|
* Carrierwave improvments for authenticated imaged.
|
251
255
|
* Allow URI to be used in cloudinary_url, minor fixes.
|
252
256
|
|
253
|
-
|
257
|
+
# Version 1.0.37 - 2012-09-12
|
254
258
|
* Support for customer headers.
|
255
259
|
* Support for type in tags.
|
256
260
|
* Support for tags in explicit.
|
257
261
|
|
258
|
-
|
262
|
+
# Version 1.0.36 - 2012-09-09
|
259
263
|
* Support storage type in CarrierWave.
|
260
264
|
* Check if resource exists.
|
261
265
|
* Public ID should never start with a digit
|
262
266
|
* Authenticated resources fixes.
|
263
267
|
|
264
|
-
|
268
|
+
# Version 1.0.35 - 2012-08-27
|
265
269
|
* Fix migrator to support retrieve returning a URL.
|
266
270
|
|
267
|
-
|
271
|
+
# Version 1.0.34 - 2012-08-27
|
268
272
|
* Extract PreloadedFile for easy handling of files preloaded by the Cloudinary's jQuery library.
|
269
273
|
* Don't pass width/height to html in case of fit/limit or angle are used.
|
270
274
|
|
271
|
-
|
275
|
+
# Version 1.0.33 - 2012-08-05
|
272
276
|
* Allow specifying angle as array.
|
273
277
|
* Allow specifying array of transformations directly.
|
274
278
|
* Allow using string keys in transformations.
|
275
279
|
* Support for Cloudinary new admin API.
|
276
280
|
* Support for signed authenticated URLs.
|
277
281
|
|
278
|
-
|
282
|
+
# Version 1.0.32 - 2012-07-26
|
279
283
|
* Fix typo in eager support for the explicit API.
|
280
284
|
* Better handling of escaping in URL parameters.
|
281
285
|
* Support passing transformation to all versions (process_all_versions).
|
282
286
|
* Support private mode (make_private).
|
283
287
|
|
284
|
-
|
288
|
+
# Version 1.0.31 - 2013-07-18
|
285
289
|
* Support configurable CNAME.
|
286
290
|
* Support for explicitly creating remote resources.
|
287
291
|
|
288
|
-
|
292
|
+
# Version 1.0.30 - 2012-07-12
|
289
293
|
* Force order of including in javascript for asset pipeline.
|
290
294
|
* Support for ZIP download link.
|
291
295
|
|
292
|
-
|
296
|
+
# Version 1.0.29 - 2012-07-08
|
293
297
|
* Page and density parameters.
|
294
298
|
* data-uri upload support.
|
295
299
|
* Allow CarrierWave enable_processing.
|
296
300
|
* Default rake task to spec & ignore Gemfile.lock.
|
297
301
|
|
298
|
-
|
302
|
+
# Version 1.0.28 - 2012-07-03
|
299
303
|
* default_public_id for CarrrierWave and JS asset packaging
|
300
304
|
|
301
|
-
|
305
|
+
# Version 1.0.27 - 2012-06-26
|
302
306
|
* Underlay support.
|
303
307
|
* Backup flag.
|
304
308
|
* Private resource download link.
|
305
309
|
* Secure flag fix.
|
306
310
|
* cloud_name param in API calls.
|
307
311
|
|
308
|
-
|
312
|
+
# Version 1.0.26 - 2012-06-08
|
309
313
|
* Fix issue 13 - rails-admin conflict.
|
310
314
|
|
311
|
-
|
315
|
+
# Version 1.0.25 - 2012-06-05
|
312
316
|
* Issues 18 (mongoid) and 19 (mount_on).
|
313
317
|
|
314
|
-
|
318
|
+
# Version 1.0.24 - 2012-05-17
|
315
319
|
* Renaming effects parameter and add numberic effect parameter.
|
316
320
|
|
317
|
-
|
321
|
+
# Version 1.0.23 - 2012-05-14
|
318
322
|
* Support fetch format and effects parameters.
|
319
323
|
|
320
|
-
|
324
|
+
# Version 1.0.21 - 2012-05-10
|
321
325
|
* Custom dynamic CarrierWave process method support.
|
322
326
|
|
323
|
-
|
327
|
+
# Version 1.0.21 - 2012-05-09
|
324
328
|
* New paramters (angle, overlay).
|
325
329
|
* Text creation.
|
326
330
|
* Fix issue 16.
|
327
331
|
|
328
|
-
|
332
|
+
# Version 1.0.20 - 2012-05-06
|
329
333
|
* Heroku single environment variable.
|
330
334
|
|
331
|
-
|
335
|
+
# Version 1.0.18 - 2012-05-02
|
332
336
|
* Sanitize filename for carrierwave to allow special characters in public_id.
|
333
337
|
* Allow preloaded image with empty format (for raw files).
|
334
338
|
|
335
|
-
|
339
|
+
# Version 1.0.17 - 2012-04-28
|
336
340
|
* Fix issue 12 - tags didn't work in newer versions of carrierwave. Validate tags are not used in versions.
|
337
341
|
|
338
|
-
|
342
|
+
# Version 1.0.16 - 2012-04-25
|
339
343
|
* Background color support.
|
340
344
|
* Add full_public_id method for accessing versioned public_id. Handle unversioned public_ids from DB.
|
341
345
|
* Removing options passed to image_path from cl_image_path.
|
342
346
|
* Better handling of public_id from stored value.
|
343
347
|
* Major CarrierWave plugin cleanup. Fix issue 10. Allow overriding public_id with dynamic public_id. Allow overriding delete_remote? to prevent deleting resources from Cloudinary.
|
344
|
-
* Fix issue
|
348
|
+
* Fix issue [#11](https://github.com/cloudinary/cloudinary_gem/issues/11) - nil input to image_tag throws exception.
|
345
349
|
* Fix docs, fix sass require.
|
346
350
|
|
347
|
-
|
351
|
+
# Version 1.0.15 - 2012-04-23
|
348
352
|
* Avoiding id attributes on hidden fields.
|
349
353
|
* Skip hidden tags for empty values.
|
350
354
|
* cl_form_tag: avoiding id attributes on hidden fields.
|
@@ -354,55 +358,55 @@
|
|
354
358
|
* Support cloudinary-url function in sass.
|
355
359
|
* Cleaner depdency check for sass and sass-rails.
|
356
360
|
|
357
|
-
|
361
|
+
# Version 1.0.14 - 2012-04-23
|
358
362
|
* Remove depenedency on active support.
|
359
363
|
* Allow non-Rails use of cloudinary.yml.
|
360
364
|
* Fix update of local url in carrir wave.
|
361
365
|
* Allow supplying DELETE_MISSING flag in static rake task.
|
362
366
|
* Disable recreate_versions! as it is not needed.
|
363
367
|
|
364
|
-
|
368
|
+
# Version 1.0.13 - 2012-04-22
|
365
369
|
* Default image support.
|
366
370
|
|
367
|
-
|
371
|
+
# Version 1.0.12 - 2012-04-19
|
368
372
|
* Fixing resize_to_pad to be resize_and_pad.
|
369
373
|
|
370
|
-
|
374
|
+
# Version 1.0.11 - 2012-04-19
|
371
375
|
* Better config initialization.
|
372
376
|
* Fix bug when non-static resource is requested and a static resource existing with the same name.
|
373
377
|
* Gravatar support.
|
374
378
|
|
375
|
-
|
379
|
+
# Version 1.0.10 - 2012-04-18
|
376
380
|
* Initial tests. Size option fix.
|
377
381
|
* Better rails dependency support.
|
378
382
|
* First version of cloudinary_js integration including file upload.
|
379
383
|
|
380
|
-
|
384
|
+
# Version 1.0.9 - 2012-04-16
|
381
385
|
* Support chained transformations.
|
382
386
|
|
383
|
-
|
387
|
+
# Version 1.0.8 - 2012-04-15
|
384
388
|
* Support subdomain in CDN according to public id crc32.
|
385
389
|
|
386
|
-
|
387
|
-
* Issue
|
390
|
+
# Version 1.0.7 - 2012-04-12
|
391
|
+
* Issue [#2](https://github.com/cloudinary/cloudinary_gem/issues/2): Adding support to Mongoid and fixing to_json issue.
|
388
392
|
|
389
|
-
|
393
|
+
# Version 1.0.6 - 2012-04-11
|
390
394
|
* Adding cl_form_tag and fixing old and non rails compatibliltiy issues.
|
391
395
|
|
392
|
-
|
396
|
+
# Version 1.0.5 - 2012-04-10
|
393
397
|
* Fixing radius parameter.
|
394
398
|
|
395
|
-
|
399
|
+
# Version 1.0.4 - 2012-04-04
|
396
400
|
* Static assets: progress printing in sync task, whitelist of image extensions.
|
397
401
|
|
398
|
-
|
402
|
+
# Version 1.0.3 - 2012-04-02
|
399
403
|
* Assets no longer include paths. Allow passing kind in upload and destroy.
|
400
404
|
* Better defaults for type which allow working with fetch images.
|
401
405
|
* Restore eager format fix.
|
402
406
|
* Add radius support.
|
403
407
|
* Fix default handling of local images in enhanced image_tag.
|
404
408
|
|
405
|
-
|
409
|
+
# Version 1.0.2 - 2012-04-02
|
406
410
|
* Support for passing x & y parameters to crop.
|
407
411
|
* fetch_image_tag and escaping support.
|
408
412
|
* Static file support.
|
@@ -410,11 +414,11 @@
|
|
410
414
|
* Handle case of file going into trash and back into folder before delete.
|
411
415
|
* Readded migrator. Reduce concurrency for old versions of ruby.
|
412
416
|
|
413
|
-
|
417
|
+
# Version 1.0.1 - 2012-03-12
|
414
418
|
* Replace Array() with safer method.
|
415
419
|
* Support passing format as part of the eager transformation.
|
416
420
|
|
417
|
-
|
421
|
+
# Version 1.0.0 - 2012-02-22
|
418
422
|
* Initial public version.
|
419
423
|
|
420
424
|
|
data/lib/cloudinary/version.rb
CHANGED
@@ -1,8 +1,9 @@
|
|
1
|
-
|
1
|
+
unless Hash.respond_to?(:deep_symbolize_keys)
|
2
|
+
# required prior to Rails 4
|
2
3
|
require 'cloudinary/active_support/core_ext/hash/keys'
|
3
4
|
end
|
4
5
|
module CloudinaryHelper
|
5
|
-
include ActionView::
|
6
|
+
include ActionView::Helpers::CaptureHelper
|
6
7
|
DEFAULT_POSTER_OPTIONS = { :format => 'jpg', :resource_type => 'video' }
|
7
8
|
DEFAULT_SOURCE_TYPES = %w(webm mp4 ogv)
|
8
9
|
DEFAULT_VIDEO_OPTIONS = { :resource_type => 'video' }
|
@@ -26,7 +27,7 @@ module CloudinaryHelper
|
|
26
27
|
def cl_video_tag(source, options = {}, &block)
|
27
28
|
source = strip_known_ext(source)
|
28
29
|
video_attributes = [:autoplay,:controls,:loop,:muted,:poster, :preload]
|
29
|
-
options =
|
30
|
+
options = DEFAULT_VIDEO_OPTIONS.merge(options).deep_symbolize_keys
|
30
31
|
|
31
32
|
options[:source_types] ||= DEFAULT_SOURCE_TYPES
|
32
33
|
video_attributes.keep_if{ |key, _| options.has_key?(key)} # required prior to Rails 4.x
|
@@ -56,11 +57,11 @@ module CloudinaryHelper
|
|
56
57
|
fallback = (capture(&block) if block_given?) || options.delete(:fallback_content)
|
57
58
|
|
58
59
|
if source_types.size > 1
|
59
|
-
cloudinary_tag(source, options) do |
|
60
|
+
cloudinary_tag(source, options) do |_source, tag_options|
|
60
61
|
content_tag('video', tag_options.merge(video_options)) do
|
61
62
|
source_tags = source_types.map do |type|
|
62
63
|
transformation = source_transformation[type.to_sym] || {}
|
63
|
-
cloudinary_tag("#{source}.#{type}",
|
64
|
+
cloudinary_tag("#{source}.#{type}", options.merge(transformation)) do |url, _tag_options|
|
64
65
|
mime_type = "video/#{(type == 'ogv' ? 'ogg' : type)}"
|
65
66
|
tag("source", :src => url, :type => mime_type)
|
66
67
|
end
|
@@ -72,7 +73,7 @@ module CloudinaryHelper
|
|
72
73
|
else
|
73
74
|
transformation = source_transformation[source_types.first.to_sym] || {}
|
74
75
|
video_options[:src] = cl_video_path("#{source}.#{source_types.first.to_sym}", transformation.merge(options))
|
75
|
-
cloudinary_tag(source, options) do |
|
76
|
+
cloudinary_tag(source, options) do |_source, tag_options|
|
76
77
|
content_tag('video', fallback, tag_options.merge(video_options))
|
77
78
|
end
|
78
79
|
end
|
@@ -99,25 +100,6 @@ module CloudinaryHelper
|
|
99
100
|
name.sub(/\.(#{DEFAULT_SOURCE_TYPES.join("|")})$/, '')
|
100
101
|
end
|
101
102
|
|
102
|
-
def safe_join(array, sep=$,)
|
103
|
-
sep = ERB::Util.unwrapped_html_escape(sep)
|
104
|
-
array.flatten.map! { |i| ERB::Util.unwrapped_html_escape(i) }.join(sep).html_safe
|
105
|
-
end unless method_defined?( :safe_join)
|
106
|
-
|
107
|
-
# HTML escapes strings but doesn't wrap them with an ActiveSupport::SafeBuffer.
|
108
|
-
# This method is not for public consumption! Seriously!
|
109
|
-
def unwrapped_html_escape(s) # :nodoc:
|
110
|
-
s = s.to_s
|
111
|
-
if s.html_safe?
|
112
|
-
s
|
113
|
-
else
|
114
|
-
s.gsub(HTML_ESCAPE_REGEXP, HTML_ESCAPE)
|
115
|
-
end
|
116
|
-
end unless method_defined?( :unwrapped_html_escape)
|
117
|
-
|
118
|
-
HTML_ESCAPE = { '&' => '&', '>' => '>', '<' => '<', '"' => '"', "'" => ''' } unless defined?( HTML_ESCAPE)
|
119
|
-
HTML_ESCAPE_REGEXP = /[&"'><]/ unless defined?(HTML_ESCAPE_REGEXP)
|
120
|
-
|
121
103
|
end
|
122
104
|
|
123
105
|
|
data/spec/video_tag_spec.rb
CHANGED
@@ -4,8 +4,6 @@ require 'cloudinary'
|
|
4
4
|
require 'action_view'
|
5
5
|
require 'cloudinary/helper'
|
6
6
|
require 'rails/version'
|
7
|
-
include CloudinaryHelper
|
8
|
-
include ActionView::Helpers::AssetTagHelper
|
9
7
|
|
10
8
|
if Rails::VERSION::MAJOR == 3
|
11
9
|
def config
|
@@ -15,7 +13,6 @@ if Rails::VERSION::MAJOR == 3
|
|
15
13
|
@controller ||={}
|
16
14
|
end
|
17
15
|
end
|
18
|
-
|
19
16
|
describe CloudinaryHelper do
|
20
17
|
before(:each) do
|
21
18
|
Cloudinary.config do |config|
|
@@ -29,24 +26,29 @@ describe CloudinaryHelper do
|
|
29
26
|
config.api_secret = "b"
|
30
27
|
end
|
31
28
|
end
|
32
|
-
|
29
|
+
|
30
|
+
let(:helper) {
|
31
|
+
# Test the helper in the context it runs in in production
|
32
|
+
ActionView::Base.send :include, CloudinaryHelper
|
33
|
+
ActionView::Base.new
|
34
|
+
}
|
35
|
+
let(:root_path) { "http://res.cloudinary.com/test123" }
|
36
|
+
let(:upload_path) { "#{root_path}/video/upload" }
|
33
37
|
|
34
38
|
describe 'cl_video_tag' do
|
35
|
-
let(:basic_options) { { :cloud_name => "test123"
|
39
|
+
let(:basic_options) { { :cloud_name => "test123"} }
|
36
40
|
let(:options) { basic_options }
|
37
|
-
let(:test_tag) {
|
38
|
-
TestTag.new helper.cl_video_tag("movie", options) }
|
41
|
+
let(:test_tag) { TestTag.new helper.cl_video_tag("movie", options) }
|
39
42
|
context "when options include video tag attributes" do
|
40
43
|
let(:options) { basic_options.merge({ :autoplay => true,
|
41
44
|
:controls => true,
|
42
45
|
:loop => true,
|
43
46
|
:muted => true,
|
44
47
|
:preload => true }) }
|
45
|
-
it "should
|
48
|
+
it "should support video tag parameters" do
|
46
49
|
expect(test_tag.attributes.keys).to include("autoplay", "controls", "loop", "muted", "preload")
|
47
50
|
end
|
48
51
|
end
|
49
|
-
{ :autoplay => true, :controls => false, :loop => false, :muted => true, :preload => true }
|
50
52
|
|
51
53
|
context 'when given transformations' do
|
52
54
|
let(:options) {
|
@@ -54,6 +56,9 @@ describe CloudinaryHelper do
|
|
54
56
|
:source_types => "mp4",
|
55
57
|
:html_height => "100",
|
56
58
|
:html_width => "200",
|
59
|
+
:crop => :scale,
|
60
|
+
:height => "200",
|
61
|
+
:width => "400",
|
57
62
|
:video_codec => { :codec => 'h264' },
|
58
63
|
:audio_codec => 'acc',
|
59
64
|
:start_offset => 3) }
|
@@ -62,6 +67,11 @@ describe CloudinaryHelper do
|
|
62
67
|
expect(test_tag["src"]).to include("ac_acc")
|
63
68
|
expect(test_tag["src"]).to include("vc_h264")
|
64
69
|
expect(test_tag["src"]).to include("so_3")
|
70
|
+
expect(test_tag["src"]).to include("w_400")
|
71
|
+
expect(test_tag["src"]).to include("h_200")
|
72
|
+
end
|
73
|
+
it 'should have the correct tag height' do
|
74
|
+
expect(test_tag["height"]).to eq("100")
|
65
75
|
end
|
66
76
|
end
|
67
77
|
|
@@ -70,9 +80,7 @@ describe CloudinaryHelper do
|
|
70
80
|
let(:options) { basic_options.merge(:source_types => "mp4") }
|
71
81
|
it "should create a video tag" do
|
72
82
|
expect(test_tag.name).to eq("video")
|
73
|
-
expect(test_tag
|
74
|
-
'width' => "200px",
|
75
|
-
'src' => "http://res.cloudinary.com/test123/video/upload/movie.mp4" })
|
83
|
+
expect(test_tag['src']).to eq( "#{upload_path}/movie.mp4")
|
76
84
|
end
|
77
85
|
it "should not have a `type` attribute" do
|
78
86
|
expect(test_tag.attributes).not_to include("type")
|
@@ -88,6 +96,7 @@ describe CloudinaryHelper do
|
|
88
96
|
expect(test_tag.children.length).to eq(3)
|
89
97
|
expect(test_tag.children[0].name).to eq("source")
|
90
98
|
expect(test_tag.children[1].name).to eq("source")
|
99
|
+
expect(test_tag.children.map{|c| c['src']}).to all( include("video/upload"))
|
91
100
|
end
|
92
101
|
it "should order the source tags according to the order of the source_types" do
|
93
102
|
expect(test_tag.children[0][:type]).to eq("video/mp4")
|
@@ -100,7 +109,7 @@ describe CloudinaryHelper do
|
|
100
109
|
describe ":poster" do
|
101
110
|
context "when poster is not provided" do
|
102
111
|
it "should default to jpg with the video transformation" do
|
103
|
-
expect(test_tag[:poster]).to eq(cl_video_thumbnail_path("movie", { :format => 'jpg' }))
|
112
|
+
expect(test_tag[:poster]).to eq(helper.cl_video_thumbnail_path("movie", { :format => 'jpg' }))
|
104
113
|
end
|
105
114
|
end
|
106
115
|
|
@@ -115,12 +124,12 @@ describe CloudinaryHelper do
|
|
115
124
|
context "when poster is a hash" do
|
116
125
|
let(:options) { basic_options.merge(:poster => { :gravity => "north" }) }
|
117
126
|
it "should include a poster attribute with the given options" do
|
118
|
-
expect(test_tag[:poster]).to eq("
|
127
|
+
expect(test_tag[:poster]).to eq("#{upload_path}/g_north/movie.jpg")
|
119
128
|
end
|
120
129
|
context "when a public id is provided" do
|
121
130
|
let(:options) { basic_options.merge(:poster => { :public_id => 'myposter.jpg', :gravity => "north" }) }
|
122
131
|
it "should include a poster attribute with an image path and the given options" do
|
123
|
-
expect(test_tag[:poster]).to eq("
|
132
|
+
expect(test_tag[:poster]).to eq("#{root_path}/image/upload/g_north/myposter.jpg")
|
124
133
|
end
|
125
134
|
|
126
135
|
|
@@ -180,6 +189,57 @@ describe CloudinaryHelper do
|
|
180
189
|
expect(test_tag.attributes.keys).not_to include("width", "height")
|
181
190
|
end
|
182
191
|
end
|
192
|
+
context "when `:crop => 'limit'`" do
|
193
|
+
let(:options) { basic_options.merge(:crop => 'limit') }
|
194
|
+
it "should not include a width and height attributes" do
|
195
|
+
expect(test_tag.attributes.keys).not_to include("width", "height")
|
196
|
+
end
|
197
|
+
end
|
198
|
+
end
|
199
|
+
end
|
200
|
+
end
|
201
|
+
describe 'cl_video_thumbnail_path' do
|
202
|
+
let(:source) { "movie_id" }
|
203
|
+
let(:options) { {} }
|
204
|
+
let(:path) { helper.cl_video_thumbnail_path(source, options) }
|
205
|
+
it "should generate a cloudinary URI to the video thumbnail" do
|
206
|
+
expect(path).to eq("#{upload_path}/movie_id.jpg")
|
207
|
+
end
|
208
|
+
end
|
209
|
+
describe 'cl_video_thumbnail_tag' do
|
210
|
+
let(:source) { "movie_id" }
|
211
|
+
let(:options) { {} }
|
212
|
+
let(:result_tag) { TestTag.new(helper.cl_video_thumbnail_tag(source, options)) }
|
213
|
+
describe ":resource_type" do
|
214
|
+
context "'video' (default)" do
|
215
|
+
let(:options) { { :resource_type => 'video' } }
|
216
|
+
it "should have a 'video/upload' path" do
|
217
|
+
expect(result_tag.name).to eq('img')
|
218
|
+
expect(result_tag[:src]).to include("video/upload")
|
219
|
+
end
|
220
|
+
it "should generate an img tag with file extension `jpg`" do
|
221
|
+
expect(result_tag[:src]).to end_with("movie_id.jpg")
|
222
|
+
end
|
223
|
+
end
|
224
|
+
context "'image'" do
|
225
|
+
let(:options) { { :resource_type => 'image' } }
|
226
|
+
it "should have a 'image/upload' path" do
|
227
|
+
expect(result_tag.name).to eq('img')
|
228
|
+
expect(result_tag[:src]).to include("image/upload")
|
229
|
+
end
|
230
|
+
it "should generate an img tag with file extension `jpg`" do
|
231
|
+
expect(result_tag[:src]).to end_with("movie_id.jpg")
|
232
|
+
end
|
233
|
+
end
|
234
|
+
context "'raw'" do
|
235
|
+
let(:options) { { :resource_type => 'raw' } }
|
236
|
+
it "should have a 'raw/upload' path" do
|
237
|
+
expect(result_tag.name).to eq('img')
|
238
|
+
expect(result_tag[:src]).to include("raw/upload")
|
239
|
+
end
|
240
|
+
it "should generate an img tag with file extension `jpg`" do
|
241
|
+
expect(result_tag[:src]).to end_with("movie_id.jpg")
|
242
|
+
end
|
183
243
|
end
|
184
244
|
end
|
185
245
|
end
|
data/spec/video_url_spec.rb
CHANGED
@@ -5,8 +5,6 @@ require 'action_view'
|
|
5
5
|
require 'cloudinary/helper'
|
6
6
|
require 'action_view/test_case'
|
7
7
|
|
8
|
-
include CloudinaryHelper
|
9
|
-
|
10
8
|
describe Cloudinary::Utils do
|
11
9
|
before(:each) do
|
12
10
|
Cloudinary.config do |config|
|
@@ -78,7 +76,7 @@ describe Cloudinary::Utils do
|
|
78
76
|
end
|
79
77
|
|
80
78
|
describe ":offset" do
|
81
|
-
|
79
|
+
let(:test_url) { Cloudinary::Utils.cloudinary_url("video_id", options) }
|
82
80
|
[
|
83
81
|
['string range', 'so_2.66,eo_3.21', '2.66..3.21'],
|
84
82
|
['array', 'so_2.66,eo_3.21', [2.66, 3.21]],
|
@@ -91,8 +89,8 @@ describe Cloudinary::Utils do
|
|
91
89
|
context "when provided with #{name} #{range}" do
|
92
90
|
let(:options) { { :resource_type => 'video', :offset => range } }
|
93
91
|
it "should produce a range transformation in the format of #{url_param}" do
|
94
|
-
expect {
|
95
|
-
transformation = /([^\/]*)\/video_id$/.match(
|
92
|
+
expect { test_url }.to change { options }.to({})
|
93
|
+
transformation = /([^\/]*)\/video_id$/.match(test_url)[1]
|
96
94
|
# we can't rely on the order of the parameters so we sort them before comparing
|
97
95
|
expect(transformation.split(',').sort.reverse.join(',')).to eq(url_param)
|
98
96
|
end
|
@@ -121,49 +119,5 @@ describe Cloudinary::Utils do
|
|
121
119
|
end
|
122
120
|
end
|
123
121
|
end
|
124
|
-
|
125
|
-
let(:source) { "movie_id" }
|
126
|
-
let(:options) { {} }
|
127
|
-
let(:path) { cl_video_thumbnail_path(source, options) }
|
128
|
-
it "should generate a cloudinary URI to the video thumbnail" do
|
129
|
-
expect(path).to eq("#{upload_path}/movie_id.jpg")
|
130
|
-
end
|
131
|
-
end
|
132
|
-
describe 'cl_video_thumbnail_tag' do
|
133
|
-
let(:source) { "movie_id" }
|
134
|
-
let(:options) { {} }
|
135
|
-
let(:result_tag) { TestTag.new(cl_video_thumbnail_tag(source, options)) }
|
136
|
-
describe ":resource_type" do
|
137
|
-
context "'video' (default)" do
|
138
|
-
let(:options) { { :resource_type => 'video' } }
|
139
|
-
it "should have a 'video/upload' path" do
|
140
|
-
expect(result_tag.name).to eq('img')
|
141
|
-
expect(result_tag[:src]).to include("video/upload")
|
142
|
-
end
|
143
|
-
it "should generate an img tag with file extension `jpg`" do
|
144
|
-
expect(result_tag[:src]).to end_with("movie_id.jpg")
|
145
|
-
end
|
146
|
-
end
|
147
|
-
context "'image'" do
|
148
|
-
let(:options) { { :resource_type => 'image' } }
|
149
|
-
it "should have a 'image/upload' path" do
|
150
|
-
expect(result_tag.name).to eq('img')
|
151
|
-
expect(result_tag[:src]).to include("image/upload")
|
152
|
-
end
|
153
|
-
it "should generate an img tag with file extension `jpg`" do
|
154
|
-
expect(result_tag[:src]).to end_with("movie_id.jpg")
|
155
|
-
end
|
156
|
-
end
|
157
|
-
context "'raw'" do
|
158
|
-
let(:options) { { :resource_type => 'raw' } }
|
159
|
-
it "should have a 'raw/upload' path" do
|
160
|
-
expect(result_tag.name).to eq('img')
|
161
|
-
expect(result_tag[:src]).to include("raw/upload")
|
162
|
-
end
|
163
|
-
it "should generate an img tag with file extension `jpg`" do
|
164
|
-
expect(result_tag[:src]).to end_with("movie_id.jpg")
|
165
|
-
end
|
166
|
-
end
|
167
|
-
end
|
168
|
-
end
|
122
|
+
|
169
123
|
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.
|
4
|
+
version: 1.0.84
|
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: 2015-03-
|
13
|
+
date: 2015-03-29 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: aws_cf_signer
|
@@ -107,7 +107,7 @@ extra_rdoc_files: []
|
|
107
107
|
files:
|
108
108
|
- ".gitignore"
|
109
109
|
- ".rspec"
|
110
|
-
- CHANGELOG
|
110
|
+
- CHANGELOG.md
|
111
111
|
- Gemfile
|
112
112
|
- README.md
|
113
113
|
- Rakefile
|