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
metadata
CHANGED
|
@@ -1,14 +1,13 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: deepl-rb
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 3.
|
|
4
|
+
version: 3.8.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- DeepL SE
|
|
8
|
-
autorequire:
|
|
9
8
|
bindir: bin
|
|
10
9
|
cert_chain: []
|
|
11
|
-
date:
|
|
10
|
+
date: 2026-06-18 00:00:00.000000000 Z
|
|
12
11
|
dependencies:
|
|
13
12
|
- !ruby/object:Gem::Dependency
|
|
14
13
|
name: juwelier
|
|
@@ -98,8 +97,18 @@ files:
|
|
|
98
97
|
- lib/deepl/requests/glossary/list.rb
|
|
99
98
|
- lib/deepl/requests/languages.rb
|
|
100
99
|
- lib/deepl/requests/rephrase.rb
|
|
100
|
+
- lib/deepl/requests/style_rule/create.rb
|
|
101
|
+
- lib/deepl/requests/style_rule/create_custom_instruction.rb
|
|
102
|
+
- lib/deepl/requests/style_rule/destroy.rb
|
|
103
|
+
- lib/deepl/requests/style_rule/destroy_custom_instruction.rb
|
|
104
|
+
- lib/deepl/requests/style_rule/find.rb
|
|
105
|
+
- lib/deepl/requests/style_rule/find_custom_instruction.rb
|
|
101
106
|
- lib/deepl/requests/style_rule/list.rb
|
|
107
|
+
- lib/deepl/requests/style_rule/update.rb
|
|
108
|
+
- lib/deepl/requests/style_rule/update_configured_rules.rb
|
|
109
|
+
- lib/deepl/requests/style_rule/update_custom_instruction.rb
|
|
102
110
|
- lib/deepl/requests/translate.rb
|
|
111
|
+
- lib/deepl/requests/translation_memory/list.rb
|
|
103
112
|
- lib/deepl/requests/usage.rb
|
|
104
113
|
- lib/deepl/resources/base.rb
|
|
105
114
|
- lib/deepl/resources/document_handle.rb
|
|
@@ -109,8 +118,10 @@ files:
|
|
|
109
118
|
- lib/deepl/resources/language_pair.rb
|
|
110
119
|
- lib/deepl/resources/style_rule.rb
|
|
111
120
|
- lib/deepl/resources/text.rb
|
|
121
|
+
- lib/deepl/resources/translation_memory.rb
|
|
112
122
|
- lib/deepl/resources/usage.rb
|
|
113
123
|
- lib/deepl/style_rule_api.rb
|
|
124
|
+
- lib/deepl/translation_memory_api.rb
|
|
114
125
|
- lib/deepl/utils/backoff_timer.rb
|
|
115
126
|
- lib/deepl/utils/exception_builder.rb
|
|
116
127
|
- lib/http_client_options.rb
|
|
@@ -120,22 +131,24 @@ files:
|
|
|
120
131
|
- spec/api/configuration_spec.rb
|
|
121
132
|
- spec/api/deepl_spec.rb
|
|
122
133
|
- spec/constants/constants_spec.rb
|
|
123
|
-
- spec/fixtures/vcr_cassettes/deepl_document.yml
|
|
124
|
-
- spec/fixtures/vcr_cassettes/deepl_document_download.yml
|
|
125
|
-
- spec/fixtures/vcr_cassettes/deepl_glossaries.yml
|
|
126
|
-
- spec/fixtures/vcr_cassettes/deepl_languages.yml
|
|
127
|
-
- spec/fixtures/vcr_cassettes/deepl_rephrase.yml
|
|
128
|
-
- spec/fixtures/vcr_cassettes/deepl_translate.yml
|
|
129
|
-
- spec/fixtures/vcr_cassettes/deepl_usage.yml
|
|
130
|
-
- spec/fixtures/vcr_cassettes/glossaries.yml
|
|
131
|
-
- spec/fixtures/vcr_cassettes/languages.yml
|
|
132
|
-
- spec/fixtures/vcr_cassettes/rephrase_texts.yml
|
|
133
|
-
- spec/fixtures/vcr_cassettes/style_rules.yml
|
|
134
|
-
- spec/fixtures/vcr_cassettes/translate_texts.yml
|
|
135
|
-
- spec/fixtures/vcr_cassettes/usage.yml
|
|
136
134
|
- spec/integration_tests/document_api_spec.rb
|
|
135
|
+
- spec/integration_tests/document_error_paths_spec.rb
|
|
136
|
+
- spec/integration_tests/glossary_api_spec.rb
|
|
137
|
+
- spec/integration_tests/glossary_error_paths_spec.rb
|
|
137
138
|
- spec/integration_tests/integration_test_utils.rb
|
|
139
|
+
- spec/integration_tests/languages_api_spec.rb
|
|
140
|
+
- spec/integration_tests/languages_error_paths_spec.rb
|
|
141
|
+
- spec/integration_tests/rephrase_api_spec.rb
|
|
142
|
+
- spec/integration_tests/rephrase_error_paths_spec.rb
|
|
143
|
+
- spec/integration_tests/smoke_test_spec.rb
|
|
138
144
|
- spec/integration_tests/style_rule_api_spec.rb
|
|
145
|
+
- spec/integration_tests/style_rule_error_paths_spec.rb
|
|
146
|
+
- spec/integration_tests/translate_api_spec.rb
|
|
147
|
+
- spec/integration_tests/translate_error_paths_spec.rb
|
|
148
|
+
- spec/integration_tests/translation_memory_api_spec.rb
|
|
149
|
+
- spec/integration_tests/translation_memory_error_paths_spec.rb
|
|
150
|
+
- spec/integration_tests/usage_api_spec.rb
|
|
151
|
+
- spec/integration_tests/usage_error_paths_spec.rb
|
|
139
152
|
- spec/requests/extra_body_parameters_types_spec.rb
|
|
140
153
|
- spec/requests/glossary/create_spec.rb
|
|
141
154
|
- spec/requests/glossary/destroy_spec.rb
|
|
@@ -145,14 +158,32 @@ files:
|
|
|
145
158
|
- spec/requests/glossary/list_spec.rb
|
|
146
159
|
- spec/requests/languages_spec.rb
|
|
147
160
|
- spec/requests/rephrase_spec.rb
|
|
161
|
+
- spec/requests/style_rule/create_custom_instruction_spec.rb
|
|
162
|
+
- spec/requests/style_rule/create_spec.rb
|
|
163
|
+
- spec/requests/style_rule/destroy_custom_instruction_spec.rb
|
|
164
|
+
- spec/requests/style_rule/destroy_spec.rb
|
|
165
|
+
- spec/requests/style_rule/find_custom_instruction_spec.rb
|
|
166
|
+
- spec/requests/style_rule/find_spec.rb
|
|
167
|
+
- spec/requests/style_rule/list_spec.rb
|
|
168
|
+
- spec/requests/style_rule/update_configured_rules_spec.rb
|
|
169
|
+
- spec/requests/style_rule/update_custom_instruction_spec.rb
|
|
170
|
+
- spec/requests/style_rule/update_spec.rb
|
|
148
171
|
- spec/requests/translate_spec.rb
|
|
172
|
+
- spec/requests/translation_memory/list_spec.rb
|
|
149
173
|
- spec/requests/usage_spec.rb
|
|
174
|
+
- spec/resources/custom_instruction_spec.rb
|
|
150
175
|
- spec/resources/glossary_spec.rb
|
|
151
176
|
- spec/resources/language_pair_spec.rb
|
|
152
177
|
- spec/resources/language_spec.rb
|
|
178
|
+
- spec/resources/style_rule_spec.rb
|
|
153
179
|
- spec/resources/text_spec.rb
|
|
180
|
+
- spec/resources/translation_memory_spec.rb
|
|
154
181
|
- spec/resources/usage_spec.rb
|
|
155
182
|
- spec/spec_helper.rb
|
|
183
|
+
- spec/support/live_mock_server.rb
|
|
184
|
+
- spec/support/managed_glossary.rb
|
|
185
|
+
- spec/support/managed_style_rule.rb
|
|
186
|
+
- spec/support/managed_translation_memory.rb
|
|
156
187
|
homepage: https://github.com/DeepLcom/deepl-rb
|
|
157
188
|
licenses:
|
|
158
189
|
- MIT
|
|
@@ -161,7 +192,6 @@ metadata:
|
|
|
161
192
|
changelog_uri: https://github.com/DeepLcom/deepl-rb/blob/main/CHANGELOG.md
|
|
162
193
|
documentation_uri: https://github.com/DeepLcom/deepl-rb/blob/main/README.md
|
|
163
194
|
homepage_uri: https://github.com/DeepLcom/deepl-rb
|
|
164
|
-
post_install_message:
|
|
165
195
|
rdoc_options: []
|
|
166
196
|
require_paths:
|
|
167
197
|
- lib
|
|
@@ -176,8 +206,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
176
206
|
- !ruby/object:Gem::Version
|
|
177
207
|
version: '0'
|
|
178
208
|
requirements: []
|
|
179
|
-
rubygems_version: 3.
|
|
180
|
-
signing_key:
|
|
209
|
+
rubygems_version: 3.6.2
|
|
181
210
|
specification_version: 4
|
|
182
211
|
summary: Official Ruby library for the DeepL language translation API.
|
|
183
212
|
test_files: []
|
|
@@ -1,95 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
http_interactions:
|
|
3
|
-
- request:
|
|
4
|
-
method: post
|
|
5
|
-
uri: https://api.deepl.com/v2/document
|
|
6
|
-
body:
|
|
7
|
-
encoding: US-ASCII
|
|
8
|
-
string: ''
|
|
9
|
-
headers:
|
|
10
|
-
Authorization:
|
|
11
|
-
- DeepL-Auth-Key VALID_TOKEN
|
|
12
|
-
User-Agent:
|
|
13
|
-
- deepl-ruby/3.0.2 (darwin23) ruby/3.3.3
|
|
14
|
-
Content-Type:
|
|
15
|
-
- multipart/form-data
|
|
16
|
-
Accept-Encoding:
|
|
17
|
-
- gzip;q=1.0,deflate;q=0.6,identity;q=0.3
|
|
18
|
-
Accept:
|
|
19
|
-
- "*/*"
|
|
20
|
-
Fake-Header:
|
|
21
|
-
- fake_value
|
|
22
|
-
response:
|
|
23
|
-
status:
|
|
24
|
-
code: 200
|
|
25
|
-
message: OK
|
|
26
|
-
headers:
|
|
27
|
-
Date:
|
|
28
|
-
- Tue, 09 Jul 2024 02:02:17 GMT
|
|
29
|
-
Content-Type:
|
|
30
|
-
- application/json; charset=utf-8
|
|
31
|
-
Transfer-Encoding:
|
|
32
|
-
- chunked
|
|
33
|
-
Vary:
|
|
34
|
-
- Accept-Encoding
|
|
35
|
-
Access-Control-Allow-Origin:
|
|
36
|
-
- "*"
|
|
37
|
-
X-Trace-Id:
|
|
38
|
-
- cdde031b7a5e48d7a8c4a5a2f1b9dc6e
|
|
39
|
-
Strict-Transport-Security:
|
|
40
|
-
- max-age=63072000; includeSubDomains; preload
|
|
41
|
-
Server-Timing:
|
|
42
|
-
- l7_lb_tls;dur=100, l7_lb_idle;dur=2, l7_lb_receive;dur=0, l7_lb_total;dur=192
|
|
43
|
-
Access-Control-Expose-Headers:
|
|
44
|
-
- Server-Timing, X-Trace-ID
|
|
45
|
-
body:
|
|
46
|
-
encoding: ASCII-8BIT
|
|
47
|
-
string: '{"document_id":"9B7CB9418DCDEBF2C4C519F65A32B99F","document_key":"EA637EA43BB3F8A52A2A25B76EF3E0C72CE9CD00C881148D1236CB584CB34815"}'
|
|
48
|
-
recorded_at: Tue, 09 Jul 2024 02:02:17 GMT
|
|
49
|
-
- request:
|
|
50
|
-
method: post
|
|
51
|
-
uri: https://api.deepl.com/v2/document/9B7CB9418DCDEBF2C4C519F65A32B99F
|
|
52
|
-
body:
|
|
53
|
-
encoding: UTF-8
|
|
54
|
-
string: '{"document_key":"EA637EA43BB3F8A52A2A25B76EF3E0C72CE9CD00C881148D1236CB584CB34815","param":"fake"}'
|
|
55
|
-
headers:
|
|
56
|
-
Authorization:
|
|
57
|
-
- DeepL-Auth-Key VALID_TOKEN
|
|
58
|
-
User-Agent:
|
|
59
|
-
- deepl-ruby/3.0.2 (darwin23) ruby/3.3.3
|
|
60
|
-
Content-Type:
|
|
61
|
-
- application/json
|
|
62
|
-
Accept-Encoding:
|
|
63
|
-
- gzip;q=1.0,deflate;q=0.6,identity;q=0.3
|
|
64
|
-
Accept:
|
|
65
|
-
- "*/*"
|
|
66
|
-
Fake-Header:
|
|
67
|
-
- fake_value
|
|
68
|
-
response:
|
|
69
|
-
status:
|
|
70
|
-
code: 200
|
|
71
|
-
message: OK
|
|
72
|
-
headers:
|
|
73
|
-
Date:
|
|
74
|
-
- Tue, 09 Jul 2024 02:03:49 GMT
|
|
75
|
-
Content-Type:
|
|
76
|
-
- application/json; charset=utf-8
|
|
77
|
-
Transfer-Encoding:
|
|
78
|
-
- chunked
|
|
79
|
-
Vary:
|
|
80
|
-
- Accept-Encoding
|
|
81
|
-
Access-Control-Allow-Origin:
|
|
82
|
-
- "*"
|
|
83
|
-
X-Trace-Id:
|
|
84
|
-
- 73fc4be8f3964b4080f89ee686c090be
|
|
85
|
-
Strict-Transport-Security:
|
|
86
|
-
- max-age=63072000; includeSubDomains; preload
|
|
87
|
-
Server-Timing:
|
|
88
|
-
- l7_lb_tls;dur=152, l7_lb_idle;dur=9, l7_lb_receive;dur=0, l7_lb_total;dur=166
|
|
89
|
-
Access-Control-Expose-Headers:
|
|
90
|
-
- Server-Timing, X-Trace-ID
|
|
91
|
-
body:
|
|
92
|
-
encoding: ASCII-8BIT
|
|
93
|
-
string: '{"document_id":"9B7CB9418DCDEBF2C4C519F65A32B99F","status":"done","billed_characters":256}'
|
|
94
|
-
recorded_at: Tue, 09 Jul 2024 02:03:49 GMT
|
|
95
|
-
recorded_with: VCR 6.2.0
|