rev-api 2.2.0 → 2.4.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (63) hide show
  1. checksums.yaml +5 -5
  2. data/.gitignore +22 -21
  3. data/.ruby-gemset +1 -1
  4. data/.ruby-version +1 -1
  5. data/.travis.yml +8 -8
  6. data/Gemfile +3 -3
  7. data/LICENSE +191 -191
  8. data/README.md +131 -132
  9. data/Rakefile +13 -13
  10. data/examples/cli.rb +270 -270
  11. data/lib/rev-api.rb +26 -26
  12. data/lib/rev-api/api.rb +326 -326
  13. data/lib/rev-api/api_serializable.rb +30 -30
  14. data/lib/rev-api/exceptions.rb +97 -100
  15. data/lib/rev-api/http_client.rb +97 -97
  16. data/lib/rev-api/models/order.rb +129 -138
  17. data/lib/rev-api/models/order_request.rb +273 -222
  18. data/lib/rev-api/version.rb +3 -3
  19. data/rev-api.gemspec +33 -34
  20. data/spec/fixtures/api_cassettes/cancel_order.yml +38 -38
  21. data/spec/fixtures/api_cassettes/cancel_order_not_allowed.yml +40 -40
  22. data/spec/fixtures/api_cassettes/get_attachment_content.yml +399 -399
  23. data/spec/fixtures/api_cassettes/get_attachment_content_as_pdf.yml +399 -399
  24. data/spec/fixtures/api_cassettes/get_attachment_content_as_text.yml +65 -65
  25. data/spec/fixtures/api_cassettes/get_attachment_content_as_youtube_transcript.yml +66 -66
  26. data/spec/fixtures/api_cassettes/get_attachment_content_unacceptable_representation.yml +42 -42
  27. data/spec/fixtures/api_cassettes/get_attachment_content_with_invalid_id.yml +42 -42
  28. data/spec/fixtures/api_cassettes/get_attachment_metadata.yml +42 -42
  29. data/spec/fixtures/api_cassettes/get_attachment_with_invalid_id.yml +40 -40
  30. data/spec/fixtures/api_cassettes/get_orders.yml +122 -122
  31. data/spec/fixtures/api_cassettes/get_orders_with_clientRef.yml +41 -41
  32. data/spec/fixtures/api_cassettes/get_tc_order.yml +44 -44
  33. data/spec/fixtures/api_cassettes/get_third_page_of_orders.yml +52 -58
  34. data/spec/fixtures/api_cassettes/link_input.yml +44 -44
  35. data/spec/fixtures/api_cassettes/link_input_with_all_attributes.yml +44 -44
  36. data/spec/fixtures/api_cassettes/link_input_with_spaces_in_filename.yml +45 -45
  37. data/spec/fixtures/api_cassettes/not_found_order.yml +42 -42
  38. data/spec/fixtures/api_cassettes/submit_cp_order.yml +44 -45
  39. data/spec/fixtures/api_cassettes/submit_su_order.yml +44 -45
  40. data/spec/fixtures/api_cassettes/submit_tc_order_with_account_balance.yml +44 -45
  41. data/spec/fixtures/api_cassettes/submit_tc_order_with_invalid_request.yml +45 -45
  42. data/spec/fixtures/api_cassettes/submit_tc_order_without_specifying_payment.yml +44 -45
  43. data/spec/fixtures/api_cassettes/unauthorized.yml +42 -42
  44. data/spec/fixtures/api_cassettes/upload_input.yml +90 -90
  45. data/spec/fixtures/api_cassettes/upload_input_with_invalid_content_type.yml +91 -91
  46. data/spec/lib/rev/api_spec.rb +30 -24
  47. data/spec/lib/rev/cancel_order_spec.rb +24 -24
  48. data/spec/lib/rev/exceptions_spec.rb +8 -8
  49. data/spec/lib/rev/get_attachment_content_spec.rb +79 -79
  50. data/spec/lib/rev/get_attachment_metadata_spec.rb +33 -33
  51. data/spec/lib/rev/get_order_spec.rb +52 -68
  52. data/spec/lib/rev/get_orders_spec.rb +62 -62
  53. data/spec/lib/rev/http_client_spec.rb +32 -32
  54. data/spec/lib/rev/models/order_request_spec.rb +79 -10
  55. data/spec/lib/rev/models/order_spec.rb +58 -58
  56. data/spec/lib/rev/post_inputs_spec.rb +94 -94
  57. data/spec/lib/rev/post_order_spec.rb +163 -195
  58. data/spec/spec_helper.rb +47 -49
  59. data/spec/test_helpers.rb +5 -0
  60. metadata +10 -28
  61. data/.coveralls.yml +0 -2
  62. data/spec/fixtures/api_cassettes/get_tr_order.yml +0 -44
  63. data/spec/fixtures/api_cassettes/submit_tr_order.yml +0 -44
