deepl-rb 3.6.1 → 3.8.0
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 +4 -4
- data/.gitlab-ci.yml +8 -1
- data/CHANGELOG.md +35 -1
- data/Gemfile +0 -2
- data/README.md +165 -34
- data/Rakefile +2 -0
- data/VERSION +1 -1
- data/deepl-rb.gemspec +52 -20
- data/lib/deepl/requests/base.rb +16 -0
- data/lib/deepl/requests/document/upload.rb +6 -5
- data/lib/deepl/requests/rephrase.rb +3 -2
- data/lib/deepl/requests/style_rule/create.rb +46 -0
- data/lib/deepl/requests/style_rule/create_custom_instruction.rb +45 -0
- data/lib/deepl/requests/style_rule/destroy.rb +39 -0
- data/lib/deepl/requests/style_rule/destroy_custom_instruction.rb +40 -0
- data/lib/deepl/requests/style_rule/find.rb +40 -0
- data/lib/deepl/requests/style_rule/find_custom_instruction.rb +41 -0
- data/lib/deepl/requests/style_rule/update.rb +42 -0
- data/lib/deepl/requests/style_rule/update_configured_rules.rb +41 -0
- data/lib/deepl/requests/style_rule/update_custom_instruction.rb +47 -0
- data/lib/deepl/requests/translate.rb +17 -4
- data/lib/deepl/requests/translation_memory/list.rb +58 -0
- data/lib/deepl/resources/style_rule.rb +2 -1
- data/lib/deepl/resources/translation_memory.rb +25 -0
- data/lib/deepl/style_rule_api.rb +44 -0
- data/lib/deepl/translation_memory_api.rb +17 -0
- data/lib/deepl.rb +75 -55
- data/lib/version.rb +1 -1
- data/spec/api/deepl_spec.rb +134 -332
- data/spec/integration_tests/document_api_spec.rb +4 -18
- data/spec/integration_tests/document_error_paths_spec.rb +33 -0
- data/spec/integration_tests/glossary_api_spec.rb +114 -0
- data/spec/integration_tests/glossary_error_paths_spec.rb +107 -0
- data/spec/integration_tests/languages_api_spec.rb +54 -0
- data/spec/integration_tests/languages_error_paths_spec.rb +25 -0
- data/spec/integration_tests/rephrase_api_spec.rb +90 -0
- data/spec/integration_tests/rephrase_error_paths_spec.rb +53 -0
- data/spec/integration_tests/smoke_test_spec.rb +24 -0
- data/spec/integration_tests/style_rule_api_spec.rb +55 -17
- data/spec/integration_tests/style_rule_error_paths_spec.rb +45 -0
- data/spec/integration_tests/translate_api_spec.rb +98 -0
- data/spec/integration_tests/translate_error_paths_spec.rb +48 -0
- data/spec/integration_tests/translation_memory_api_spec.rb +54 -0
- data/spec/integration_tests/translation_memory_error_paths_spec.rb +19 -0
- data/spec/integration_tests/usage_api_spec.rb +29 -0
- data/spec/integration_tests/usage_error_paths_spec.rb +18 -0
- data/spec/requests/glossary/create_spec.rb +0 -21
- data/spec/requests/glossary/destroy_spec.rb +0 -39
- data/spec/requests/glossary/entries_spec.rb +0 -35
- data/spec/requests/glossary/find_spec.rb +0 -40
- data/spec/requests/glossary/language_pairs_spec.rb +0 -13
- data/spec/requests/glossary/list_spec.rb +0 -27
- data/spec/requests/languages_spec.rb +0 -41
- data/spec/requests/rephrase_spec.rb +13 -139
- data/spec/requests/style_rule/create_custom_instruction_spec.rb +30 -0
- data/spec/requests/style_rule/create_spec.rb +29 -0
- data/spec/requests/style_rule/destroy_custom_instruction_spec.rb +28 -0
- data/spec/requests/style_rule/destroy_spec.rb +27 -0
- data/spec/requests/style_rule/find_custom_instruction_spec.rb +29 -0
- data/spec/requests/style_rule/find_spec.rb +28 -0
- data/spec/requests/style_rule/list_spec.rb +27 -0
- data/spec/requests/style_rule/update_configured_rules_spec.rb +31 -0
- data/spec/requests/style_rule/update_custom_instruction_spec.rb +32 -0
- data/spec/requests/style_rule/update_spec.rb +29 -0
- data/spec/requests/translate_spec.rb +8 -218
- data/spec/requests/translation_memory/list_spec.rb +27 -0
- data/spec/requests/usage_spec.rb +0 -16
- data/spec/resources/custom_instruction_spec.rb +32 -0
- data/spec/resources/style_rule_spec.rb +68 -0
- data/spec/resources/translation_memory_spec.rb +35 -0
- data/spec/spec_helper.rb +15 -45
- data/spec/support/live_mock_server.rb +12 -0
- data/spec/support/managed_glossary.rb +17 -0
- data/spec/support/managed_style_rule.rb +17 -0
- data/spec/support/managed_translation_memory.rb +7 -0
- metadata +48 -19
- data/spec/fixtures/vcr_cassettes/deepl_document.yml +0 -95
- data/spec/fixtures/vcr_cassettes/deepl_document_download.yml +0 -1214
- data/spec/fixtures/vcr_cassettes/deepl_glossaries.yml +0 -1163
- data/spec/fixtures/vcr_cassettes/deepl_languages.yml +0 -54
- data/spec/fixtures/vcr_cassettes/deepl_rephrase.yml +0 -87
- data/spec/fixtures/vcr_cassettes/deepl_translate.yml +0 -358
- data/spec/fixtures/vcr_cassettes/deepl_usage.yml +0 -129
- data/spec/fixtures/vcr_cassettes/glossaries.yml +0 -1702
- data/spec/fixtures/vcr_cassettes/languages.yml +0 -229
- data/spec/fixtures/vcr_cassettes/rephrase_texts.yml +0 -401
- data/spec/fixtures/vcr_cassettes/style_rules.yml +0 -92
- data/spec/fixtures/vcr_cassettes/translate_texts.yml +0 -10630
- data/spec/fixtures/vcr_cassettes/usage.yml +0 -171
|
@@ -1,171 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
http_interactions:
|
|
3
|
-
- request:
|
|
4
|
-
method: get
|
|
5
|
-
uri: https://api-free.deepl.com/v2/usage
|
|
6
|
-
body:
|
|
7
|
-
encoding: US-ASCII
|
|
8
|
-
string: ''
|
|
9
|
-
headers:
|
|
10
|
-
Authorization:
|
|
11
|
-
- DeepL-Auth-Key VALID_TOKEN
|
|
12
|
-
Accept-Encoding:
|
|
13
|
-
- gzip;q=1.0,deflate;q=0.6,identity;q=0.3
|
|
14
|
-
Accept:
|
|
15
|
-
- "*/*"
|
|
16
|
-
User-Agent:
|
|
17
|
-
- deepl-ruby/3.0.2 (darwin23) ruby/3.3.3
|
|
18
|
-
response:
|
|
19
|
-
status:
|
|
20
|
-
code: 200
|
|
21
|
-
message: OK
|
|
22
|
-
headers:
|
|
23
|
-
Server:
|
|
24
|
-
- nginx
|
|
25
|
-
Date:
|
|
26
|
-
- Mon, 17 May 2021 14:18:32 GMT
|
|
27
|
-
Content-Type:
|
|
28
|
-
- application/json
|
|
29
|
-
Content-Length:
|
|
30
|
-
- '48'
|
|
31
|
-
Connection:
|
|
32
|
-
- keep-alive
|
|
33
|
-
Access-Control-Allow-Origin:
|
|
34
|
-
- "*"
|
|
35
|
-
body:
|
|
36
|
-
encoding: UTF-8
|
|
37
|
-
string: '{"character_count":353,"character_limit":500000}'
|
|
38
|
-
recorded_at: Mon, 17 May 2021 14:18:32 GMT
|
|
39
|
-
- request:
|
|
40
|
-
method: get
|
|
41
|
-
uri: https://api-free.deepl.com/v2/usage
|
|
42
|
-
body:
|
|
43
|
-
encoding: US-ASCII
|
|
44
|
-
string: ''
|
|
45
|
-
headers:
|
|
46
|
-
Authorization:
|
|
47
|
-
- DeepL-Auth-Key VALID_TOKEN
|
|
48
|
-
User-Agent:
|
|
49
|
-
- deepl-ruby/3.0.2 (darwin23) ruby/3.3.3
|
|
50
|
-
Accept-Encoding:
|
|
51
|
-
- gzip;q=1.0,deflate;q=0.6,identity;q=0.3
|
|
52
|
-
Accept:
|
|
53
|
-
- "*/*"
|
|
54
|
-
response:
|
|
55
|
-
status:
|
|
56
|
-
code: 403
|
|
57
|
-
message: Forbidden
|
|
58
|
-
headers:
|
|
59
|
-
Date:
|
|
60
|
-
- Tue, 02 Jul 2024 13:54:07 GMT
|
|
61
|
-
Content-Type:
|
|
62
|
-
- application/json
|
|
63
|
-
Transfer-Encoding:
|
|
64
|
-
- chunked
|
|
65
|
-
Vary:
|
|
66
|
-
- Accept-Encoding
|
|
67
|
-
Access-Control-Allow-Origin:
|
|
68
|
-
- "*"
|
|
69
|
-
Strict-Transport-Security:
|
|
70
|
-
- max-age=63072000; includeSubDomains; preload
|
|
71
|
-
Server-Timing:
|
|
72
|
-
- l7_lb_tls;dur=101, l7_lb_idle;dur=0, l7_lb_receive;dur=0, l7_lb_total;dur=103
|
|
73
|
-
Access-Control-Expose-Headers:
|
|
74
|
-
- Server-Timing, X-Trace-ID
|
|
75
|
-
X-Trace-Id:
|
|
76
|
-
- 4dcf2a36b3f14ba89f107449f4b14919
|
|
77
|
-
body:
|
|
78
|
-
encoding: ASCII-8BIT
|
|
79
|
-
string: '{"message":"Wrong endpoint. Use https://api.deepl.com"}'
|
|
80
|
-
recorded_at: Tue, 02 Jul 2024 13:54:07 GMT
|
|
81
|
-
- request:
|
|
82
|
-
method: get
|
|
83
|
-
uri: https://api.deepl.com/v2/usage
|
|
84
|
-
body:
|
|
85
|
-
encoding: US-ASCII
|
|
86
|
-
string: ''
|
|
87
|
-
headers:
|
|
88
|
-
Authorization:
|
|
89
|
-
- DeepL-Auth-Key VALID_TOKEN
|
|
90
|
-
User-Agent:
|
|
91
|
-
- deepl-ruby/3.0.2 (darwin23) ruby/3.3.3
|
|
92
|
-
Accept-Encoding:
|
|
93
|
-
- gzip;q=1.0,deflate;q=0.6,identity;q=0.3
|
|
94
|
-
Accept:
|
|
95
|
-
- "*/*"
|
|
96
|
-
response:
|
|
97
|
-
status:
|
|
98
|
-
code: 200
|
|
99
|
-
message: OK
|
|
100
|
-
headers:
|
|
101
|
-
Date:
|
|
102
|
-
- Tue, 02 Jul 2024 14:52:05 GMT
|
|
103
|
-
Content-Type:
|
|
104
|
-
- application/json
|
|
105
|
-
Transfer-Encoding:
|
|
106
|
-
- chunked
|
|
107
|
-
Vary:
|
|
108
|
-
- Accept-Encoding
|
|
109
|
-
Access-Control-Allow-Origin:
|
|
110
|
-
- "*"
|
|
111
|
-
X-Cache-Status:
|
|
112
|
-
- MISS
|
|
113
|
-
Strict-Transport-Security:
|
|
114
|
-
- max-age=63072000; includeSubDomains; preload
|
|
115
|
-
Server-Timing:
|
|
116
|
-
- l7_lb_tls;dur=112, l7_lb_idle;dur=1, l7_lb_receive;dur=0, l7_lb_total;dur=115
|
|
117
|
-
Access-Control-Expose-Headers:
|
|
118
|
-
- Server-Timing, X-Trace-ID
|
|
119
|
-
X-Trace-Id:
|
|
120
|
-
- de53f558d38c43748bf83b27f4f0edc9
|
|
121
|
-
body:
|
|
122
|
-
encoding: ASCII-8BIT
|
|
123
|
-
string: '{"character_count":18593,"character_limit":1000000000000}'
|
|
124
|
-
recorded_at: Tue, 02 Jul 2024 14:52:05 GMT
|
|
125
|
-
- request:
|
|
126
|
-
method: get
|
|
127
|
-
uri: https://api.deepl.com/v2/usage
|
|
128
|
-
body:
|
|
129
|
-
encoding: UTF-8
|
|
130
|
-
string: "{}"
|
|
131
|
-
headers:
|
|
132
|
-
Authorization:
|
|
133
|
-
- DeepL-Auth-Key VALID_TOKEN
|
|
134
|
-
User-Agent:
|
|
135
|
-
- deepl-ruby/3.0.2 (darwin23) ruby/3.3.3
|
|
136
|
-
Content-Type:
|
|
137
|
-
- application/json
|
|
138
|
-
Accept-Encoding:
|
|
139
|
-
- gzip;q=1.0,deflate;q=0.6,identity;q=0.3
|
|
140
|
-
Accept:
|
|
141
|
-
- "*/*"
|
|
142
|
-
response:
|
|
143
|
-
status:
|
|
144
|
-
code: 200
|
|
145
|
-
message: OK
|
|
146
|
-
headers:
|
|
147
|
-
Date:
|
|
148
|
-
- Tue, 09 Jul 2024 01:35:37 GMT
|
|
149
|
-
Content-Type:
|
|
150
|
-
- application/json
|
|
151
|
-
Transfer-Encoding:
|
|
152
|
-
- chunked
|
|
153
|
-
Vary:
|
|
154
|
-
- Accept-Encoding
|
|
155
|
-
Access-Control-Allow-Origin:
|
|
156
|
-
- "*"
|
|
157
|
-
X-Cache-Status:
|
|
158
|
-
- MISS
|
|
159
|
-
Strict-Transport-Security:
|
|
160
|
-
- max-age=63072000; includeSubDomains; preload
|
|
161
|
-
Server-Timing:
|
|
162
|
-
- l7_lb_tls;dur=137, l7_lb_idle;dur=1, l7_lb_receive;dur=0, l7_lb_total;dur=140
|
|
163
|
-
Access-Control-Expose-Headers:
|
|
164
|
-
- Server-Timing, X-Trace-ID
|
|
165
|
-
X-Trace-Id:
|
|
166
|
-
- 543309f656244684bb59d30e9dc824b5
|
|
167
|
-
body:
|
|
168
|
-
encoding: ASCII-8BIT
|
|
169
|
-
string: '{"character_count":69328,"character_limit":1000000000000}'
|
|
170
|
-
recorded_at: Tue, 09 Jul 2024 01:35:37 GMT
|
|
171
|
-
recorded_with: VCR 6.2.0
|