deepl-rb 3.9.0 → 4.0.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 (215) hide show
  1. checksums.yaml +4 -4
  2. data/.rubocop.yml +27 -1
  3. data/CHANGELOG.md +741 -18
  4. data/Gemfile +4 -0
  5. data/README.md +1001 -327
  6. data/Rakefile +29 -7
  7. data/VERSION +1 -1
  8. data/deepl-rb.gemspec +75 -88
  9. data/lib/deepl/admin_client.rb +208 -0
  10. data/lib/deepl/api.rb +18 -8
  11. data/lib/deepl/app_info.rb +19 -0
  12. data/lib/deepl/client.rb +1284 -0
  13. data/lib/deepl/configuration.rb +27 -32
  14. data/lib/deepl/constants/admin_usage_group_by.rb +13 -0
  15. data/lib/deepl/constants/custom_tag_usage_aggregate_by.rb +13 -0
  16. data/lib/deepl/constants/document_status_code.rb +17 -0
  17. data/lib/deepl/constants/language_include.rb +17 -0
  18. data/lib/deepl/constants/language_resource_name.rb +21 -0
  19. data/lib/deepl/constants/tag_handling_version.rb +14 -0
  20. data/lib/deepl/exceptions/authorization_failed.rb +1 -1
  21. data/lib/deepl/exceptions/bad_request.rb +1 -3
  22. data/lib/deepl/exceptions/connection_error.rb +40 -0
  23. data/lib/deepl/exceptions/document_not_ready_error.rb +17 -0
  24. data/lib/deepl/exceptions/document_translation_error.rb +17 -1
  25. data/lib/deepl/exceptions/error.rb +13 -1
  26. data/lib/deepl/exceptions/limit_exceeded.rb +1 -1
  27. data/lib/deepl/exceptions/not_found.rb +8 -3
  28. data/lib/deepl/exceptions/quota_exceeded.rb +1 -1
  29. data/lib/deepl/exceptions/request_entity_too_large.rb +1 -2
  30. data/lib/deepl/exceptions/request_error.rb +26 -2
  31. data/lib/deepl/exceptions/server_error.rb +9 -2
  32. data/lib/deepl/exceptions/translation_memory_job_error.rb +32 -0
  33. data/lib/deepl/exceptions/validation_error.rb +15 -0
  34. data/lib/deepl/requests/admin/base.rb +94 -0
  35. data/lib/deepl/requests/admin/create_developer_key.rb +38 -0
  36. data/lib/deepl/requests/admin/custom_tag_usage_analytics.rb +38 -0
  37. data/lib/deepl/requests/admin/list_developer_keys.rb +28 -0
  38. data/lib/deepl/requests/admin/update_developer_key.rb +35 -0
  39. data/lib/deepl/requests/admin/usage_analytics.rb +36 -0
  40. data/lib/deepl/requests/base.rb +313 -65
  41. data/lib/deepl/requests/correct.rb +51 -0
  42. data/lib/deepl/requests/document/download.rb +11 -3
  43. data/lib/deepl/requests/document/get_status.rb +2 -2
  44. data/lib/deepl/requests/document/upload.rb +56 -20
  45. data/lib/deepl/requests/glossary/base.rb +30 -0
  46. data/lib/deepl/requests/glossary/create.rb +18 -18
  47. data/lib/deepl/requests/glossary/destroy.rb +4 -16
  48. data/lib/deepl/requests/glossary/entries.rb +6 -14
  49. data/lib/deepl/requests/glossary/find.rb +3 -13
  50. data/lib/deepl/requests/glossary/language_pairs.rb +22 -6
  51. data/lib/deepl/requests/glossary/list.rb +2 -2
  52. data/lib/deepl/requests/language_resources.rb +41 -0
  53. data/lib/deepl/requests/languages.rb +25 -6
  54. data/lib/deepl/requests/languages_for_resource.rb +56 -0
  55. data/lib/deepl/requests/multilingual_glossary/create.rb +45 -0
  56. data/lib/deepl/requests/multilingual_glossary/destroy.rb +36 -0
  57. data/lib/deepl/requests/multilingual_glossary/destroy_dictionary.rb +55 -0
  58. data/lib/deepl/requests/multilingual_glossary/entries.rb +68 -0
  59. data/lib/deepl/requests/multilingual_glossary/find.rb +35 -0
  60. data/lib/deepl/requests/multilingual_glossary/helpers.rb +71 -0
  61. data/lib/deepl/requests/multilingual_glossary/list.rb +39 -0
  62. data/lib/deepl/requests/multilingual_glossary/replace_dictionary.rb +41 -0
  63. data/lib/deepl/requests/multilingual_glossary/update.rb +40 -0
  64. data/lib/deepl/requests/rephrase.rb +8 -10
  65. data/lib/deepl/requests/spoken_terms/create.rb +42 -0
  66. data/lib/deepl/requests/spoken_terms/destroy.rb +36 -0
  67. data/lib/deepl/requests/spoken_terms/destroy_term_list.rb +42 -0
  68. data/lib/deepl/requests/spoken_terms/entries.rb +47 -0
  69. data/lib/deepl/requests/spoken_terms/find.rb +35 -0
  70. data/lib/deepl/requests/spoken_terms/helpers.rb +74 -0
  71. data/lib/deepl/requests/spoken_terms/list.rb +35 -0
  72. data/lib/deepl/requests/spoken_terms/replace_term_list.rb +41 -0
  73. data/lib/deepl/requests/spoken_terms/update.rb +40 -0
  74. data/lib/deepl/requests/style_profile/base.rb +83 -0
  75. data/lib/deepl/requests/style_profile/create.rb +40 -0
  76. data/lib/deepl/requests/style_profile/destroy.rb +34 -0
  77. data/lib/deepl/requests/style_profile/find.rb +33 -0
  78. data/lib/deepl/requests/style_profile/list.rb +43 -0
  79. data/lib/deepl/requests/style_profile/update.rb +35 -0
  80. data/lib/deepl/requests/style_rule/create.rb +24 -0
  81. data/lib/deepl/requests/style_rule/create_custom_instruction.rb +11 -2
  82. data/lib/deepl/requests/style_rule/destroy.rb +4 -2
  83. data/lib/deepl/requests/style_rule/destroy_custom_instruction.rb +5 -3
  84. data/lib/deepl/requests/style_rule/find.rb +4 -2
  85. data/lib/deepl/requests/style_rule/find_custom_instruction.rb +5 -3
  86. data/lib/deepl/requests/style_rule/helpers.rb +44 -0
  87. data/lib/deepl/requests/style_rule/list.rb +3 -1
  88. data/lib/deepl/requests/style_rule/update.rb +5 -2
  89. data/lib/deepl/requests/style_rule/update_configured_rules.rb +4 -2
  90. data/lib/deepl/requests/style_rule/update_custom_instruction.rb +7 -3
  91. data/lib/deepl/requests/translate.rb +43 -27
  92. data/lib/deepl/requests/translation_memory/base.rb +1 -4
  93. data/lib/deepl/requests/translation_memory/create_export.rb +7 -2
  94. data/lib/deepl/requests/translation_memory/create_import.rb +11 -1
  95. data/lib/deepl/requests/translation_memory/destroy.rb +1 -1
  96. data/lib/deepl/requests/translation_memory/find.rb +1 -1
  97. data/lib/deepl/requests/translation_memory/find_job.rb +1 -1
  98. data/lib/deepl/requests/translation_memory/list.rb +4 -3
  99. data/lib/deepl/requests/translation_memory/segments.rb +5 -4
  100. data/lib/deepl/requests/translation_memory/storage_base.rb +37 -9
  101. data/lib/deepl/requests/translation_memory/upload_file.rb +1 -1
  102. data/lib/deepl/requests/usage.rb +28 -1
  103. data/lib/deepl/requests/write_improvements.rb +42 -0
  104. data/lib/deepl/resources/admin_usage_report.rb +73 -0
  105. data/lib/deepl/resources/custom_tag_usage_report.rb +59 -0
  106. data/lib/deepl/resources/developer_key.rb +57 -0
  107. data/lib/deepl/resources/document_handle.rb +8 -34
  108. data/lib/deepl/resources/document_translation_status.rb +14 -7
  109. data/lib/deepl/resources/language.rb +5 -3
  110. data/lib/deepl/resources/language_resource.rb +57 -0
  111. data/lib/deepl/resources/language_support.rb +56 -0
  112. data/lib/deepl/resources/multilingual_glossary.rb +112 -0
  113. data/lib/deepl/resources/spoken_terms.rb +61 -0
  114. data/lib/deepl/resources/style_profile.rb +44 -0
  115. data/lib/deepl/resources/style_rule.rb +4 -23
  116. data/lib/deepl/resources/text.rb +18 -2
  117. data/lib/deepl/resources/translation_memory.rb +8 -2
  118. data/lib/deepl/resources/translation_memory_import.rb +1 -1
  119. data/lib/deepl/resources/translation_memory_job.rb +26 -7
  120. data/lib/deepl/resources/translation_memory_segments.rb +8 -6
  121. data/lib/deepl/resources/usage.rb +61 -5
  122. data/lib/deepl/utils/client_builder.rb +89 -0
  123. data/lib/deepl/utils/document_poller.rb +70 -0
  124. data/lib/deepl/utils/exception_builder.rb +3 -2
  125. data/lib/deepl/utils/glossary_entries.rb +30 -0
  126. data/lib/deepl/utils/http_client_builder.rb +116 -0
  127. data/lib/deepl/utils/number_parser.rb +34 -0
  128. data/lib/deepl/utils/output_path.rb +25 -0
  129. data/lib/deepl/utils/term_validator.rb +33 -0
  130. data/lib/deepl/utils/time_parser.rb +14 -0
  131. data/lib/deepl/utils/translation_memory_operations.rb +230 -0
  132. data/lib/deepl.rb +68 -108
  133. data/lib/http_client_options.rb +21 -1
  134. data/lib/version.rb +1 -1
  135. data/upgrading_to_v4.md +374 -0
  136. metadata +84 -85
  137. data/.circleci/config.yml +0 -27
  138. data/.github/workflows/add_issues_to_kanban.yml +0 -16
  139. data/.gitlab-ci.yml +0 -179
  140. data/lib/deepl/document_api.rb +0 -131
  141. data/lib/deepl/exceptions/not_supported.rb +0 -14
  142. data/lib/deepl/glossary_api.rb +0 -38
  143. data/lib/deepl/style_rule_api.rb +0 -61
  144. data/lib/deepl/translation_memory_api.rb +0 -309
  145. data/license_checker.sh +0 -8
  146. data/spec/api/api_spec.rb +0 -20
  147. data/spec/api/configuration_spec.rb +0 -122
  148. data/spec/api/deepl_spec.rb +0 -262
  149. data/spec/constants/constants_spec.rb +0 -158
  150. data/spec/integration_tests/document_api_spec.rb +0 -211
  151. data/spec/integration_tests/document_error_paths_spec.rb +0 -33
  152. data/spec/integration_tests/glossary_api_spec.rb +0 -114
  153. data/spec/integration_tests/glossary_error_paths_spec.rb +0 -107
  154. data/spec/integration_tests/integration_test_utils.rb +0 -178
  155. data/spec/integration_tests/languages_api_spec.rb +0 -54
  156. data/spec/integration_tests/languages_error_paths_spec.rb +0 -25
  157. data/spec/integration_tests/rephrase_api_spec.rb +0 -90
  158. data/spec/integration_tests/rephrase_error_paths_spec.rb +0 -53
  159. data/spec/integration_tests/smoke_test_spec.rb +0 -24
  160. data/spec/integration_tests/style_rule_api_spec.rb +0 -117
  161. data/spec/integration_tests/style_rule_error_paths_spec.rb +0 -45
  162. data/spec/integration_tests/translate_api_spec.rb +0 -117
  163. data/spec/integration_tests/translate_error_paths_spec.rb +0 -48
  164. data/spec/integration_tests/translation_memory_api_spec.rb +0 -244
  165. data/spec/integration_tests/translation_memory_error_paths_spec.rb +0 -87
  166. data/spec/integration_tests/usage_api_spec.rb +0 -29
  167. data/spec/integration_tests/usage_error_paths_spec.rb +0 -18
  168. data/spec/requests/document/upload_spec.rb +0 -130
  169. data/spec/requests/extra_body_parameters_types_spec.rb +0 -82
  170. data/spec/requests/glossary/create_spec.rb +0 -44
  171. data/spec/requests/glossary/destroy_spec.rb +0 -27
  172. data/spec/requests/glossary/entries_spec.rb +0 -27
  173. data/spec/requests/glossary/find_spec.rb +0 -28
  174. data/spec/requests/glossary/language_pairs_spec.rb +0 -27
  175. data/spec/requests/glossary/list_spec.rb +0 -27
  176. data/spec/requests/languages_spec.rb +0 -27
  177. data/spec/requests/rephrase_spec.rb +0 -46
  178. data/spec/requests/style_rule/create_custom_instruction_spec.rb +0 -30
  179. data/spec/requests/style_rule/create_spec.rb +0 -29
  180. data/spec/requests/style_rule/destroy_custom_instruction_spec.rb +0 -28
  181. data/spec/requests/style_rule/destroy_spec.rb +0 -27
  182. data/spec/requests/style_rule/find_custom_instruction_spec.rb +0 -29
  183. data/spec/requests/style_rule/find_spec.rb +0 -28
  184. data/spec/requests/style_rule/list_spec.rb +0 -27
  185. data/spec/requests/style_rule/update_configured_rules_spec.rb +0 -31
  186. data/spec/requests/style_rule/update_custom_instruction_spec.rb +0 -32
  187. data/spec/requests/style_rule/update_spec.rb +0 -29
  188. data/spec/requests/translate_spec.rb +0 -338
  189. data/spec/requests/translation_memory/create_export_spec.rb +0 -37
  190. data/spec/requests/translation_memory/create_import_spec.rb +0 -61
  191. data/spec/requests/translation_memory/destroy_spec.rb +0 -36
  192. data/spec/requests/translation_memory/download_export_spec.rb +0 -54
  193. data/spec/requests/translation_memory/find_job_spec.rb +0 -37
  194. data/spec/requests/translation_memory/find_spec.rb +0 -36
  195. data/spec/requests/translation_memory/list_spec.rb +0 -27
  196. data/spec/requests/translation_memory/segments_spec.rb +0 -58
  197. data/spec/requests/translation_memory/upload_file_spec.rb +0 -55
  198. data/spec/requests/usage_spec.rb +0 -27
  199. data/spec/resources/custom_instruction_spec.rb +0 -32
  200. data/spec/resources/glossary_spec.rb +0 -38
  201. data/spec/resources/language_pair_spec.rb +0 -23
  202. data/spec/resources/language_spec.rb +0 -45
  203. data/spec/resources/style_rule_spec.rb +0 -68
  204. data/spec/resources/text_spec.rb +0 -23
  205. data/spec/resources/translation_memory_export_spec.rb +0 -38
  206. data/spec/resources/translation_memory_import_spec.rb +0 -30
  207. data/spec/resources/translation_memory_job_spec.rb +0 -109
  208. data/spec/resources/translation_memory_segments_spec.rb +0 -78
  209. data/spec/resources/translation_memory_spec.rb +0 -52
  210. data/spec/resources/usage_spec.rb +0 -35
  211. data/spec/spec_helper.rb +0 -62
  212. data/spec/support/live_mock_server.rb +0 -12
  213. data/spec/support/managed_glossary.rb +0 -65
  214. data/spec/support/managed_style_rule.rb +0 -17
  215. data/spec/support/managed_translation_memory.rb +0 -55
