transloadit 2.0.0 → 3.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/.github/workflows/ci.yml +23 -0
- data/.standard.yml +0 -0
- data/CHANGELOG.md +70 -55
- data/Gemfile +1 -1
- data/README.md +162 -86
- data/Rakefile +12 -17
- data/examples/README.md +94 -55
- data/examples/basic/audio-concat-transcoder.rb +29 -19
- data/examples/basic/audio-transcoder.rb +32 -22
- data/examples/basic/image-transcoder.rb +22 -17
- data/examples/basic/main.rb +31 -37
- data/examples/basic/media-transcoder.rb +2 -7
- data/lib/transloadit/api_model.rb +13 -13
- data/lib/transloadit/assembly.rb +27 -24
- data/lib/transloadit/exception.rb +2 -4
- data/lib/transloadit/request.rb +58 -52
- data/lib/transloadit/response/assembly.rb +14 -13
- data/lib/transloadit/response.rb +10 -10
- data/lib/transloadit/step.rb +13 -13
- data/lib/transloadit/template.rb +5 -5
- data/lib/transloadit/version.rb +1 -1
- data/lib/transloadit.rb +24 -24
- data/test/fixtures/cassettes/cancel_assembly.yml +3 -3
- data/test/fixtures/cassettes/create_template.yml +1 -1
- data/test/fixtures/cassettes/delete_template.yml +1 -1
- data/test/fixtures/cassettes/fetch_assemblies.yml +1 -1
- data/test/fixtures/cassettes/fetch_assembly_aborted.yml +3 -3
- data/test/fixtures/cassettes/fetch_assembly_errors.yml +3 -3
- data/test/fixtures/cassettes/fetch_assembly_executing.yml +3 -3
- data/test/fixtures/cassettes/fetch_assembly_notifications.yml +1 -1
- data/test/fixtures/cassettes/fetch_assembly_ok.yml +6 -6
- data/test/fixtures/cassettes/fetch_assembly_uploading.yml +3 -3
- data/test/fixtures/cassettes/fetch_billing.yml +1 -1
- data/test/fixtures/cassettes/fetch_root.yml +3 -3
- data/test/fixtures/cassettes/fetch_template.yml +1 -1
- data/test/fixtures/cassettes/fetch_templates.yml +1 -1
- data/test/fixtures/cassettes/post_assembly.yml +2 -2
- data/test/fixtures/cassettes/rate_limit_fail.yml +3 -3
- data/test/fixtures/cassettes/rate_limit_succeed.yml +4 -4
- data/test/fixtures/cassettes/replay_assembly.yml +2 -2
- data/test/fixtures/cassettes/replay_assembly_notification.yml +1 -1
- data/test/fixtures/cassettes/submit_assembly.yml +3 -3
- data/test/fixtures/cassettes/update_template.yml +1 -1
- data/test/test_helper.rb +10 -10
- data/test/unit/test_transloadit.rb +66 -66
- data/test/unit/transloadit/test_api.rb +35 -33
- data/test/unit/transloadit/test_assembly.rb +148 -112
- data/test/unit/transloadit/test_request.rb +41 -42
- data/test/unit/transloadit/test_response.rb +76 -76
- data/test/unit/transloadit/test_step.rb +52 -52
- data/test/unit/transloadit/test_template.rb +49 -54
- data/transloadit.gemspec +25 -26
- metadata +25 -41
- data/.travis.yml +0 -13
data/lib/transloadit.rb
CHANGED
@@ -1,19 +1,19 @@
|
|
1
|
-
require
|
2
|
-
require
|
1
|
+
require "multi_json"
|
2
|
+
require "date"
|
3
3
|
|
4
4
|
#
|
5
5
|
# Implements the Transloadit REST API in Ruby. Check the {file:README.md README}
|
6
6
|
# for usage instructions.
|
7
7
|
#
|
8
8
|
class Transloadit
|
9
|
-
autoload :ApiModel,
|
10
|
-
autoload :Assembly,
|
11
|
-
autoload :Exception,
|
12
|
-
autoload :Request,
|
13
|
-
autoload :Response,
|
14
|
-
autoload :Step,
|
15
|
-
autoload :Template,
|
16
|
-
autoload :VERSION,
|
9
|
+
autoload :ApiModel, "transloadit/api_model"
|
10
|
+
autoload :Assembly, "transloadit/assembly"
|
11
|
+
autoload :Exception, "transloadit/exception"
|
12
|
+
autoload :Request, "transloadit/request"
|
13
|
+
autoload :Response, "transloadit/response"
|
14
|
+
autoload :Step, "transloadit/step"
|
15
|
+
autoload :Template, "transloadit/template"
|
16
|
+
autoload :VERSION, "transloadit/version"
|
17
17
|
|
18
18
|
# @return [String] your Transloadit auth key
|
19
19
|
attr_accessor :key
|
@@ -39,8 +39,8 @@ class Transloadit
|
|
39
39
|
# signing requests (optional)
|
40
40
|
#
|
41
41
|
def initialize(options = {})
|
42
|
-
self.key
|
43
|
-
self.secret
|
42
|
+
self.key = options[:key]
|
43
|
+
self.secret = options[:secret]
|
44
44
|
self.duration = options[:duration] || 5 * 60
|
45
45
|
self.max_size = options[:max_size]
|
46
46
|
|
@@ -53,7 +53,7 @@ class Transloadit
|
|
53
53
|
# @param [String] name the name to give the step
|
54
54
|
# @param [String] robot the robot to use in this step (e.g., '/image/resize')
|
55
55
|
# @param [Hash] options a hash of options to customize the robot's
|
56
|
-
# operation; see the {online documentation}[
|
56
|
+
# operation; see the {online documentation}[https://transloadit.com/docs/building-assembly-instructions]
|
57
57
|
# for robot-specific options
|
58
58
|
# @return [Step] the created Step
|
59
59
|
#
|
@@ -66,7 +66,7 @@ class Transloadit
|
|
66
66
|
#
|
67
67
|
# @param [Hash] options additional parameters to send with the assembly
|
68
68
|
# submission; for a full list of parameters, see the official
|
69
|
-
# documentation on {templates}[
|
69
|
+
# documentation on {templates}[https://transloadit.com/docs/templates].
|
70
70
|
# @option options [Step, Array<Step>] :steps the steps to perform in this
|
71
71
|
# assembly
|
72
72
|
# @option options [String] :notify_url A URL to be POSTed when the assembly
|
@@ -100,26 +100,26 @@ class Transloadit
|
|
100
100
|
#
|
101
101
|
def bill(month = Date.today.month, year = Date.today.year)
|
102
102
|
# convert month to 2 digit format
|
103
|
-
month = format
|
103
|
+
month = format "%02d", month
|
104
104
|
path = "bill/#{year}-#{month}"
|
105
105
|
|
106
|
-
Transloadit::Request.new(path,
|
106
|
+
Transloadit::Request.new(path, secret).get({auth: to_hash})
|
107
107
|
end
|
108
108
|
|
109
109
|
#
|
110
110
|
# @return [String] a human-readable version of the Transloadit.
|
111
111
|
#
|
112
112
|
def inspect
|
113
|
-
|
113
|
+
to_hash.inspect
|
114
114
|
end
|
115
115
|
|
116
116
|
#
|
117
117
|
# @return [Hash] a Transloadit-compatible Hash of the instance's contents
|
118
118
|
#
|
119
119
|
def to_hash
|
120
|
-
result = {
|
121
|
-
result.update(:
|
122
|
-
result.update(:
|
120
|
+
result = {key: key}
|
121
|
+
result.update(max_size: max_size) unless max_size.nil?
|
122
|
+
result.update(expires: _generate_expiry) unless secret.nil?
|
123
123
|
result
|
124
124
|
end
|
125
125
|
|
@@ -127,7 +127,7 @@ class Transloadit
|
|
127
127
|
# @return [String] JSON-encoded String containing the object's hash contents
|
128
128
|
#
|
129
129
|
def to_json
|
130
|
-
MultiJson.dump(
|
130
|
+
MultiJson.dump(to_hash)
|
131
131
|
end
|
132
132
|
|
133
133
|
private
|
@@ -136,8 +136,8 @@ class Transloadit
|
|
136
136
|
# Raises an ArgumentError if no {#key} has been assigned.
|
137
137
|
#
|
138
138
|
def _ensure_key_provided
|
139
|
-
unless
|
140
|
-
raise ArgumentError,
|
139
|
+
unless key
|
140
|
+
raise ArgumentError, "an authentication key must be provided"
|
141
141
|
end
|
142
142
|
end
|
143
143
|
|
@@ -148,6 +148,6 @@ class Transloadit
|
|
148
148
|
# @return [String] an API-compatible timestamp
|
149
149
|
#
|
150
150
|
def _generate_expiry
|
151
|
-
(Time.now +
|
151
|
+
(Time.now + duration).utc.strftime("%Y/%m/%d %H:%M:%S+00:00")
|
152
152
|
end
|
153
153
|
end
|
@@ -2,7 +2,7 @@
|
|
2
2
|
http_interactions:
|
3
3
|
- request:
|
4
4
|
method: delete
|
5
|
-
uri:
|
5
|
+
uri: https://api2.jane.transloadit.com/assemblies/76fe5df1c93a0a530f3e583805cf98b4
|
6
6
|
body:
|
7
7
|
encoding: US-ASCII
|
8
8
|
string: ''
|
@@ -30,9 +30,9 @@ http_interactions:
|
|
30
30
|
- chunked
|
31
31
|
body:
|
32
32
|
encoding: UTF-8
|
33
|
-
string: ! '{"ok":"ASSEMBLY_CANCELED","message":"The assembly was canceled.","assembly_id":"76fe5df1c93a0a530f3e583805cf98b4","
|
33
|
+
string: ! '{"ok":"ASSEMBLY_CANCELED","message":"The assembly was canceled.","assembly_id":"76fe5df1c93a0a530f3e583805cf98b4","assembly_ssl_url":"https://api2.jane.transloadit.com/assemblies/76fe5df1c93a0a530f3e583805cf98b4","bytes_received":95355,"bytes_expected":95355,"client_agent":"Transloadit
|
34
34
|
Ruby SDK 0.1.2","client_ip":"74.95.29.209","client_referer":null,"start_date":"2011/02/21
|
35
|
-
15:54:17 GMT","upload_duration":0.394,"execution_duration":0.006,"fields":{},"uploads":[{"id":"0767b43537389a177a1be96ab06e8a4b","name":"test.png","basename":"test","ext":"png","size":95010,"mime":"image/jpeg","type":"image","field":"file_0","original_id":"0767b43537389a177a1be96ab06e8a4b","
|
35
|
+
15:54:17 GMT","upload_duration":0.394,"execution_duration":0.006,"fields":{},"uploads":[{"id":"0767b43537389a177a1be96ab06e8a4b","name":"test.png","basename":"test","ext":"png","size":95010,"mime":"image/jpeg","type":"image","field":"file_0","original_id":"0767b43537389a177a1be96ab06e8a4b","ssl_url":"https://tmp.jane.transloadit.com/upload/bf7801cb21fb96cbafd403467244d125.png","meta":{"width":640,"height":480,"date_recorded":null,"date_file_created":null,"date_file_modified":"2011/02/21
|
36
36
|
15:54:17 GMT","title":null,"description":null,"location":null,"city":null,"state":null,"country":null,"country_code":null,"keywords":"Photo
|
37
37
|
Booth","aperture":null,"exposure_compensation":null,"exposure_mode":null,"exposure_time":null,"flash":null,"focal_length":null,"f_number":null,"iso":null,"light_value":null,"metering_mode":null,"shutter_speed":null,"white_balance":null,"device_name":null,"device_vendor":null,"device_software":null,"latitude":null,"longitude":null,"frame_count":null}}],"results":{}}'
|
38
38
|
http_version: '1.1'
|
@@ -2,7 +2,7 @@
|
|
2
2
|
http_interactions:
|
3
3
|
- request:
|
4
4
|
method: post
|
5
|
-
uri:
|
5
|
+
uri: https://api2.transloadit.com/templates
|
6
6
|
body:
|
7
7
|
encoding: UTF-8
|
8
8
|
string: params=%7B%22auth%22%3A%7B%22key%22%3A%22%22%7D%2C%22name%22%3A%22foo%22%2C%22template%22%3A%7B%22key%22%3A%22value%22%7D%7D
|
@@ -2,7 +2,7 @@
|
|
2
2
|
http_interactions:
|
3
3
|
- request:
|
4
4
|
method: get
|
5
|
-
uri:
|
5
|
+
uri: https://api2.transloadit.com/assemblies?params=%7B%22auth%22:%7B%22key%22:%22%22%7D%7D
|
6
6
|
body:
|
7
7
|
encoding: US-ASCII
|
8
8
|
string: ''
|
@@ -2,7 +2,7 @@
|
|
2
2
|
http_interactions:
|
3
3
|
- request:
|
4
4
|
method: get
|
5
|
-
uri:
|
5
|
+
uri: https://api2.jane.transloadit.com/assemblies/76fe5df1c93a0a530f3e583805cf98b4
|
6
6
|
body:
|
7
7
|
encoding: US-ASCII
|
8
8
|
string: ''
|
@@ -28,9 +28,9 @@ http_interactions:
|
|
28
28
|
- chunked
|
29
29
|
body:
|
30
30
|
encoding: UTF-8
|
31
|
-
string: ! '{"ok":"REQUEST_ABORTED","message":"The upload connection was closed or timed out before receiving all data.","assembly_id":"76fe5df1c93a0a530f3e583805cf98b4","
|
31
|
+
string: ! '{"ok":"REQUEST_ABORTED","message":"The upload connection was closed or timed out before receiving all data.","assembly_id":"76fe5df1c93a0a530f3e583805cf98b4","assembly_ssl_url":"https://api2.jane.transloadit.com/assemblies/76fe5df1c93a0a530f3e583805cf98b4","bytes_received":95355,"bytes_expected":95355,"client_agent":"Transloadit
|
32
32
|
Ruby SDK 0.1.2","client_ip":"74.95.29.209","client_referer":null,"start_date":"2011/02/21
|
33
|
-
15:54:17 GMT","upload_duration":0.394,"execution_duration":0.006,"fields":{},"uploads":[{"id":"0767b43537389a177a1be96ab06e8a4b","name":"test.png","basename":"test","ext":"png","size":95010,"mime":"image/jpeg","type":"image","field":"file_0","original_id":"0767b43537389a177a1be96ab06e8a4b","
|
33
|
+
15:54:17 GMT","upload_duration":0.394,"execution_duration":0.006,"fields":{},"uploads":[{"id":"0767b43537389a177a1be96ab06e8a4b","name":"test.png","basename":"test","ext":"png","size":95010,"mime":"image/jpeg","type":"image","field":"file_0","original_id":"0767b43537389a177a1be96ab06e8a4b","ssl_url":"https://tmp.jane.transloadit.com/upload/bf7801cb21fb96cbafd403467244d125.png","meta":{"width":640,"height":480,"date_recorded":null,"date_file_created":null,"date_file_modified":"2011/02/21
|
34
34
|
15:54:17 GMT","title":null,"description":null,"location":null,"city":null,"state":null,"country":null,"country_code":null,"keywords":"Photo
|
35
35
|
Booth","aperture":null,"exposure_compensation":null,"exposure_mode":null,"exposure_time":null,"flash":null,"focal_length":null,"f_number":null,"iso":null,"light_value":null,"metering_mode":null,"shutter_speed":null,"white_balance":null,"device_name":null,"device_vendor":null,"device_software":null,"latitude":null,"longitude":null,"frame_count":null}}],"results":{}}'
|
36
36
|
http_version: '1.1'
|
@@ -2,7 +2,7 @@
|
|
2
2
|
http_interactions:
|
3
3
|
- request:
|
4
4
|
method: get
|
5
|
-
uri:
|
5
|
+
uri: https://api2.jane.transloadit.com/assemblies/76fe5df1c93a0a530f3e583805cf98b4
|
6
6
|
body:
|
7
7
|
encoding: US-ASCII
|
8
8
|
string: ''
|
@@ -28,9 +28,9 @@ http_interactions:
|
|
28
28
|
- chunked
|
29
29
|
body:
|
30
30
|
encoding: UTF-8
|
31
|
-
string: ! '{"ok":"ASSEMBLY_CANCELED","message":"The assembly is still in the process of being uploaded.","error": "INVALID_FORM_DATA", "assembly_id":"76fe5df1c93a0a530f3e583805cf98b4","
|
31
|
+
string: ! '{"ok":"ASSEMBLY_CANCELED","message":"The assembly is still in the process of being uploaded.","error": "INVALID_FORM_DATA", "assembly_id":"76fe5df1c93a0a530f3e583805cf98b4","assembly_ssl_url":"https://api2.jane.transloadit.com/assemblies/76fe5df1c93a0a530f3e583805cf98b4","bytes_received":95355,"bytes_expected":95355,"client_agent":"Transloadit
|
32
32
|
Ruby SDK 0.1.2","client_ip":"74.95.29.209","client_referer":null,"start_date":"2011/02/21
|
33
|
-
15:54:17 GMT","upload_duration":0.394,"execution_duration":0.006,"fields":{},"uploads":[{"id":"0767b43537389a177a1be96ab06e8a4b","name":"test.png","basename":"test","ext":"png","size":95010,"mime":"image/jpeg","type":"image","field":"file_0","original_id":"0767b43537389a177a1be96ab06e8a4b","
|
33
|
+
15:54:17 GMT","upload_duration":0.394,"execution_duration":0.006,"fields":{},"uploads":[{"id":"0767b43537389a177a1be96ab06e8a4b","name":"test.png","basename":"test","ext":"png","size":95010,"mime":"image/jpeg","type":"image","field":"file_0","original_id":"0767b43537389a177a1be96ab06e8a4b","ssl_url":"https://tmp.jane.transloadit.com/upload/bf7801cb21fb96cbafd403467244d125.png","meta":{"width":640,"height":480,"date_recorded":null,"date_file_created":null,"date_file_modified":"2011/02/21
|
34
34
|
15:54:17 GMT","title":null,"description":null,"location":null,"city":null,"state":null,"country":null,"country_code":null,"keywords":"Photo
|
35
35
|
Booth","aperture":null,"exposure_compensation":null,"exposure_mode":null,"exposure_time":null,"flash":null,"focal_length":null,"f_number":null,"iso":null,"light_value":null,"metering_mode":null,"shutter_speed":null,"white_balance":null,"device_name":null,"device_vendor":null,"device_software":null,"latitude":null,"longitude":null,"frame_count":null}}],"results":{}}'
|
36
36
|
http_version: '1.1'
|
@@ -2,7 +2,7 @@
|
|
2
2
|
http_interactions:
|
3
3
|
- request:
|
4
4
|
method: get
|
5
|
-
uri:
|
5
|
+
uri: https://api2.jane.transloadit.com/assemblies/76fe5df1c93a0a530f3e583805cf98b4
|
6
6
|
body:
|
7
7
|
encoding: US-ASCII
|
8
8
|
string: ''
|
@@ -28,9 +28,9 @@ http_interactions:
|
|
28
28
|
- chunked
|
29
29
|
body:
|
30
30
|
encoding: UTF-8
|
31
|
-
string: ! '{"ok":"ASSEMBLY_EXECUTING","message":"The assembly is currently being executed.","assembly_id":"76fe5df1c93a0a530f3e583805cf98b4","
|
31
|
+
string: ! '{"ok":"ASSEMBLY_EXECUTING","message":"The assembly is currently being executed.","assembly_id":"76fe5df1c93a0a530f3e583805cf98b4","assembly_ssl_url":"https://api2.jane.transloadit.com/assemblies/76fe5df1c93a0a530f3e583805cf98b4","bytes_received":95355,"bytes_expected":95355,"client_agent":"Transloadit
|
32
32
|
Ruby SDK 0.1.2","client_ip":"74.95.29.209","client_referer":null,"start_date":"2011/02/21
|
33
|
-
15:54:17 GMT","upload_duration":0.394,"execution_duration":0.006,"fields":{},"uploads":[{"id":"0767b43537389a177a1be96ab06e8a4b","name":"test.png","basename":"test","ext":"png","size":95010,"mime":"image/jpeg","type":"image","field":"file_0","original_id":"0767b43537389a177a1be96ab06e8a4b","
|
33
|
+
15:54:17 GMT","upload_duration":0.394,"execution_duration":0.006,"fields":{},"uploads":[{"id":"0767b43537389a177a1be96ab06e8a4b","name":"test.png","basename":"test","ext":"png","size":95010,"mime":"image/jpeg","type":"image","field":"file_0","original_id":"0767b43537389a177a1be96ab06e8a4b","ssl_url":"https://tmp.jane.transloadit.com/upload/bf7801cb21fb96cbafd403467244d125.png","meta":{"width":640,"height":480,"date_recorded":null,"date_file_created":null,"date_file_modified":"2011/02/21
|
34
34
|
15:54:17 GMT","title":null,"description":null,"location":null,"city":null,"state":null,"country":null,"country_code":null,"keywords":"Photo
|
35
35
|
Booth","aperture":null,"exposure_compensation":null,"exposure_mode":null,"exposure_time":null,"flash":null,"focal_length":null,"f_number":null,"iso":null,"light_value":null,"metering_mode":null,"shutter_speed":null,"white_balance":null,"device_name":null,"device_vendor":null,"device_software":null,"latitude":null,"longitude":null,"frame_count":null}}],"results":{}}'
|
36
36
|
http_version: '1.1'
|
@@ -2,7 +2,7 @@
|
|
2
2
|
http_interactions:
|
3
3
|
- request:
|
4
4
|
method: get
|
5
|
-
uri:
|
5
|
+
uri: https://api2.transloadit.com/assembly_notifications?params=%7B%22auth%22:%7B%22key%22:%22%22%7D%7D
|
6
6
|
body:
|
7
7
|
encoding: US-ASCII
|
8
8
|
string: ''
|
@@ -2,7 +2,7 @@
|
|
2
2
|
http_interactions:
|
3
3
|
- request:
|
4
4
|
method: get
|
5
|
-
uri:
|
5
|
+
uri: https://api2.transloadit.com/assemblies/76fe5df1c93a0a530f3e583805cf98b4
|
6
6
|
body:
|
7
7
|
encoding: US-ASCII
|
8
8
|
string: ''
|
@@ -29,16 +29,16 @@ http_interactions:
|
|
29
29
|
body:
|
30
30
|
encoding: UTF-8
|
31
31
|
string: ! '{"ok":"ASSEMBLY_COMPLETED","message":"The assembly was successfully
|
32
|
-
completed.","assembly_id":"76fe5df1c93a0a530f3e583805cf98b4","
|
32
|
+
completed.","assembly_id":"76fe5df1c93a0a530f3e583805cf98b4","assembly_ssl_url":"https://api2.jane.transloadit.com/assemblies/76fe5df1c93a0a530f3e583805cf98b4","bytes_received":95355,"bytes_expected":95355,"client_agent":"Transloadit
|
33
33
|
Ruby SDK 0.1.2","client_ip":"74.95.29.209","client_referer":null,"start_date":"2011/02/21
|
34
|
-
15:54:17 GMT","upload_duration":0.394,"execution_duration":0.006,"fields":{},"uploads":[{"id":"0767b43537389a177a1be96ab06e8a4b","name":"test.png","basename":"test","ext":"png","size":95010,"mime":"image/jpeg","type":"image","field":"file_0","original_id":"0767b43537389a177a1be96ab06e8a4b","
|
34
|
+
15:54:17 GMT","upload_duration":0.394,"execution_duration":0.006,"fields":{},"uploads":[{"id":"0767b43537389a177a1be96ab06e8a4b","name":"test.png","basename":"test","ext":"png","size":95010,"mime":"image/jpeg","type":"image","field":"file_0","original_id":"0767b43537389a177a1be96ab06e8a4b","ssl_url":"https://tmp.jane.transloadit.com/upload/bf7801cb21fb96cbafd403467244d125.png","meta":{"width":640,"height":480,"date_recorded":null,"date_file_created":null,"date_file_modified":"2011/02/21
|
35
35
|
15:54:17 GMT","title":null,"description":null,"location":null,"city":null,"state":null,"country":null,"country_code":null,"keywords":"Photo
|
36
36
|
Booth","aperture":null,"exposure_compensation":null,"exposure_mode":null,"exposure_time":null,"flash":null,"focal_length":null,"f_number":null,"iso":null,"light_value":null,"metering_mode":null,"shutter_speed":null,"white_balance":null,"device_name":null,"device_vendor":null,"device_software":null,"latitude":null,"longitude":null,"frame_count":null}}],"results":{}}'
|
37
37
|
http_version: '1.1'
|
38
38
|
recorded_at: Fri, 08 Mar 2013 15:13:10 GMT
|
39
39
|
- request:
|
40
40
|
method: get
|
41
|
-
uri:
|
41
|
+
uri: https://api2.jane.transloadit.com/assemblies/76fe5df1c93a0a530f3e583805cf98b4
|
42
42
|
body:
|
43
43
|
encoding: US-ASCII
|
44
44
|
string: ''
|
@@ -65,9 +65,9 @@ http_interactions:
|
|
65
65
|
body:
|
66
66
|
encoding: UTF-8
|
67
67
|
string: ! '{"ok":"ASSEMBLY_COMPLETED","message":"The assembly was successfully
|
68
|
-
completed.","assembly_id":"76fe5df1c93a0a530f3e583805cf98b4","
|
68
|
+
completed.","assembly_id":"76fe5df1c93a0a530f3e583805cf98b4","assembly_ssl_url":"https://api2.jane.transloadit.com/assemblies/76fe5df1c93a0a530f3e583805cf98b4","bytes_received":95355,"bytes_expected":95355,"client_agent":"Transloadit
|
69
69
|
Ruby SDK 0.1.2","client_ip":"74.95.29.209","client_referer":null,"start_date":"2011/02/21
|
70
|
-
15:54:17 GMT","upload_duration":0.394,"execution_duration":0.006,"fields":{},"uploads":[{"id":"0767b43537389a177a1be96ab06e8a4b","name":"test.png","basename":"test","ext":"png","size":95010,"mime":"image/jpeg","type":"image","field":"file_0","original_id":"0767b43537389a177a1be96ab06e8a4b","
|
70
|
+
15:54:17 GMT","upload_duration":0.394,"execution_duration":0.006,"fields":{},"uploads":[{"id":"0767b43537389a177a1be96ab06e8a4b","name":"test.png","basename":"test","ext":"png","size":95010,"mime":"image/jpeg","type":"image","field":"file_0","original_id":"0767b43537389a177a1be96ab06e8a4b","ssl_url":"https://tmp.jane.transloadit.com/upload/bf7801cb21fb96cbafd403467244d125.png","meta":{"width":640,"height":480,"date_recorded":null,"date_file_created":null,"date_file_modified":"2011/02/21
|
71
71
|
15:54:17 GMT","title":null,"description":null,"location":null,"city":null,"state":null,"country":null,"country_code":null,"keywords":"Photo
|
72
72
|
Booth","aperture":null,"exposure_compensation":null,"exposure_mode":null,"exposure_time":null,"flash":null,"focal_length":null,"f_number":null,"iso":null,"light_value":null,"metering_mode":null,"shutter_speed":null,"white_balance":null,"device_name":null,"device_vendor":null,"device_software":null,"latitude":null,"longitude":null,"frame_count":null}}],"results":{}}'
|
73
73
|
http_version: '1.1'
|
@@ -2,7 +2,7 @@
|
|
2
2
|
http_interactions:
|
3
3
|
- request:
|
4
4
|
method: get
|
5
|
-
uri:
|
5
|
+
uri: https://api2.jane.transloadit.com/assemblies/76fe5df1c93a0a530f3e583805cf98b4
|
6
6
|
body:
|
7
7
|
encoding: US-ASCII
|
8
8
|
string: ''
|
@@ -28,9 +28,9 @@ http_interactions:
|
|
28
28
|
- chunked
|
29
29
|
body:
|
30
30
|
encoding: UTF-8
|
31
|
-
string: ! '{"ok":"ASSEMBLY_UPLOADING","message":"The assembly is still in the process of being uploaded.","assembly_id":"76fe5df1c93a0a530f3e583805cf98b4","
|
31
|
+
string: ! '{"ok":"ASSEMBLY_UPLOADING","message":"The assembly is still in the process of being uploaded.","assembly_id":"76fe5df1c93a0a530f3e583805cf98b4","assembly_ssl_url":"https://api2.jane.transloadit.com/assemblies/76fe5df1c93a0a530f3e583805cf98b4","bytes_received":95355,"bytes_expected":95355,"client_agent":"Transloadit
|
32
32
|
Ruby SDK 0.1.2","client_ip":"74.95.29.209","client_referer":null,"start_date":"2011/02/21
|
33
|
-
15:54:17 GMT","upload_duration":0.394,"execution_duration":0.006,"fields":{},"uploads":[{"id":"0767b43537389a177a1be96ab06e8a4b","name":"test.png","basename":"test","ext":"png","size":95010,"mime":"image/jpeg","type":"image","field":"file_0","original_id":"0767b43537389a177a1be96ab06e8a4b","
|
33
|
+
15:54:17 GMT","upload_duration":0.394,"execution_duration":0.006,"fields":{},"uploads":[{"id":"0767b43537389a177a1be96ab06e8a4b","name":"test.png","basename":"test","ext":"png","size":95010,"mime":"image/jpeg","type":"image","field":"file_0","original_id":"0767b43537389a177a1be96ab06e8a4b","ssl_url":"https://tmp.jane.transloadit.com/upload/bf7801cb21fb96cbafd403467244d125.png","meta":{"width":640,"height":480,"date_recorded":null,"date_file_created":null,"date_file_modified":"2011/02/21
|
34
34
|
15:54:17 GMT","title":null,"description":null,"location":null,"city":null,"state":null,"country":null,"country_code":null,"keywords":"Photo
|
35
35
|
Booth","aperture":null,"exposure_compensation":null,"exposure_mode":null,"exposure_time":null,"flash":null,"focal_length":null,"f_number":null,"iso":null,"light_value":null,"metering_mode":null,"shutter_speed":null,"white_balance":null,"device_name":null,"device_vendor":null,"device_software":null,"latitude":null,"longitude":null,"frame_count":null}}],"results":{}}'
|
36
36
|
http_version: '1.1'
|
@@ -2,7 +2,7 @@
|
|
2
2
|
http_interactions:
|
3
3
|
- request:
|
4
4
|
method: get
|
5
|
-
uri:
|
5
|
+
uri: https://api2.transloadit.com/bill/2016-09?params=%7B%22auth%22:%7B%22key%22:%22%22%7D%7D
|
6
6
|
body:
|
7
7
|
encoding: US-ASCII
|
8
8
|
string: ''
|
@@ -2,7 +2,7 @@
|
|
2
2
|
http_interactions:
|
3
3
|
- request:
|
4
4
|
method: get
|
5
|
-
uri:
|
5
|
+
uri: https://api2.transloadit.com
|
6
6
|
body:
|
7
7
|
encoding: US-ASCII
|
8
8
|
string: ''
|
@@ -37,7 +37,7 @@ http_interactions:
|
|
37
37
|
recorded_at: Fri, 08 Mar 2013 15:13:10 GMT
|
38
38
|
- request:
|
39
39
|
method: get
|
40
|
-
uri:
|
40
|
+
uri: https://api2.transloadit.com/?params=%7B%22params%22:%7B%22foo%22:%22bar%22%7D%7D
|
41
41
|
body:
|
42
42
|
encoding: US-ASCII
|
43
43
|
string: ''
|
@@ -72,7 +72,7 @@ http_interactions:
|
|
72
72
|
recorded_at: Fri, 08 Mar 2013 15:13:10 GMT
|
73
73
|
- request:
|
74
74
|
method: get
|
75
|
-
uri:
|
75
|
+
uri: https://api2.transloadit.com/?params=%7B%22params%22:%7B%22foo%22:%22bar%22%7D%7D&signature=78f291e3038e3eeb82d9f79e11a68fe7b858ee97
|
76
76
|
body:
|
77
77
|
encoding: US-ASCII
|
78
78
|
string: ''
|
@@ -2,7 +2,7 @@
|
|
2
2
|
http_interactions:
|
3
3
|
- request:
|
4
4
|
method: get
|
5
|
-
uri:
|
5
|
+
uri: https://api2.transloadit.com/templates/76fe5df1c93a0a530f3e583805cf98b4?params=%7B%22auth%22:%7B%22key%22:%22%22%7D%7D
|
6
6
|
body:
|
7
7
|
encoding: US-ASCII
|
8
8
|
string: ''
|
@@ -2,7 +2,7 @@
|
|
2
2
|
http_interactions:
|
3
3
|
- request:
|
4
4
|
method: get
|
5
|
-
uri:
|
5
|
+
uri: https://api2.transloadit.com/templates?params=%7B%22auth%22:%7B%22key%22:%22%22%7D%7D
|
6
6
|
body:
|
7
7
|
encoding: US-ASCII
|
8
8
|
string: ''
|
@@ -2,7 +2,7 @@
|
|
2
2
|
http_interactions:
|
3
3
|
- request:
|
4
4
|
method: post
|
5
|
-
uri:
|
5
|
+
uri: https://api2.transloadit.com/assemblies
|
6
6
|
body:
|
7
7
|
encoding: UTF-8
|
8
8
|
string: params=%7B%22auth%22%3A%7B%22key%22%3A%22%22%2C%22expires%22%3A%222011%2F02%2F21%2023%3A15%3A43%2B00%3A00%22%7D%2C%22steps%22%3A%7B%22encode%22%3A%7B%22robot%22%3A%22%2Fvideo%2Fencode%22%7D%7D%7D&signature=d1a856e3d04103da448a512070139d3e721594cc
|
@@ -37,7 +37,7 @@ http_interactions:
|
|
37
37
|
body:
|
38
38
|
encoding: UTF-8
|
39
39
|
string: ! '{"ok":"ASSEMBLY_COMPLETED","message":"The assembly was successfully
|
40
|
-
completed.","assembly_id":"2a4cb778995be35ffe5fcda3c01e4267","
|
40
|
+
completed.","assembly_id":"2a4cb778995be35ffe5fcda3c01e4267","assembly_ssl_url":"https://api2.jane.transloadit.com/assemblies/2a4cb778995be35ffe5fcda3c01e4267","bytes_received":278,"bytes_expected":278,"client_agent":"Transloadit
|
41
41
|
Ruby SDK 0.1.2","client_ip":"74.95.29.209","client_referer":null,"start_date":"2011/02/21
|
42
42
|
23:15:33 GMT","upload_duration":0.094,"execution_duration":0,"fields":{},"uploads":[],"results":{}}'
|
43
43
|
http_version: '1.1'
|
@@ -2,7 +2,7 @@
|
|
2
2
|
http_interactions:
|
3
3
|
- request:
|
4
4
|
method: post
|
5
|
-
uri:
|
5
|
+
uri: https://api2.transloadit.com/assemblies
|
6
6
|
body:
|
7
7
|
encoding: UTF-8
|
8
8
|
string: params=%7B%22steps%22%3A%7B%22a479db2c601661d8f914caf9cf258c0b%22%3A%7B%22robot%22%3A%22%2Fvideo%2Fthumbs%22%7D%7D%2C%22redirect_url%22%3A%22http%3A%2F%2Ffoo.bar%2F%22%2C%22auth%22%3A%7B%22key%22%3A%22%22%7D%2C%22file_0%22%3A%22%23%3CFile%3A0x00000100c63738%3E%22%7D
|
@@ -36,7 +36,7 @@ http_interactions:
|
|
36
36
|
recorded_at: Fri, 08 Mar 2013 15:13:10 GMT
|
37
37
|
- request:
|
38
38
|
method: post
|
39
|
-
uri:
|
39
|
+
uri: https://api2.transloadit.com/assemblies
|
40
40
|
body:
|
41
41
|
encoding: UTF-8
|
42
42
|
string: params=%7B%22steps%22%3A%7B%22a479db2c601661d8f914caf9cf258c0b%22%3A%7B%22robot%22%3A%22%2Fvideo%2Fthumbs%22%7D%7D%2C%22redirect_url%22%3A%22http%3A%2F%2Ffoo.bar%2F%22%2C%22auth%22%3A%7B%22key%22%3A%22%22%7D%2C%22file_0%22%3A%22%23%3CFile%3A0x00000100c63738%3E%22%7D
|
@@ -70,7 +70,7 @@ http_interactions:
|
|
70
70
|
recorded_at: Fri, 08 Mar 2013 15:13:10 GMT
|
71
71
|
- request:
|
72
72
|
method: post
|
73
|
-
uri:
|
73
|
+
uri: https://api2.transloadit.com/assemblies
|
74
74
|
body:
|
75
75
|
encoding: UTF-8
|
76
76
|
string: params=%7B%22steps%22%3A%7B%22a479db2c601661d8f914caf9cf258c0b%22%3A%7B%22robot%22%3A%22%2Fvideo%2Fthumbs%22%7D%7D%2C%22redirect_url%22%3A%22http%3A%2F%2Ffoo.bar%2F%22%2C%22auth%22%3A%7B%22key%22%3A%22%22%7D%2C%22file_0%22%3A%22%23%3CFile%3A0x00000100c63738%3E%22%7D
|
@@ -2,7 +2,7 @@
|
|
2
2
|
http_interactions:
|
3
3
|
- request:
|
4
4
|
method: post
|
5
|
-
uri:
|
5
|
+
uri: https://api2.transloadit.com/assemblies
|
6
6
|
body:
|
7
7
|
encoding: UTF-8
|
8
8
|
string: params=%7B%22steps%22%3A%7B%22a479db2c601661d8f914caf9cf258c0b%22%3A%7B%22robot%22%3A%22%2Fvideo%2Fthumbs%22%7D%7D%2C%22redirect_url%22%3A%22http%3A%2F%2Ffoo.bar%2F%22%2C%22auth%22%3A%7B%22key%22%3A%22%22%7D%2C%22file_0%22%3A%22%23%3CFile%3A0x00000100c63738%3E%22%7D
|
@@ -36,7 +36,7 @@ http_interactions:
|
|
36
36
|
recorded_at: Fri, 08 Mar 2013 15:13:10 GMT
|
37
37
|
- request:
|
38
38
|
method: post
|
39
|
-
uri:
|
39
|
+
uri: https://api2.transloadit.com/assemblies
|
40
40
|
body:
|
41
41
|
encoding: UTF-8
|
42
42
|
string: params=%7B%22steps%22%3A%7B%22a479db2c601661d8f914caf9cf258c0b%22%3A%7B%22robot%22%3A%22%2Fvideo%2Fthumbs%22%7D%7D%2C%22redirect_url%22%3A%22http%3A%2F%2Ffoo.bar%2F%22%2C%22auth%22%3A%7B%22key%22%3A%22%22%7D%2C%22file_0%22%3A%22%23%3CFile%3A0x00000100c63738%3E%22%7D
|
@@ -65,13 +65,13 @@ http_interactions:
|
|
65
65
|
Access-Control-Allow-Headers:
|
66
66
|
- X-Requested-With, Content-Type, Accept, Content-Length
|
67
67
|
Location:
|
68
|
-
-
|
68
|
+
- https://foo.bar/?assembly_id=177c56e5435176f4877fbc1b397fa4f0&assembly_ssl_url=https://api2.vivian.transloadit.com/assemblies/177c56e5435176f4877fbc1b397fa4f0
|
69
69
|
Transfer-Encoding:
|
70
70
|
- chunked
|
71
71
|
body:
|
72
72
|
encoding: UTF-8
|
73
73
|
string: ! '{"ok":"ASSEMBLY_COMPLETED","message":"The assembly was successfully
|
74
|
-
completed.","assembly_id":"177c56e5435176f4877fbc1b397fa4f0","
|
74
|
+
completed.","assembly_id":"177c56e5435176f4877fbc1b397fa4f0","assembly_ssl_url":"https://api2.vivian.transloadit.com/assemblies/177c56e5435176f4877fbc1b397fa4f0","bytes_received":298,"bytes_expected":298,"client_agent":"Transloadit
|
75
75
|
Ruby SDK 0.0.1","client_ip":"69.180.12.41","client_referer":null,"start_date":"2011/02/07
|
76
76
|
04:29:15 GMT","upload_duration":0.038,"execution_duration":0.002,"fields":{},"uploads":[],"results":{}}'
|
77
77
|
http_version: '1.1'
|
@@ -2,7 +2,7 @@
|
|
2
2
|
http_interactions:
|
3
3
|
- request:
|
4
4
|
method: post
|
5
|
-
uri:
|
5
|
+
uri: https://api2.transloadit.com/assemblies/55c965a063a311e6ba2d379ef10b28f7/replay
|
6
6
|
body:
|
7
7
|
encoding: UTF-8
|
8
8
|
string: params=%%7B%22auth%22:%7B%22key%22:%22%22%7D%7D
|
@@ -43,7 +43,7 @@ http_interactions:
|
|
43
43
|
body:
|
44
44
|
encoding: UTF-8
|
45
45
|
string: '{"ok":"ASSEMBLY_REPLAYING","message":"The assembly is now in the process
|
46
|
-
of being replayed.","success":true,"assembly_id":"b8590300650211e6b826d727b2cfd9ce","
|
46
|
+
of being replayed.","success":true,"assembly_id":"b8590300650211e6b826d727b2cfd9ce","assembly_ssl_url":"https://api2.sayuri.transloadit.com/assemblies/b8590300650211e6b826d727b2cfd9ce","notify_url":null}'
|
47
47
|
http_version:
|
48
48
|
recorded_at: Tue, 16 Aug 2016 11:19:45 GMT
|
49
49
|
recorded_with: VCR 3.0.3
|
@@ -2,7 +2,7 @@
|
|
2
2
|
http_interactions:
|
3
3
|
- request:
|
4
4
|
method: post
|
5
|
-
uri:
|
5
|
+
uri: https://api2.transloadit.com/assembly_notifications/2ea5d21063ad11e6bc93e53395ce4e7d/replay
|
6
6
|
body:
|
7
7
|
encoding: UTF-8
|
8
8
|
string: params=%%7B%22auth%22:%7B%22key%22:%22%22%7D%7D
|
@@ -2,7 +2,7 @@
|
|
2
2
|
http_interactions:
|
3
3
|
- request:
|
4
4
|
method: post
|
5
|
-
uri:
|
5
|
+
uri: https://api2.transloadit.com/assemblies
|
6
6
|
body:
|
7
7
|
encoding: UTF-8
|
8
8
|
string: params=%7B%22steps%22%3A%7B%22a479db2c601661d8f914caf9cf258c0b%22%3A%7B%22robot%22%3A%22%2Fvideo%2Fthumbs%22%7D%7D%2C%22redirect_url%22%3A%22http%3A%2F%2Ffoo.bar%2F%22%2C%22auth%22%3A%7B%22key%22%3A%22%22%7D%2C%22file_0%22%3A%22%23%3CFile%3A0x00000100c63738%3E%22%7D
|
@@ -31,13 +31,13 @@ http_interactions:
|
|
31
31
|
Access-Control-Allow-Headers:
|
32
32
|
- X-Requested-With, Content-Type, Accept, Content-Length
|
33
33
|
Location:
|
34
|
-
-
|
34
|
+
- https://foo.bar/?assembly_id=177c56e5435176f4877fbc1b397fa4f0&assembly_ssl_url=https://api2.vivian.transloadit.com/assemblies/177c56e5435176f4877fbc1b397fa4f0
|
35
35
|
Transfer-Encoding:
|
36
36
|
- chunked
|
37
37
|
body:
|
38
38
|
encoding: UTF-8
|
39
39
|
string: ! '{"ok":"ASSEMBLY_COMPLETED","message":"The assembly was successfully
|
40
|
-
completed.","assembly_id":"177c56e5435176f4877fbc1b397fa4f0","
|
40
|
+
completed.","assembly_id":"177c56e5435176f4877fbc1b397fa4f0","assembly_ssl_url":"https://api2.vivian.transloadit.com/assemblies/177c56e5435176f4877fbc1b397fa4f0","bytes_received":298,"bytes_expected":298,"client_agent":"Transloadit
|
41
41
|
Ruby SDK 0.0.1","client_ip":"69.180.12.41","client_referer":null,"start_date":"2011/02/07
|
42
42
|
04:29:15 GMT","upload_duration":0.038,"execution_duration":0.002,"fields":{},"uploads":[],"results":{}}'
|
43
43
|
http_version: '1.1'
|
@@ -2,7 +2,7 @@
|
|
2
2
|
http_interactions:
|
3
3
|
- request:
|
4
4
|
method: put
|
5
|
-
uri:
|
5
|
+
uri: https://api2.transloadit.com/templates/55c965a063a311e6ba2d379ef10b28f7
|
6
6
|
body:
|
7
7
|
encoding: UTF-8
|
8
8
|
string: params=%7B%22auth%22%3A%7B%22key%22%3A%22%22%7D%7D
|
data/test/test_helper.rb
CHANGED
@@ -1,21 +1,21 @@
|
|
1
1
|
$:.unshift File.dirname(__FILE__)
|
2
|
-
$:.unshift File.expand_path(
|
2
|
+
$:.unshift File.expand_path("../../lib", __FILE__)
|
3
3
|
|
4
|
-
if ENV[
|
5
|
-
require
|
6
|
-
SimpleCov.start { add_filter
|
4
|
+
if ENV["COVERAGE"] != "false"
|
5
|
+
require "simplecov"
|
6
|
+
SimpleCov.start { add_filter "/test/" }
|
7
7
|
end
|
8
8
|
|
9
|
-
require
|
10
|
-
require
|
11
|
-
require
|
9
|
+
require "minitest/autorun"
|
10
|
+
require "transloadit"
|
11
|
+
require "vcr"
|
12
12
|
|
13
13
|
VCR.configure do |c|
|
14
|
-
c.cassette_library_dir
|
15
|
-
c.default_cassette_options = {
|
14
|
+
c.cassette_library_dir = "test/fixtures/cassettes"
|
15
|
+
c.default_cassette_options = {record: :none}
|
16
16
|
c.hook_into :webmock
|
17
17
|
end
|
18
18
|
|
19
19
|
def values_from_post_body(body)
|
20
|
-
Addressable::URI.parse(
|
20
|
+
Addressable::URI.parse("?" + CGI.unescape(body)).query_values
|
21
21
|
end
|