zara4 1.0.0 → 1.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 77b284dca686af8a3be484e12949a44f4098f95a
|
|
4
|
+
data.tar.gz: 7b24a236af2252b00972dce3a6dfef10c2361c8d
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 7665355c9d874655f44bdb9d5a395b513e54dd246ff0b97aee472dbc47d5e89ee0f7be5065f2eec2502838857b737162f8abce0bf7d5d85899b8b6e551403171
|
|
7
|
+
data.tar.gz: 7023a1ec7872e2373e793e006bd8a6d520d91343695c75d4cff1821526d15b9fb42f3b67c89817f0cff6a8a774f8139ae8aa7c95644246f4f5de411716d478d7
|
data/lib/zara4/api.rb
CHANGED
data/lib/zara4/api/client.rb
CHANGED
|
@@ -33,16 +33,10 @@ module Zara4::API
|
|
|
33
33
|
url = Zara4::API::Communication::Util::url('/v1/image-processing/request')
|
|
34
34
|
|
|
35
35
|
parameters = image_processing_request.generate_form_data
|
|
36
|
-
|
|
37
|
-
headers = {
|
|
38
|
-
'access_token' => @access_token.token
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
print parameters
|
|
36
|
+
parameters['access_token'] = @access_token.token
|
|
42
37
|
|
|
43
38
|
response = self.class.post(url, {
|
|
44
39
|
query: parameters,
|
|
45
|
-
headers: headers,
|
|
46
40
|
detect_mime_type: true
|
|
47
41
|
})
|
|
48
42
|
|
|
@@ -73,8 +67,9 @@ module Zara4::API
|
|
|
73
67
|
url = processed_image.file_urls[0]
|
|
74
68
|
|
|
75
69
|
if @access_token
|
|
76
|
-
url += '?access_token' + @access_token.token
|
|
70
|
+
url += '?access_token=' + @access_token.token
|
|
77
71
|
end
|
|
72
|
+
|
|
78
73
|
|
|
79
74
|
File.open(save_path, "w") do |f|
|
|
80
75
|
IO.copy_stream(open(url), f)
|
|
@@ -84,4 +79,4 @@ module Zara4::API
|
|
|
84
79
|
|
|
85
80
|
|
|
86
81
|
end
|
|
87
|
-
end
|
|
82
|
+
end
|
|
@@ -6,6 +6,7 @@ module Zara4::API::Communication::Authentication
|
|
|
6
6
|
# Acquire an AccessToken using this ApplicationAuthenticator.
|
|
7
7
|
#
|
|
8
8
|
def acquire_access_token
|
|
9
|
+
|
|
9
10
|
grant = Zara4::API::Communication::Grant::ClientCredentialsGrantRequest.new(@client_id, @client_secret, @scopes)
|
|
10
11
|
tokens = grant.get_tokens()
|
|
11
12
|
|
|
@@ -17,4 +18,4 @@ module Zara4::API::Communication::Authentication
|
|
|
17
18
|
|
|
18
19
|
|
|
19
20
|
end
|
|
20
|
-
end
|
|
21
|
+
end
|
|
@@ -11,7 +11,7 @@ module Zara4::API::ImageProcessing
|
|
|
11
11
|
if optimisation_mode != nil
|
|
12
12
|
@optimisation_mode = optimisation_mode
|
|
13
13
|
else
|
|
14
|
-
@optimisation_mode = Zara4::API::ImageProcessing::OptimisationMode::COMPROMISE
|
|
14
|
+
@optimisation_mode = Zara4::API::ImageProcessing::OptimisationMode::COMPROMISE
|
|
15
15
|
end
|
|
16
16
|
|
|
17
17
|
if output_format != nil
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: zara4
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 1.0.
|
|
4
|
+
version: 1.0.1
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Colin Stannard
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2016-
|
|
11
|
+
date: 2016-10-21 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: json
|