cdnconnect-api 0.3.2 → 0.3.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +1 -1
- data/lib/cdnconnect_api.rb +7 -7
- 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: e14f403c44ad1b4147938d544ee7a9f174eaa683
|
4
|
+
data.tar.gz: a1338d951826739fcd1de0bd9696b87f58a279a2
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6ec0d3fe81b41b31d76bea214e7f9586e009b704b3a10534095503154958b44163e8ac129f0d9f21326b8ca4de35c76d1e08d563d62b7e6a7ce6bbdc6527d782
|
7
|
+
data.tar.gz: c4c79851fa5b7540e992111a26a9d35a0a1da8fbd9294f7d39c9d54558742e456c2c1bf68bca626a95098795d330affba2852354202c968351b7cdcd43e9d526
|
data/README.md
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
# CDN Connect API Ruby Client, v0.3.
|
1
|
+
# CDN Connect API Ruby Client, v0.3.3
|
2
2
|
|
3
3
|
CDN Connect makes it easier to manage production assets for teams of developers and designers, all while serving files from a fast content delivery network. Features include image optimization, resizing, cropping, filters, changing output formats, convert to WebP image format, etc. The CDN Connect API Ruby Client makes it easier to upload files and interact with the API with only a few lines of code.
|
4
4
|
|
data/lib/cdnconnect_api.rb
CHANGED
@@ -25,7 +25,7 @@ module CDNConnect
|
|
25
25
|
class APIClient
|
26
26
|
|
27
27
|
@@application_name = 'cdnconnect-api-ruby'
|
28
|
-
@@application_version = '0.3.
|
28
|
+
@@application_version = '0.3.3'
|
29
29
|
@@user_agent = @@application_name + ' v' + @@application_version
|
30
30
|
@@api_host = 'https://api.cdnconnect.com'
|
31
31
|
@@api_version = 'v1'
|
@@ -215,6 +215,7 @@ module CDNConnect
|
|
215
215
|
post_data = build_post_data(:destination_path => destination_path,
|
216
216
|
:destination_file_name => options[:destination_file_name],
|
217
217
|
:queue_processing => options.fetch(:queue_processing, true),
|
218
|
+
:create_upload_url => options.fetch(:create_upload_url, true),
|
218
219
|
:webhook_url => options[:webhook_url],
|
219
220
|
:webhook_format => options[:webhook_format])
|
220
221
|
|
@@ -250,9 +251,6 @@ module CDNConnect
|
|
250
251
|
# put the upload url back in the list
|
251
252
|
# of prefetched urls so it can be reused
|
252
253
|
set_prefetched_upload_url(destination_path, upload_url)
|
253
|
-
|
254
|
-
# take a breath
|
255
|
-
sleep 1.5
|
256
254
|
else
|
257
255
|
# successful upload, clear out the active upload queue
|
258
256
|
# and remove uploaded files from the upload queue
|
@@ -293,7 +291,10 @@ module CDNConnect
|
|
293
291
|
post_data = {}
|
294
292
|
|
295
293
|
# have the API also create the next upload url
|
296
|
-
|
294
|
+
if options[:create_upload_url] == true
|
295
|
+
post_data[:create_upload_url] = 'true'
|
296
|
+
@logger.debug(" - create_upload_url")
|
297
|
+
end
|
297
298
|
|
298
299
|
# the set what the file name will be. By default it will be named the same as
|
299
300
|
# the uploaded file. This will only work for single file uploads.
|
@@ -303,6 +304,7 @@ module CDNConnect
|
|
303
304
|
# will not contain any information about the data uploaded.
|
304
305
|
if options[:queue_processing] == true
|
305
306
|
post_data[:queue_processing] = 'true'
|
307
|
+
@logger.debug(" - queue_processing")
|
306
308
|
end
|
307
309
|
|
308
310
|
# send with the post data the webhook_url if there is one
|
@@ -617,8 +619,6 @@ module CDNConnect
|
|
617
619
|
return response
|
618
620
|
end
|
619
621
|
@logger.error(response.body)
|
620
|
-
# take a breath
|
621
|
-
sleep 1.5
|
622
622
|
i += 1
|
623
623
|
end while i <= 3
|
624
624
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: cdnconnect-api
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.3.
|
4
|
+
version: 0.3.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Adam Bradley
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2013-09-
|
11
|
+
date: 2013-09-24 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: faraday
|