@@ -0,0 +1,5 @@
1
+ require_relative '../lib/rev-api'
2
+
3
+ def create_input(options = {})
4
+ [Rev::Input.new(options)]
5
+ end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rev-api
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.2.0
4
+ version: 2.4.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Rev.com, Inc
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-05-03 00:00:00.000000000 Z
11
+ date: 2020-07-15 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: httparty
@@ -17,7 +17,7 @@ dependencies:
17
17
  - - "~>"
18
18
  - !ruby/object:Gem::Version
19
19
  version: '0.11'
20
- - - ">="
20
+ - - "~>"
21
21
  - !ruby/object:Gem::Version
22
22
  version: 0.11.0
23
23
  type: :runtime
@@ -27,7 +27,7 @@ dependencies:
27
27
  - - "~>"
28
28
  - !ruby/object:Gem::Version
29
29
  version: '0.11'
30
- - - ">="
30
+ - - "~>"
31
31
  - !ruby/object:Gem::Version
32
32
  version: 0.11.0
33
33
  - !ruby/object:Gem::Dependency
@@ -97,7 +97,7 @@ dependencies:
97
97
  - - "~>"
98
98
  - !ruby/object:Gem::Version
99
99
  version: '10.1'
100
- - - ">="
100
+ - - "~>"
101
101
  - !ruby/object:Gem::Version
102
102
  version: 10.1.0
103
103
  type: :development
@@ -107,7 +107,7 @@ dependencies:
107
107
  - - "~>"
108
108
  - !ruby/object:Gem::Version
109
109
  version: '10.1'
110
- - - ">="
110
+ - - "~>"
111
111
  - !ruby/object:Gem::Version
112
112
  version: 10.1.0
113
113
  - !ruby/object:Gem::Dependency
@@ -116,14 +116,14 @@ dependencies:
116
116
  requirements:
117
117
  - - "~>"
118
118
  - !ruby/object:Gem::Version
119
- version: '0'
119
+ version: 0.9.14
120
120
  type: :development
121
121
  prerelease: false
122
122
  version_requirements: !ruby/object:Gem::Requirement
123
123
  requirements:
124
124
  - - "~>"
125
125
  - !ruby/object:Gem::Version
126
- version: '0'
126
+ version: 0.9.14
127
127
  - !ruby/object:Gem::Dependency
128
128
  name: redcarpet
129
129
  requirement: !ruby/object:Gem::Requirement
@@ -152,20 +152,6 @@ dependencies:
152
152
  - - "~>"
153
153
  - !ruby/object:Gem::Version
154
154
  version: '0'
155
- - !ruby/object:Gem::Dependency
156
- name: coveralls
157
- requirement: !ruby/object:Gem::Requirement
158
- requirements:
159
- - - "~>"
160
- - !ruby/object:Gem::Version
161
- version: '0.8'
162
- type: :development
163
- prerelease: false
164
- version_requirements: !ruby/object:Gem::Requirement
165
- requirements:
166
- - - "~>"
167
- - !ruby/object:Gem::Version
168
- version: '0.8'
169
155
  description: Communicate with Rev.com API using plain Ruby objects without bothering
170
156
  about HTTP
171
157
  email: api@rev.com
@@ -173,7 +159,6 @@ executables: []
173
159
  extensions: []
174
160
  extra_rdoc_files: []
175
161
  files:
176
- - ".coveralls.yml"
177
162
  - ".gitignore"
178
163
  - ".ruby-gemset"
179
164
  - ".ruby-version"
@@ -206,7 +191,6 @@ files:
206
191
  - spec/fixtures/api_cassettes/get_orders_with_clientRef.yml
207
192
  - spec/fixtures/api_cassettes/get_tc_order.yml
208
193
  - spec/fixtures/api_cassettes/get_third_page_of_orders.yml
209
- - spec/fixtures/api_cassettes/get_tr_order.yml
210
194
  - spec/fixtures/api_cassettes/link_input.yml
211
195
  - spec/fixtures/api_cassettes/link_input_with_all_attributes.yml
212
196
  - spec/fixtures/api_cassettes/link_input_with_spaces_in_filename.yml
@@ -216,7 +200,6 @@ files:
216
200
  - spec/fixtures/api_cassettes/submit_tc_order_with_account_balance.yml
217
201
  - spec/fixtures/api_cassettes/submit_tc_order_with_invalid_request.yml
218
202
  - spec/fixtures/api_cassettes/submit_tc_order_without_specifying_payment.yml
219
- - spec/fixtures/api_cassettes/submit_tr_order.yml
220
203
  - spec/fixtures/api_cassettes/unauthorized.yml
221
204
  - spec/fixtures/api_cassettes/upload_input.yml
222
205
  - spec/fixtures/api_cassettes/upload_input_with_invalid_content_type.yml
@@ -234,6 +217,7 @@ files:
234
217
  - spec/lib/rev/post_inputs_spec.rb
235
218
  - spec/lib/rev/post_order_spec.rb
236
219
  - spec/spec_helper.rb
