deepl-rb 3.7.0 → 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.
Files changed (73) hide show
  1. checksums.yaml +4 -4
  2. data/.gitlab-ci.yml +3 -1
  3. data/CHANGELOG.md +17 -1
  4. data/Gemfile +0 -2
  5. data/README.md +12 -12
  6. data/VERSION +1 -1
  7. data/deepl-rb.gemspec +27 -22
  8. data/lib/deepl/requests/rephrase.rb +3 -2
  9. data/lib/deepl/requests/translate.rb +2 -2
  10. data/lib/deepl.rb +7 -4
  11. data/lib/version.rb +1 -1
  12. data/spec/api/deepl_spec.rb +134 -332
  13. data/spec/integration_tests/document_api_spec.rb +4 -18
  14. data/spec/integration_tests/document_error_paths_spec.rb +33 -0
  15. data/spec/integration_tests/glossary_api_spec.rb +114 -0
  16. data/spec/integration_tests/glossary_error_paths_spec.rb +107 -0
  17. data/spec/integration_tests/languages_api_spec.rb +54 -0
  18. data/spec/integration_tests/languages_error_paths_spec.rb +25 -0
  19. data/spec/integration_tests/rephrase_api_spec.rb +90 -0
  20. data/spec/integration_tests/rephrase_error_paths_spec.rb +53 -0
  21. data/spec/integration_tests/smoke_test_spec.rb +24 -0
  22. data/spec/integration_tests/style_rule_api_spec.rb +1 -19
  23. data/spec/integration_tests/style_rule_error_paths_spec.rb +45 -0
  24. data/spec/integration_tests/translate_api_spec.rb +98 -0
  25. data/spec/integration_tests/translate_error_paths_spec.rb +48 -0
  26. data/spec/integration_tests/translation_memory_api_spec.rb +1 -17
  27. data/spec/integration_tests/translation_memory_error_paths_spec.rb +19 -0
  28. data/spec/integration_tests/usage_api_spec.rb +29 -0
  29. data/spec/integration_tests/usage_error_paths_spec.rb +18 -0
  30. data/spec/requests/glossary/create_spec.rb +0 -21
  31. data/spec/requests/glossary/destroy_spec.rb +0 -39
  32. data/spec/requests/glossary/entries_spec.rb +0 -35
  33. data/spec/requests/glossary/find_spec.rb +0 -40
  34. data/spec/requests/glossary/language_pairs_spec.rb +0 -13
  35. data/spec/requests/glossary/list_spec.rb +0 -27
  36. data/spec/requests/languages_spec.rb +0 -41
  37. data/spec/requests/rephrase_spec.rb +13 -139
  38. data/spec/requests/style_rule/create_custom_instruction_spec.rb +0 -24
  39. data/spec/requests/style_rule/create_spec.rb +0 -16
  40. data/spec/requests/style_rule/destroy_custom_instruction_spec.rb +0 -26
  41. data/spec/requests/style_rule/destroy_spec.rb +0 -27
  42. data/spec/requests/style_rule/find_custom_instruction_spec.rb +0 -27
  43. data/spec/requests/style_rule/find_spec.rb +0 -28
  44. data/spec/requests/style_rule/list_spec.rb +0 -31
  45. data/spec/requests/style_rule/update_configured_rules_spec.rb +0 -21
  46. data/spec/requests/style_rule/update_custom_instruction_spec.rb +0 -26
  47. data/spec/requests/style_rule/update_spec.rb +0 -19
  48. data/spec/requests/translate_spec.rb +8 -217
  49. data/spec/requests/translation_memory/list_spec.rb +0 -34
  50. data/spec/requests/usage_spec.rb +0 -16
  51. data/spec/resources/custom_instruction_spec.rb +32 -0
  52. data/spec/resources/style_rule_spec.rb +68 -0
  53. data/spec/spec_helper.rb +15 -45
  54. data/spec/support/live_mock_server.rb +12 -0
  55. data/spec/support/managed_glossary.rb +17 -0
  56. data/spec/support/managed_style_rule.rb +17 -0
  57. data/spec/support/managed_translation_memory.rb +7 -0
  58. metadata +23 -21
  59. data/spec/fixtures/vcr_cassettes/deepl_document.yml +0 -95
  60. data/spec/fixtures/vcr_cassettes/deepl_document_download.yml +0 -1214
  61. data/spec/fixtures/vcr_cassettes/deepl_glossaries.yml +0 -1163
  62. data/spec/fixtures/vcr_cassettes/deepl_languages.yml +0 -54
  63. data/spec/fixtures/vcr_cassettes/deepl_rephrase.yml +0 -87
  64. data/spec/fixtures/vcr_cassettes/deepl_translate.yml +0 -358
  65. data/spec/fixtures/vcr_cassettes/deepl_usage.yml +0 -129
  66. data/spec/fixtures/vcr_cassettes/glossaries.yml +0 -1702
  67. data/spec/fixtures/vcr_cassettes/languages.yml +0 -229
  68. data/spec/fixtures/vcr_cassettes/rephrase_texts.yml +0 -401
  69. data/spec/fixtures/vcr_cassettes/style_rules.yml +0 -92
  70. data/spec/fixtures/vcr_cassettes/style_rules_crud.yml +0 -926
  71. data/spec/fixtures/vcr_cassettes/translate_texts.yml +0 -10630
  72. data/spec/fixtures/vcr_cassettes/translation_memories.yml +0 -74
  73. data/spec/fixtures/vcr_cassettes/usage.yml +0 -171
