cdnconnect-api 0.4.0 → 0.4.1
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 +4 -4
- data/lib/cdnconnect_api/response.rb +17 -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: 048736280647be2ac635a218c4c4437156d3ed3c
|
4
|
+
data.tar.gz: 79f708fbe5e32f38fe2732f0b5922b236ed28444
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 376f46f9c14d63af90523a65f83a21fe8c71da1884daacc0ccc142725d683cbbd2b6fc25df2601ea0dccc1739700b47c970847b3d3b0f6904defeb71e98b13d7
|
7
|
+
data.tar.gz: cf296d695a7bb02e549bfa5e845a84210e330c157a6a79996bc153dec91d204777f01ce9f702cb89dbab141f30419952d96a23dd9e1549c5d0d4a7e3340be289
|
data/README.md
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
# CDN Connect API Ruby Client, v0.4.
|
1
|
+
# CDN Connect API Ruby Client, v0.4.1
|
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.4.
|
28
|
+
@@application_version = '0.4.1'
|
29
29
|
@@user_agent = @@application_name + ' v' + @@application_version
|
30
30
|
@@api_host = 'https://api.cdnconnect.com'
|
31
31
|
@@api_version = 'v1'
|
@@ -152,15 +152,15 @@ module CDNConnect
|
|
152
152
|
# The name which the uploaded file should be renamed to. By default the file name
|
153
153
|
# will be the same as the file being uploaded. The `destination_file_name` option is
|
154
154
|
# only used for a single file upload, it does not work for multiple file requests.
|
155
|
-
# - <code>queue_processing
|
155
|
+
# - <code>queue_processing</code> -
|
156
156
|
# A true or false value indicating if the processing of the data should be queued or
|
157
|
-
# processed immediately. A response with "
|
157
|
+
# processed immediately. A response with "queue_processing"
|
158
158
|
# will be faster because the resposne doesn't wait on the system to complete
|
159
159
|
# processing the data. However, because an queued processing response does not wait
|
160
160
|
# for the data to complete processing then the response will not contain any information
|
161
161
|
# about the data which was just uploaded. Use queued processing only if you do not
|
162
162
|
# need to know the details of the upload. Additionally you can use the `webhook_url`
|
163
|
-
# to post back the uploads details once it's processed. Default is
|
163
|
+
# to post back the uploads details once it's processed. Default is true.
|
164
164
|
# - <code>:webhook_url</code> -
|
165
165
|
# A URL which the system should `POST` the response to. This works for both immediate
|
166
166
|
# processing or queued processing calls. The data sent to the `webhook_url` will be
|
@@ -23,17 +23,27 @@ module CDNConnect
|
|
23
23
|
# resposne data.
|
24
24
|
class APIResponse
|
25
25
|
|
26
|
-
def initialize(http_response=
|
27
|
-
|
28
|
-
if http_response
|
29
|
-
@
|
30
|
-
@data = nil
|
31
|
-
@body = nil
|
32
|
-
else
|
26
|
+
def initialize(http_response="base_merge")
|
27
|
+
|
28
|
+
if http_response == nil or http_response == ""
|
29
|
+
@http_response = nil
|
33
30
|
@status = 503
|
34
31
|
@data = { "results" => {}, "msgs" => [{"text" => "http_response was nil", "status" => "error"}] }
|
35
32
|
@body = nil
|
33
|
+
|
34
|
+
elsif http_response == "base_merge"
|
35
|
+
@http_response = nil
|
36
|
+
@status = 200
|
37
|
+
@data = { "results" => {}, "msgs" => [] }
|
38
|
+
@body = nil
|
39
|
+
|
40
|
+
else
|
41
|
+
@http_response = http_response
|
42
|
+
@status = http_response.status
|
43
|
+
@data = nil
|
44
|
+
@body = nil
|
36
45
|
end
|
46
|
+
|
37
47
|
return self
|
38
48
|
end
|
39
49
|
|
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.4.
|
4
|
+
version: 0.4.1
|
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-
|
11
|
+
date: 2013-12-05 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: faraday
|