220
+ - spec/test_helpers.rb
237
221
  - spec/tmp_get_attachment_content
238
222
  homepage: https://www.rev.com/api
239
223
  licenses:
@@ -255,10 +239,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
255
239
  - !ruby/object:Gem::Version
256
240
  version: '0'
257
241
  requirements: []
258
- rubyforge_project:
259
- rubygems_version: 2.5.1
242
+ rubygems_version: 3.1.4
260
243
  signing_key:
261
244
  specification_version: 4
262
245
  summary: Ruby wrapper for Rev.com API
263
246
  test_files: []
264
- has_rdoc: yard
@@ -1,2 +0,0 @@
1
- service_name: travis-pro
2
- repo_token: sxagPJJLWdT4EPbWoaCHvarBQMCxbfCym
@@ -1,44 +0,0 @@
1
- ---
2
- http_interactions:
3
- - request:
4
- method: get
5
- uri: https://www.revtrunk.com/api/v1/orders/TR0116711100
6
- body:
7
- encoding: US-ASCII
8
- string: ''
9
- headers:
10
- Authorization:
11
- - Rev welcome:AAAAAu/YjZ3phXU5FsF35yIcgiA=
12
- User-Agent:
13
- - RevOfficialRubySDK/1.0.0
14
- response:
15
- status:
16
- code: 200
17
- message: OK
18
- headers:
19
- Cache-Control:
20
- - no-cache
21
- Pragma:
22
- - no-cache
23
- Content-Type:
24
- - application/json; charset=utf-8
25
- Expires:
26
- - '-1'
27
- Server:
28
- - Microsoft-IIS/7.5
29
- X-Miniprofiler-Ids:
30
- - ! '["4da53417-6cee-4900-becc-54ffc448d501","b09218a3-e30d-4e14-9ec8-4d8004748fe6"]'
31
- X-Powered-By:
32
- - ASP.NET
33
- Date:
34
- - Wed, 11 Sep 2013 00:42:31 GMT
35
- Content-Length:
36
- - '576'
37
- body:
38
- encoding: US-ASCII
39
- string: ! '{"order_number":"TR0116711100","price":20.0000,"status":"Finding
40
- Reviewer","translation":{"total_word_count":2,"source_language_code":"cs","destination_language_code":"en"},"comments":[{"by":"Den
41
- Markin","timestamp":"2012-10-19T18:55:00.743","text":"checking invoice info"}],"attachments":[{"kind":"media","name":"dl.dropbox.com_u_6623161_SoundNote_97087F7F-62A1-4005-91C9-42157AB014A2.soundnote_97087F7F-62A1-4005-91C9-42157AB014A2_0.m4a.txt","id":"vN70BhcAAAAAAAAA","links":[{"rel":"content","href":"https://www.revtrunk.com/api/v1/attachments/vN70BhcAAAAAAAAA/content"}]}]}'
42
- http_version:
43
- recorded_at: Wed, 11 Sep 2013 00:42:31 GMT
44
- recorded_with: VCR 2.5.0
@@ -1,44 +0,0 @@
1
- ---
2
- http_interactions:
3
- - request:
4
- method: post
5
- uri: https://www.revtrunk.com/api/v1/orders
6
- body:
7
- encoding: UTF-8
8
- string: ! '{"payment":{"type":"AccountBalance"},"translation_options":{"source_language_code":"es","destination_language_code":"en","inputs":[{"word_length":1000,"uri":"urn:rev:inputmedia:SnVwbG9hZHMvMjAxMy0wOS0xNy9lMzk4MWIzNS0wNzM1LTRlMDAtODY1NC1jNWY4ZjE4MzdlMTIvc291cmNlZG9jdW1lbnQucG5n"}]}}'
9
- headers:
10
- Content-Type:
11
- - application/json
12
- Authorization:
13
- - Rev welcome:AAAAAu/YjZ3phXU5FsF35yIcgiA=
14
- User-Agent:
15
- - RevOfficialRubySDK/1.0.0
16
- response:
17
- status:
18
- code: 201
19
- message: Created
20
- headers:
21
- Cache-Control:
22
- - no-cache
23
- Pragma:
24
- - no-cache
25
- Expires:
26
- - '-1'
27
- Location:
28
- - https://www.revtrunk.com/api/v1/orders/TR0235803277
29
- Server:
30
- - Microsoft-IIS/7.5
31
- X-Miniprofiler-Ids:
32
- - ! '["43bcb320-a1c9-4e9f-96c1-320e01a31549","ad8a37cd-e5ea-4134-ac9e-0390f722d6f6"]'
33
- X-Powered-By:
34
- - ASP.NET
35
- Date:
36
- - Wed, 18 Sep 2013 00:21:27 GMT
37
- Content-Length:
38
- - '0'
39
- body:
40
- encoding: US-ASCII
41
- string: ''
42
- http_version:
43
- recorded_at: Wed, 18 Sep 2013 00:21:27 GMT
44
- recorded_with: VCR 2.5.0