@@ -1,74 +0,0 @@
1
- ---
2
- http_interactions:
3
- - request:
4
- method: get
5
- uri: https://api.deepl.com/v3/translation_memories
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 (darwin24) ruby/3.2.2
14
- Content-Type:
15
- - application/json
16
- Accept-Encoding:
17
- - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
18
- Accept:
19
- - "*/*"
20
- response:
21
- status:
22
- code: 200
23
- message: OK
24
- headers:
25
- Content-Type:
26
- - application/json; charset=utf-8
27
- Date:
28
- - Tue, 22 Apr 2026 10:00:00 GMT
29
- X-Trace-Id:
30
- - abc123def456
31
- Access-Control-Expose-Headers:
32
- - Server-Timing, X-Trace-ID
33
- Strict-Transport-Security:
34
- - max-age=63072000; includeSubDomains; preload
35
- Transfer-Encoding:
36
- - chunked
37
- Vary:
38
- - Accept-Encoding
39
- body:
40
- encoding: ASCII-8BIT
41
- string: '{"translation_memories":[{"translation_memory_id":"a74d88fb-ed2a-4943-a664-a4512398b994","name":"Legal","source_language":"en","target_languages":["es","de"],"segment_count":3542},{"translation_memory_id":"855d36ab-6112-4ef5-8868-0d69bc4d826a","name":"Medical
42
- terms","source_language":"de","target_languages":["fr","ja","zh"],"segment_count":23}],"total_count":2}'
43
- recorded_at: Tue, 22 Apr 2026 10:00:00 GMT
44
- - request:
45
- method: get
46
- uri: https://api.deepl.com/v3/translation_memories
47
- body:
48
- encoding: US-ASCII
49
- string: ''
50
- headers:
51
- Authorization:
52
- - DeepL-Auth-Key invalid
53
- User-Agent:
54
- - deepl-ruby/3.0.2 (darwin24) ruby/3.2.2
55
- Content-Type:
56
- - application/json
57
- Accept-Encoding:
58
- - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
59
- Accept:
60
- - "*/*"
61
- response:
62
- status:
63
- code: 403
64
- message: Forbidden
65
- headers:
66
- Content-Type:
67
- - application/json; charset=utf-8
68
- Date:
69
- - Tue, 22 Apr 2026 10:00:01 GMT
70
- body:
71
- encoding: ASCII-8BIT
72
- string: '{"message":"Forbidden"}'
73
- recorded_at: Tue, 22 Apr 2026 10:00:01 GMT
74
- recorded_with: VCR 6.3.1
@@ -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