@@ -0,0 +1,374 @@
1
+ # Upgrading to 4.0.0
2
+
3
+ Version 4.0.0 removes everything that 3.10.0 deprecated, most of all the module-level API
4
+ (`DeepL.configure`, `DeepL.translate`, `DeepL.glossaries`, ...). If your code calls methods on
5
+ the `DeepL` module, it must move to `DeepL::Client`. Code that already uses `DeepL::Client`
6
+ needs smaller changes: stricter option and argument checks, different retry behaviour for calls
7
+ that create resources, and a few changed error classes and return values. Ruby 3.0 or later is
8
+ now required. The full list of changes is in the [CHANGELOG](CHANGELOG.md).
9
+
10
+ To find deprecated calls before you upgrade, run your tests on 3.10.0 and fix every deprecation
11
+ warning.
12
+
13
+ ## Requirements
14
+
15
+ - Ruby 3.0 or later. The gem declares `required_ruby_version >= 3.0`; on Ruby 2.x, stay on
16
+ deepl-rb 3.x.
17
+ - No runtime gem dependency was added or removed.
18
+ - An `https://` proxy needs net-http 0.5.0 or later (bundled with Ruby 3.4). On Ruby 3.0 to 3.3,
19
+ add `gem 'net-http', '>= 0.5'` to your Gemfile. See [Client and options](#client-and-options).
20
+
21
+ ## Quick checklist
22
+
23
+ 1. Replace `DeepL.configure` and the module-level calls with a `DeepL::Client`:
24
+ [Client and options](#client-and-options).
25
+ 2. Pass the key and server URL yourself; nothing reads `DEEPL_AUTH_KEY` or `DEEPL_SERVER_URL`:
26
+ [Client and options](#client-and-options).
27
+ 3. Rename `glossary_id:` to `glossary:` for text and document translation:
28
+ [Text translation](#text-translation).
29
+ 4. Fix misspelled options; unknown options now raise `ArgumentError`:
30
+ [Text translation](#text-translation).
31
+ 5. Move document, glossary, style rule and translation memory calls to the `Client` methods:
32
+ [Documents](#documents), [Glossaries](#glossaries), [Style rules](#style-rules),
33
+ [Translation memories](#translation-memories).
34
+ 6. Read usage through `usage.character`: [Usage](#usage).
35
+ 7. Rescue `DeepL::Exceptions::ConnectionError` for network failures, and `ArgumentError` for
36
+ invalid arguments: [Errors, validation and retries](#errors-validation-and-retries).
37
+ 8. Check your own retry logic around calls that create resources:
38
+ [Errors, validation and retries](#errors-validation-and-retries).
39
+ 9. Do not download into an existing file: [Documents](#documents),
40
+ [Translation memories](#translation-memories).
41
+ 10. Replace `configured_rules.numbers` with `configured_rules.fetch('numbers', {})`:
42
+ [Style rules](#style-rules).
43
+
44
+ ## Client and options
45
+
46
+ The module-level API is removed: `DeepL.configure`, `DeepL.configuration`, `DeepL.api`,
47
+ `DeepL.http_client`, `DeepL.with_session`, and the global configuration behind them.
48
+ `DeepL::Configuration` is no longer public. Each `DeepL::Client` owns its configuration and
49
+ connection.
50
+
51
+ ```ruby
52
+ # Before (3.x)
53
+ DeepL.configure do |config|
54
+ config.auth_key = 'your-key'
55
+ config.host = 'https://api.deepl.com'
56
+ end
57
+
58
+ # After
59
+ client = DeepL::Client.new('your-key', server_url: 'https://api.deepl.com')
60
+ ```
61
+
62
+ `DeepL::Client.new(auth_key, server_url:, headers:, max_retries:, timeout:, proxy:,
63
+ send_platform_info:, app_info:, http_client_options:, logger:)` replaces the old settings:
64
+
65
+ | Removed | Use |
66
+ | ------- | --- |
67
+ | `DeepL.with_session`, `DeepL.http_client`, `DeepL.api` | `proxy:` and `http_client_options:` |
68
+ | per-call `additional_headers` | `headers:` |
69
+ | `config.user_agent` | `app_info:`, `send_platform_info:`, or a `User-Agent` in `headers:` |
70
+ | `config.version=`, `config.max_doc_status_queries=` | removed without replacement |
71
+
72
+ Changes in behaviour:
73
+
74
+ - **No environment variables.** `DEEPL_AUTH_KEY` and `DEEPL_SERVER_URL` are no longer read.
75
+ ```ruby
76
+ client = DeepL::Client.new(ENV.fetch('DEEPL_AUTH_KEY'),
77
+ server_url: ENV.fetch('DEEPL_SERVER_URL', nil))
78
+ ```
79
+ - **Default timeout** is 10 seconds per attempt; the module-level API used 60 (`DeepL::Client`
80
+ already used 10). Pass `timeout: 60` to keep the old value.
81
+ - **`server_url`** must be an absolute `http` or `https` URL with a host, otherwise
82
+ `ArgumentError` is raised when the client is built. Trailing slashes are removed.
83
+ - **Proxy** must be an `http://` or `https://` URL (String or `URI`) or a hash with `proxy_addr`
84
+ and `proxy_port`. Any other scheme (for example `socks5://`) or value raises `ArgumentError`.
85
+ An `https` proxy is now connected to over TLS, which needs net-http 0.5.0 or later and an
86
+ `https` server URL. Before, it was used as a plain HTTP proxy. A proxy URL with an empty host
87
+ (`http://`, `http://:8080`) and a proxy hash with a blank `proxy_addr` raise `ArgumentError`
88
+ too. This applies to `Client.new`, `AdminClient.new` and `DeepL::HTTPClientOptions`.
89
+ - **`nil` means the default** for `max_retries:`, `timeout:` and `send_platform_info:` (5, 10
90
+ seconds, `true`), like an omitted keyword. Before, `timeout: nil` used Net::HTTP's 60-second
91
+ timeouts and `send_platform_info: nil` left the OS and Ruby versions out of the `User-Agent`.
92
+ Pass `send_platform_info: false` to leave them out.
93
+
94
+ ## Text translation
95
+
96
+ `DeepL.translate` and `DeepL.rephrase` are replaced by `Client#translate_text` and
97
+ `Client#rephrase_text`.
98
+
99
+ ```ruby
100
+ # Before (3.x)
101
+ DeepL.translate('Hello', 'EN', 'DE', formality: 'more')
102
+ DeepL.rephrase('Hello there', 'EN-US', 'business')
103
+
104
+ # After
105
+ client.translate_text('Hello', 'EN', 'DE', formality: 'more')
106
+ client.rephrase_text('Hello there', 'EN-US', writing_style: 'business')
107
+ ```
108
+
109
+ - `translate_text` returns an array when you pass an array, also an array with one element.
110
+ - `glossary_id:` is removed; use `glossary:`, which takes a glossary ID or a glossary object.
111
+ The same applies to document translation.
112
+ ```ruby
113
+ client.translate_text('Hello', 'EN', 'DE', glossary: glossary_id)
114
+ ```
115
+ - `show_billed_characters` is no longer accepted; the library always requests it.
116
+ - **Unknown options raise `ArgumentError`**, naming the option, before any request. Before, they
117
+ were sent as body fields (text, rephrase, correction, glossary, spoken terms, style rule and
118
+ style profile methods) or silently dropped (document translation, translation memory import).
119
+ Fix misspelled options, and send fields the library does not model with
120
+ `extra_body_parameters:`.
121
+ ```ruby
122
+ client.translate_text('Hello', 'EN', 'DE', extra_body_parameters: { new_field: 'value' })
123
+ ```
124
+ - `translate_text` and `rephrase_text` raise `ArgumentError` for an empty text (an empty string,
125
+ an empty array, or an array containing an empty string). `rephrase_text` and `correct_text`
126
+ raise it for `target_lang: ''`; `nil` still keeps the language of the text.
127
+ - `translate_text`, `translate_document` and `translate_document_upload` raise `ArgumentError`
128
+ for an empty or `nil` `target_lang`, an empty `source_lang` (pass `nil` to detect it), and a
129
+ `translation_memory_threshold` without `translation_memory` or outside 0 to 100
130
+ (`translate_document` wraps it in `DeepL::Exceptions::DocumentTranslationError`).
131
+ - The same three methods raise `ArgumentError` when `glossary`, `style_rule`, `style_profile` or
132
+ `translation_memory` is an empty ID or a resource object without its ID, or when
133
+ `glossary_ids` has an empty entry or a glossary without its ID (`translate_document` wraps it
134
+ in `DeepL::Exceptions::DocumentTranslationError`). Before, they were sent empty or as `null`.
135
+ `nil` for one of the four options still leaves it unset.
136
+
137
+ ## Documents
138
+
139
+ `DeepL.document` and `DeepL::DocumentApi` are removed. Use the `Client` methods.
140
+
141
+ ```ruby
142
+ # Before (3.x)
143
+ handle = DeepL.document.upload('in.docx', 'EN', 'DE', 'in.docx')
144
+ DeepL.document.get_status(handle)
145
+ handle.wait_until_document_translation_finished
146
+ DeepL.document.download(handle, 'out.docx')
147
+
148
+ # After
149
+ handle = client.translate_document_upload('in.docx', 'EN', 'DE', filename: 'in.docx')
150
+ status = client.translate_document_wait_until_done(handle)
151
+ client.translate_document_download(handle, 'out.docx')
152
+ ```
153
+
154
+ - `translate_document(input, output, source_lang, target_lang)` returns the final
155
+ `DeepL::Resources::DocumentTranslationStatus`, was the number of bytes written.
156
+ - `translate_document_download` returns `nil`.
157
+ - `DocumentHandle#wait_until_document_translation_finished` is removed; use
158
+ `Client#translate_document_wait_until_done`, which raises
159
+ `DeepL::Exceptions::Error` with the API's message if the translation fails or `timeout_s`
160
+ expires.
161
+ - `DocumentTranslationStatus#successful?` is removed; use `#done?`.
162
+ - `translate_document_download` no longer overwrites a file. Before the request it raises
163
+ `Errno::EEXIST` if `output_path` exists, and `Errno::ENOENT` or `Errno::EACCES` if its
164
+ directory is missing or not writable. Delete the old file first.
165
+ - `translate_document` checks the output path before uploading, so a bad path fails at once
166
+ instead of after the translation. It raises `DeepL::Exceptions::DocumentTranslationError`
167
+ (`document_handle` is `nil`) for an existing output file and for a directory that is missing
168
+ or not writable (the `SystemCallError` is its `cause`), and for an invalid upload argument,
169
+ such as an unknown option (the `ArgumentError` is its `cause`). A missing input file raises
170
+ `ArgumentError`, as `Client#translate_document` did in 3.10.0;
171
+ `DeepL.document.translate_document` raised `DeepL::Exceptions::DocumentTranslationError`.
172
+ - `translate_document_upload` raises `Errno::EISDIR` before any request if `input_path` is a
173
+ directory (`translate_document` wraps it in `DeepL::Exceptions::DocumentTranslationError`);
174
+ before, it raised `DeepL::Exceptions::ConnectionError`. Rescue `SystemCallError` for unreadable
175
+ input paths.
176
+ - The `glossary` option of document translation requires `source_lang`.
177
+ - A `nil` value in `extra_body_parameters` now removes that form field; before, it was sent
178
+ empty.
179
+
180
+ ## Glossaries
181
+
182
+ `DeepL.glossaries` and `DeepL::GlossaryApi` are removed. `DeepL::Client` has the v2 glossary
183
+ methods; for new code, prefer the multilingual glossary methods.
184
+
185
+ ```ruby
186
+ # Before (3.x)
187
+ glossary = DeepL.glossaries.create('My glossary', 'EN', 'DE', [%w[hello hallo]])
188
+ DeepL.glossaries.entries(glossary.id)
189
+ DeepL.glossaries.destroy(glossary.id)
190
+
191
+ # After
192
+ glossary = client.create_glossary('My glossary', 'EN', 'DE', { 'hello' => 'hallo' })
193
+ client.get_glossary_entries(glossary) # Hash of source term => target term
194
+ client.delete_glossary(glossary) # returns nil
195
+ ```
196
+
197
+ | Removed | Use |
198
+ | ------- | --- |
199
+ | `DeepL.glossaries.create` | `create_glossary` (entries as a Hash), `create_glossary_from_csv` |
200
+ | `.list`, `.find` | `list_glossaries`, `get_glossary` |
201
+ | `.entries` (pairs) | `get_glossary_entries` (Hash) |
202
+ | `.destroy` (returned the ID) | `delete_glossary` (returns `nil`) |
203
+ | `.language_pairs` | `get_glossary_languages` |
204
+
205
+ The multilingual glossary and spoken terms methods raise `ArgumentError` before any request for
206
+ an empty ID, a glossary or spoken terms object without an ID, an empty name, an empty
207
+ `source_lang` or `target_lang` of `delete_multilingual_glossary_dictionary`, an empty
208
+ `dictionaries` array, and dictionary entries or CSV content that are empty. The multilingual
209
+ glossary methods that take a dictionary and `get_multilingual_glossary_dictionary_entries` raise
210
+ it for a `nil` or empty `source_lang` or `target_lang`, and the spoken terms methods that take a
211
+ language for a `nil` or empty `lang`; before, the request was sent and the API rejected it.
212
+
213
+ `get_multilingual_glossary_dictionary_entries` raises `DeepL::Exceptions::NotFound` if the
214
+ glossary has no dictionary for the language pair. The API answers that with HTTP 404, and the
215
+ error has status 404 and the response. If the API answers 200 with no entries instead, the error
216
+ now has `http_status_code` `nil` and `response` `nil`; before, it carried status 200 and that
217
+ response. Check the error class, not the status.
218
+
219
+ ## Style rules
220
+
221
+ `DeepL.style_rules` and `DeepL::StyleRuleApi` are removed.
222
+
223
+ ```ruby
224
+ # Before (3.x)
225
+ rule = DeepL.style_rules.find(rule_id)
226
+ rule.configured_rules.numbers
227
+
228
+ # After
229
+ rule = client.get_style_rule(rule_id)
230
+ rule.configured_rules.fetch('numbers', {})
231
+ ```
232
+
233
+ - Use `get_all_style_rules`, `create_style_rule` and the other style rule methods of
234
+ `DeepL::Client`. They take `source_language:` as a keyword, and the delete methods return
235
+ `nil`.
236
+ - `StyleRule#configured_rules` is a Hash with string keys (category, rule, value), as the API
237
+ sends it, not a `ConfiguredRules` object. `DeepL::Resources::ConfiguredRules` is removed.
238
+ Absent categories are no longer filled with `{}`.
239
+ - The style rule methods raise `ArgumentError` before any request for an empty ID, a style rule
240
+ or custom instruction without an ID, and an empty name, language, label or prompt. An empty
241
+ `source_language` of `create_style_rule_custom_instruction`,
242
+ `update_style_rule_custom_instruction` or the `custom_instructions` of `create_style_rule`
243
+ raises it too; `nil` still leaves it out.
244
+
245
+ ## Translation memories
246
+
247
+ `DeepL.translation_memories` and `DeepL::TranslationMemoryApi` are removed. Use the translation
248
+ memory methods of `DeepL::Client` (`list_translation_memories`, ...).
249
+ A non-2xx reply of the upload or download URL raises `DeepL::Exceptions::Error` with
250
+ `http_status_code`.
251
+
252
+ - `create_translation_memory_import` and `import_translation_memory_from_filepath` take
253
+ `extra_body_parameters:` instead of `**options`; any other option raises `ArgumentError`.
254
+ ```ruby
255
+ client.import_translation_memory_from_filepath('tm.tmx', extra_body_parameters: { key: 'value' })
256
+ ```
257
+ - `download_translation_memory_export(job, output_path)` takes a
258
+ `DeepL::Resources::TranslationMemoryJob` instead of a download URL string. Pass the job
259
+ returned by `wait_until_translation_memory_job_done`.
260
+ ```ruby
261
+ # Before
262
+ client.download_translation_memory_export(job.result.download_url, 'out.tmx')
263
+ # After
264
+ client.download_translation_memory_export(job, 'out.tmx')
265
+ ```
266
+ - `download_translation_memory_export` and `export_translation_memory_to_filepath` no longer
267
+ overwrite an existing file. The first raises `Errno::EEXIST`, `Errno::ENOENT` or
268
+ `Errno::EACCES` before the request, and a write failure raises the `Errno` error, so rescue
269
+ `SystemCallError`, not only `DeepL::Exceptions::Error`.
270
+ - `import_translation_memory_from_filepath` and `export_translation_memory_to_filepath` wrap
271
+ every failure except a missing input file in the new
272
+ `DeepL::Exceptions::TranslationMemoryJobError` (a `DeepL::Exceptions::Error`), with the
273
+ original error as `cause`, plus `job_id` and `job`. An empty input file raises it too; before,
274
+ it raised `ArgumentError`.
275
+ - Methods raise `ArgumentError` instead of `DeepL::Exceptions::Error` for an empty translation
276
+ memory ID or job ID and an empty upload URL. An export job with an empty or no download URL
277
+ still raises `DeepL::Exceptions::Error`. `create_translation_memory_import` also rejects an
278
+ empty `file_name` and a `content_length` that is not positive.
279
+ - `TranslationMemoryJobResult::STATUS_DOWNLOADED` is removed (the API never sends it); use
280
+ `STATUS_COMPLETED` or `done?`. `TranslationMemoryJob#finished?` is `false` for `downloaded`.
281
+ - `create_translation_memory_export` sends no request body (`Content-Length: 0`).
282
+
283
+ ## Usage
284
+
285
+ `DeepL.usage` is replaced by `Client#get_usage`. The character counters moved into
286
+ `usage.character`.
287
+
288
+ ```ruby
289
+ # Before (3.x)
290
+ usage = DeepL.usage
291
+ usage.character_count
292
+ usage.character_limit
293
+ usage.quota_exceeded?
294
+ usage.any_limit_reached?
295
+
296
+ # After
297
+ usage = client.get_usage
298
+ usage.character.count
299
+ usage.character.limit
300
+ usage.character.limit_reached?
301
+ usage.any_character_limit_reached?
302
+ ```
303
+
304
+ - `any_character_limit_reached?` is `true` if the account's `character` limit or this API key's
305
+ `api_key_character` limit is reached. The speech minutes are not considered; check them with
306
+ `limit_reached?` on the detail.
307
+ - `Usage#document` and `Usage#team_document` are removed; the API no longer returns them.
308
+
309
+ ## Errors, validation and retries
310
+
311
+ - **Network failures** always raise `DeepL::Exceptions::ConnectionError`, with the original
312
+ error as `cause`. The removed module-level API raised the original error.
313
+ ```ruby
314
+ begin
315
+ client.get_usage
316
+ rescue DeepL::Exceptions::ConnectionError => e
317
+ warn e.cause.class
318
+ end
319
+ ```
320
+ - **`DeepL::Exceptions::ValidationError` is an `ArgumentError`**, no longer a
321
+ `DeepL::Exceptions::Error`. `rescue DeepL::Exceptions::Error` does not catch it; rescue
322
+ `ArgumentError` to catch every invalid argument.
323
+ - **`DeepL::Exceptions::NotSupported`** is removed; nothing raises it.
324
+ - **Retries of calls that create a resource.** `create_glossary`, `create_glossary_from_csv`,
325
+ `create_multilingual_glossary`, `create_multilingual_glossary_from_csv`, `create_spoken_terms`,
326
+ `create_style_rule`, `create_style_rule_custom_instruction`, `create_style_profile`, the
327
+ document upload, and the translation memory import and export job creation are retried only
328
+ when the request cannot have been processed: after HTTP 429 and transient network failures
329
+ while connecting, before the request is sent, such as DNS resolution errors, refused
330
+ connections, unreachable hosts or networks, connection timeouts and resets during the TLS or
331
+ proxy handshake. A 5xx reply raises `DeepL::Exceptions::ServerError` with `should_retry?`
332
+ `false` at once. If you retry these calls yourself, check first whether the resource was
333
+ created.
334
+ - `AdminClient#create_developer_key` is retried after the same connect failures. Before, it was
335
+ retried only after DNS resolution errors, refused connections and connection timeouts, and
336
+ raised `ConnectionError` at once for the others. Code that retries it itself now sees the
337
+ library's retries first.
338
+ - A response that fails after its headers arrived on such a request, `create_developer_key`
339
+ included, is not retried and raises `ConnectionError` with `should_retry?` `true` (body cut off
340
+ before its `Content-Length`, reset or read timeout). In 3.10.0 `create_developer_key` raised it
341
+ with `should_retry?` `false` and the other create requests retried it. A connection closed
342
+ before the response now has `should_retry?` `false`. Check first whether the resource was
343
+ created.
344
+ - **Messages** of `AuthorizationFailed`, `RequestEntityTooLarge`, `LimitExceeded`,
345
+ `QuotaExceeded` and `ServerError` now end with `: <API message>`, which replaces the final
346
+ period of the fixed text. Check the error class, not the message.
347
+ - `Language#supports_formality?` returns `nil` for a source language; for a source language of
348
+ the removed `DeepL.languages` it raised `NotSupported`. `DeepL.languages` is removed; use
349
+ `client.get_source_languages` or `client.get_target_languages`.
350
+
351
+ ## Types and signatures
352
+
353
+ - `AdminClient#set_developer_key_usage_limits` accepts only `characters:`,
354
+ `speech_to_text_milliseconds:` and `speech_to_speech_milliseconds:`; any other keyword raises
355
+ `ArgumentError`. Send other fields with `extra_body_parameters:`.
356
+ - Argument types are no longer checked by hand. `app_info:` of a type other than
357
+ `DeepL::AppInfo` or a Hash no longer raises `ArgumentError`, and a glossary entry whose terms
358
+ are not strings (for example `{ 'a' => 1 }`) no longer raises
359
+ `DeepL::Exceptions::ValidationError`; such a value fails as Ruby fails or is sent as its string
360
+ form. Value checks are unchanged. Pass the documented types.
361
+ - `Client#translate_document_download`, `#delete_glossary` and the style rule delete methods
362
+ return `nil`.
363
+
364
+ ## Internal classes
365
+
366
+ These classes were reachable but are not part of the public API. They changed or were removed:
367
+
368
+ - `DeepL::DocumentApi`, `DeepL::GlossaryApi`, `DeepL::StyleRuleApi`, `DeepL::TranslationMemoryApi`:
369
+ removed; their logic lives in `DeepL::Client`.
370
+ - `DeepL::Configuration`: no longer public; the setters are removed.
371
+ - `DeepL::API`: now holds the configuration and connection of one client; `#client?` and
372
+ `#update_http_client` are removed.
373
+ - `DeepL::Deprecation`: removed.
374
+ - `DeepL::Resources::ConfiguredRules`: removed.
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: deepl-rb
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.9.0
4
+ version: 4.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - DeepL SE
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2026-08-12 00:00:00.000000000 Z
11
+ date: 2026-11-24 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: juwelier
@@ -24,6 +24,20 @@ dependencies:
24
24
  - - ">="
25
25
  - !ruby/object:Gem::Version
26
26
  version: '0'
27
+ - !ruby/object:Gem::Dependency
28
+ name: git
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - "<"
32
+ - !ruby/object:Gem::Version
33
+ version: '6'
34
+ type: :development
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - "<"
39
+ - !ruby/object:Gem::Version
40
+ version: '6'
27
41
  - !ruby/object:Gem::Dependency
28
42
  name: byebug
29
43
  requirement: !ruby/object:Gem::Requirement
@@ -44,14 +58,9 @@ email: open-source@deepl.com
44
58
  executables: []
45
59
  extensions: []
46
60
  extra_rdoc_files:
47
- - CHANGELOG.md
48
61
  - LICENSE.md
49
62
  - README.md
50
- - license_checker.sh
51
63
  files:
52
- - ".circleci/config.yml"
53
- - ".github/workflows/add_issues_to_kanban.yml"
54
- - ".gitlab-ci.yml"
55
64
  - ".rubocop.yml"
56
65
  - CHANGELOG.md
57
66
  - CODE_OF_CONDUCT.md
@@ -64,46 +73,91 @@ files:
64
73
  - VERSION
65
74
  - deepl-rb.gemspec
66
75
  - lib/deepl.rb
76
+ - lib/deepl/admin_client.rb
67
77
  - lib/deepl/api.rb
78
+ - lib/deepl/app_info.rb
79
+ - lib/deepl/client.rb
68
80
  - lib/deepl/configuration.rb
81
+ - lib/deepl/constants/admin_usage_group_by.rb
69
82
  - lib/deepl/constants/base_constant.rb
83
+ - lib/deepl/constants/custom_tag_usage_aggregate_by.rb
84
+ - lib/deepl/constants/document_status_code.rb
70
85
  - lib/deepl/constants/formality.rb
86
+ - lib/deepl/constants/language_include.rb
87
+ - lib/deepl/constants/language_resource_name.rb
71
88
  - lib/deepl/constants/model_type.rb
72
89
  - lib/deepl/constants/split_sentences.rb
73
90
  - lib/deepl/constants/tag_handling.rb
91
+ - lib/deepl/constants/tag_handling_version.rb
74
92
  - lib/deepl/constants/tone.rb
75
93
  - lib/deepl/constants/writing_style.rb
76
- - lib/deepl/document_api.rb
77
94
  - lib/deepl/exceptions/authorization_failed.rb
78
95
  - lib/deepl/exceptions/bad_request.rb
96
+ - lib/deepl/exceptions/connection_error.rb
97
+ - lib/deepl/exceptions/document_not_ready_error.rb
79
98
  - lib/deepl/exceptions/document_translation_error.rb
80
99
  - lib/deepl/exceptions/error.rb
81
100
  - lib/deepl/exceptions/limit_exceeded.rb
82
101
  - lib/deepl/exceptions/not_found.rb
83
- - lib/deepl/exceptions/not_supported.rb
84
102
  - lib/deepl/exceptions/quota_exceeded.rb
85
103
  - lib/deepl/exceptions/request_entity_too_large.rb
86
104
  - lib/deepl/exceptions/request_error.rb
87
105
  - lib/deepl/exceptions/server_error.rb
88
- - lib/deepl/glossary_api.rb
106
+ - lib/deepl/exceptions/translation_memory_job_error.rb
107
+ - lib/deepl/exceptions/validation_error.rb
108
+ - lib/deepl/requests/admin/base.rb
109
+ - lib/deepl/requests/admin/create_developer_key.rb
110
+ - lib/deepl/requests/admin/custom_tag_usage_analytics.rb
111
+ - lib/deepl/requests/admin/list_developer_keys.rb
112
+ - lib/deepl/requests/admin/update_developer_key.rb
113
+ - lib/deepl/requests/admin/usage_analytics.rb
89
114
  - lib/deepl/requests/base.rb
115
+ - lib/deepl/requests/correct.rb
90
116
  - lib/deepl/requests/document/download.rb
91
117
  - lib/deepl/requests/document/get_status.rb
92
118
  - lib/deepl/requests/document/upload.rb
119
+ - lib/deepl/requests/glossary/base.rb
93
120
  - lib/deepl/requests/glossary/create.rb
94
121
  - lib/deepl/requests/glossary/destroy.rb
95
122
  - lib/deepl/requests/glossary/entries.rb
96
123
  - lib/deepl/requests/glossary/find.rb
97
124
  - lib/deepl/requests/glossary/language_pairs.rb
98
125
  - lib/deepl/requests/glossary/list.rb
126
+ - lib/deepl/requests/language_resources.rb
99
127
  - lib/deepl/requests/languages.rb
128
+ - lib/deepl/requests/languages_for_resource.rb
129
+ - lib/deepl/requests/multilingual_glossary/create.rb
130
+ - lib/deepl/requests/multilingual_glossary/destroy.rb
131
+ - lib/deepl/requests/multilingual_glossary/destroy_dictionary.rb
132
+ - lib/deepl/requests/multilingual_glossary/entries.rb
133
+ - lib/deepl/requests/multilingual_glossary/find.rb
134
+ - lib/deepl/requests/multilingual_glossary/helpers.rb
135
+ - lib/deepl/requests/multilingual_glossary/list.rb
136
+ - lib/deepl/requests/multilingual_glossary/replace_dictionary.rb
137
+ - lib/deepl/requests/multilingual_glossary/update.rb
100
138
  - lib/deepl/requests/rephrase.rb
139
+ - lib/deepl/requests/spoken_terms/create.rb
140
+ - lib/deepl/requests/spoken_terms/destroy.rb
141
+ - lib/deepl/requests/spoken_terms/destroy_term_list.rb
142
+ - lib/deepl/requests/spoken_terms/entries.rb
143
+ - lib/deepl/requests/spoken_terms/find.rb
144
+ - lib/deepl/requests/spoken_terms/helpers.rb
145
+ - lib/deepl/requests/spoken_terms/list.rb
146
+ - lib/deepl/requests/spoken_terms/replace_term_list.rb
147
+ - lib/deepl/requests/spoken_terms/update.rb
148
+ - lib/deepl/requests/style_profile/base.rb
149
+ - lib/deepl/requests/style_profile/create.rb
150
+ - lib/deepl/requests/style_profile/destroy.rb
151
+ - lib/deepl/requests/style_profile/find.rb
152
+ - lib/deepl/requests/style_profile/list.rb
153
+ - lib/deepl/requests/style_profile/update.rb
101
154
  - lib/deepl/requests/style_rule/create.rb
102
155
  - lib/deepl/requests/style_rule/create_custom_instruction.rb
103
156
  - lib/deepl/requests/style_rule/destroy.rb
104
157
  - lib/deepl/requests/style_rule/destroy_custom_instruction.rb
105
158
  - lib/deepl/requests/style_rule/find.rb
106
159
  - lib/deepl/requests/style_rule/find_custom_instruction.rb
160
+ - lib/deepl/requests/style_rule/helpers.rb
107
161
  - lib/deepl/requests/style_rule/list.rb
108
162
  - lib/deepl/requests/style_rule/update.rb
109
163
  - lib/deepl/requests/style_rule/update_configured_rules.rb
@@ -121,12 +175,21 @@ files:
121
175
  - lib/deepl/requests/translation_memory/storage_base.rb
122
176
  - lib/deepl/requests/translation_memory/upload_file.rb
123
177
  - lib/deepl/requests/usage.rb
178
+ - lib/deepl/requests/write_improvements.rb
179
+ - lib/deepl/resources/admin_usage_report.rb
124
180
  - lib/deepl/resources/base.rb
181
+ - lib/deepl/resources/custom_tag_usage_report.rb
182
+ - lib/deepl/resources/developer_key.rb
125
183
  - lib/deepl/resources/document_handle.rb
126
184
  - lib/deepl/resources/document_translation_status.rb
127
185
  - lib/deepl/resources/glossary.rb
128
186
  - lib/deepl/resources/language.rb
129
187
  - lib/deepl/resources/language_pair.rb
188
+ - lib/deepl/resources/language_resource.rb
189
+ - lib/deepl/resources/language_support.rb
190
+ - lib/deepl/resources/multilingual_glossary.rb
191
+ - lib/deepl/resources/spoken_terms.rb
192
+ - lib/deepl/resources/style_profile.rb
130
193
  - lib/deepl/resources/style_rule.rb
131
194
  - lib/deepl/resources/text.rb
132
195
  - lib/deepl/resources/translation_memory.rb
@@ -135,84 +198,20 @@ files:
135
198
  - lib/deepl/resources/translation_memory_job.rb
136
199
  - lib/deepl/resources/translation_memory_segments.rb
137
200
  - lib/deepl/resources/usage.rb
138
- - lib/deepl/style_rule_api.rb
139
- - lib/deepl/translation_memory_api.rb
140
201
  - lib/deepl/utils/backoff_timer.rb
202
+ - lib/deepl/utils/client_builder.rb
203
+ - lib/deepl/utils/document_poller.rb
141
204
  - lib/deepl/utils/exception_builder.rb
205
+ - lib/deepl/utils/glossary_entries.rb
206
+ - lib/deepl/utils/http_client_builder.rb
207
+ - lib/deepl/utils/number_parser.rb
208
+ - lib/deepl/utils/output_path.rb
209
+ - lib/deepl/utils/term_validator.rb
142
210
  - lib/deepl/utils/time_parser.rb
211
+ - lib/deepl/utils/translation_memory_operations.rb
143
212
  - lib/http_client_options.rb
144
213
  - lib/version.rb
145
- - license_checker.sh
146
- - spec/api/api_spec.rb
147
- - spec/api/configuration_spec.rb
148
- - spec/api/deepl_spec.rb
149
- - spec/constants/constants_spec.rb
150
- - spec/integration_tests/document_api_spec.rb
151
- - spec/integration_tests/document_error_paths_spec.rb
152
- - spec/integration_tests/glossary_api_spec.rb
153
- - spec/integration_tests/glossary_error_paths_spec.rb
154
- - spec/integration_tests/integration_test_utils.rb
155
- - spec/integration_tests/languages_api_spec.rb
156
- - spec/integration_tests/languages_error_paths_spec.rb
157
- - spec/integration_tests/rephrase_api_spec.rb
158
- - spec/integration_tests/rephrase_error_paths_spec.rb
159
- - spec/integration_tests/smoke_test_spec.rb
160
- - spec/integration_tests/style_rule_api_spec.rb
161
- - spec/integration_tests/style_rule_error_paths_spec.rb
162
- - spec/integration_tests/translate_api_spec.rb
163
- - spec/integration_tests/translate_error_paths_spec.rb
164
- - spec/integration_tests/translation_memory_api_spec.rb
165
- - spec/integration_tests/translation_memory_error_paths_spec.rb
166
- - spec/integration_tests/usage_api_spec.rb
167
- - spec/integration_tests/usage_error_paths_spec.rb
168
- - spec/requests/document/upload_spec.rb
169
- - spec/requests/extra_body_parameters_types_spec.rb
170
- - spec/requests/glossary/create_spec.rb
171
- - spec/requests/glossary/destroy_spec.rb
172
- - spec/requests/glossary/entries_spec.rb
173
- - spec/requests/glossary/find_spec.rb
174
- - spec/requests/glossary/language_pairs_spec.rb
175
- - spec/requests/glossary/list_spec.rb
176
- - spec/requests/languages_spec.rb
177
- - spec/requests/rephrase_spec.rb
178
- - spec/requests/style_rule/create_custom_instruction_spec.rb
179
- - spec/requests/style_rule/create_spec.rb
180
- - spec/requests/style_rule/destroy_custom_instruction_spec.rb
181
- - spec/requests/style_rule/destroy_spec.rb
182
- - spec/requests/style_rule/find_custom_instruction_spec.rb
183
- - spec/requests/style_rule/find_spec.rb
184
- - spec/requests/style_rule/list_spec.rb
185
- - spec/requests/style_rule/update_configured_rules_spec.rb
186
- - spec/requests/style_rule/update_custom_instruction_spec.rb
187
- - spec/requests/style_rule/update_spec.rb
188
- - spec/requests/translate_spec.rb
189
- - spec/requests/translation_memory/create_export_spec.rb
190
- - spec/requests/translation_memory/create_import_spec.rb
191
- - spec/requests/translation_memory/destroy_spec.rb
192
- - spec/requests/translation_memory/download_export_spec.rb
193
- - spec/requests/translation_memory/find_job_spec.rb
194
- - spec/requests/translation_memory/find_spec.rb
195
- - spec/requests/translation_memory/list_spec.rb
196
- - spec/requests/translation_memory/segments_spec.rb
197
- - spec/requests/translation_memory/upload_file_spec.rb
198
- - spec/requests/usage_spec.rb
199
- - spec/resources/custom_instruction_spec.rb
200
- - spec/resources/glossary_spec.rb
201
- - spec/resources/language_pair_spec.rb
202
- - spec/resources/language_spec.rb
203
- - spec/resources/style_rule_spec.rb
204
- - spec/resources/text_spec.rb
205
- - spec/resources/translation_memory_export_spec.rb
206
- - spec/resources/translation_memory_import_spec.rb
207
- - spec/resources/translation_memory_job_spec.rb
208
- - spec/resources/translation_memory_segments_spec.rb
209
- - spec/resources/translation_memory_spec.rb
210
- - spec/resources/usage_spec.rb
211
- - spec/spec_helper.rb
212
- - spec/support/live_mock_server.rb
213
- - spec/support/managed_glossary.rb
214
- - spec/support/managed_style_rule.rb
215
- - spec/support/managed_translation_memory.rb
214
+ - upgrading_to_v4.md
216
215
  homepage: https://github.com/DeepLcom/deepl-rb
217
216
  licenses:
218
217
  - MIT
@@ -229,14 +228,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
229
228
  requirements:
230
229
  - - ">="
231
230
  - !ruby/object:Gem::Version
232
- version: '0'
231
+ version: '3.0'
233
232
  required_rubygems_version: !ruby/object:Gem::Requirement
234
233
  requirements:
235
234
  - - ">="
236
235
  - !ruby/object:Gem::Version
237
236
  version: '0'
238
237
  requirements: []
239
- rubygems_version: 3.4.10
238
+ rubygems_version: 3.5.22
240
239
  signing_key:
241
240
  specification_version: 4
242
241
  summary: Official Ruby library for the DeepL language translation API.
data/.circleci/config.yml DELETED
@@ -1,27 +0,0 @@
1
- version: 2
2
- jobs:
3
- build:
4
- working_directory: ~/deepl-rb
5
- docker:
6
- - image: circleci/ruby:2.7
7
- steps:
8
- - checkout
9
-
10
- - run:
11
- name: Bundle Install
12
- command: bundle install --path vendor/bundle
13
-
14
- # Run rspec
15
- - type: shell
16
- command: |
17
- bundle exec rspec $(circleci tests glob "spec/**/*_spec.rb" |
18
- circleci tests split --split-by=timings)
19
-
20
- # Run rubocop
21
- - type: shell
22
- command: |
23
- bundle exec rubocop
24
-
25
- # Save test results for timing analysis
26
- - store_test_results:
27
- path: test_results