deepl-rb 3.2.0 → 3.4.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/CHANGELOG.md +46 -27
- data/README.md +71 -0
- metadata +3 -95
- data/.circleci/config.yml +0 -27
- data/.github/workflows/add_issues_to_kanban.yml +0 -16
- data/.gitlab-ci.yml +0 -135
- data/.rubocop.yml +0 -51
- data/CODE_OF_CONDUCT.md +0 -132
- data/CONTRIBUTING.md +0 -37
- data/Gemfile +0 -24
- data/Rakefile +0 -53
- data/SECURITY.md +0 -58
- data/VERSION +0 -1
- data/deepl-rb.gemspec +0 -132
- data/lib/deepl/api.rb +0 -22
- data/lib/deepl/configuration.rb +0 -59
- data/lib/deepl/constants/base_constant.rb +0 -18
- data/lib/deepl/constants/formality.rb +0 -16
- data/lib/deepl/constants/model_type.rb +0 -14
- data/lib/deepl/constants/split_sentences.rb +0 -14
- data/lib/deepl/constants/tag_handling.rb +0 -13
- data/lib/deepl/constants/tone.rb +0 -20
- data/lib/deepl/constants/writing_style.rb +0 -20
- data/lib/deepl/document_api.rb +0 -121
- data/lib/deepl/exceptions/authorization_failed.rb +0 -14
- data/lib/deepl/exceptions/bad_request.rb +0 -16
- data/lib/deepl/exceptions/document_translation_error.rb +0 -15
- data/lib/deepl/exceptions/error.rb +0 -14
- data/lib/deepl/exceptions/limit_exceeded.rb +0 -18
- data/lib/deepl/exceptions/not_found.rb +0 -16
- data/lib/deepl/exceptions/not_supported.rb +0 -14
- data/lib/deepl/exceptions/quota_exceeded.rb +0 -14
- data/lib/deepl/exceptions/request_entity_too_large.rb +0 -15
- data/lib/deepl/exceptions/request_error.rb +0 -21
- data/lib/deepl/exceptions/server_error.rb +0 -18
- data/lib/deepl/glossary_api.rb +0 -38
- data/lib/deepl/requests/base.rb +0 -163
- data/lib/deepl/requests/document/download.rb +0 -44
- data/lib/deepl/requests/document/get_status.rb +0 -44
- data/lib/deepl/requests/document/upload.rb +0 -64
- data/lib/deepl/requests/glossary/create.rb +0 -59
- data/lib/deepl/requests/glossary/destroy.rb +0 -37
- data/lib/deepl/requests/glossary/entries.rb +0 -37
- data/lib/deepl/requests/glossary/find.rb +0 -38
- data/lib/deepl/requests/glossary/language_pairs.rb +0 -38
- data/lib/deepl/requests/glossary/list.rb +0 -37
- data/lib/deepl/requests/languages.rb +0 -37
- data/lib/deepl/requests/rephrase.rb +0 -54
- data/lib/deepl/requests/translate.rb +0 -82
- data/lib/deepl/requests/usage.rb +0 -33
- data/lib/deepl/resources/base.rb +0 -17
- data/lib/deepl/resources/document_handle.rb +0 -57
- data/lib/deepl/resources/document_translation_status.rb +0 -54
- data/lib/deepl/resources/glossary.rb +0 -28
- data/lib/deepl/resources/language.rb +0 -30
- data/lib/deepl/resources/language_pair.rb +0 -23
- data/lib/deepl/resources/text.rb +0 -24
- data/lib/deepl/resources/usage.rb +0 -27
- data/lib/deepl/utils/backoff_timer.rb +0 -46
- data/lib/deepl/utils/exception_builder.rb +0 -34
- data/lib/deepl.rb +0 -142
- data/lib/http_client_options.rb +0 -22
- data/spec/api/api_spec.rb +0 -20
- data/spec/api/configuration_spec.rb +0 -122
- data/spec/api/deepl_spec.rb +0 -431
- data/spec/constants/constants_spec.rb +0 -158
- 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_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/translate_texts.yml +0 -10372
- data/spec/fixtures/vcr_cassettes/usage.yml +0 -171
- data/spec/integration_tests/document_api_spec.rb +0 -155
- data/spec/integration_tests/integration_test_utils.rb +0 -170
- data/spec/requests/glossary/create_spec.rb +0 -65
- data/spec/requests/glossary/destroy_spec.rb +0 -66
- data/spec/requests/glossary/entries_spec.rb +0 -62
- data/spec/requests/glossary/find_spec.rb +0 -68
- data/spec/requests/glossary/language_pairs_spec.rb +0 -40
- data/spec/requests/glossary/list_spec.rb +0 -54
- data/spec/requests/languages_spec.rb +0 -68
- data/spec/requests/rephrase_spec.rb +0 -172
- data/spec/requests/translate_spec.rb +0 -410
- data/spec/requests/usage_spec.rb +0 -43
- data/spec/resources/glossary_spec.rb +0 -38
- data/spec/resources/language_pair_spec.rb +0 -23
- data/spec/resources/language_spec.rb +0 -45
- data/spec/resources/text_spec.rb +0 -23
- data/spec/resources/usage_spec.rb +0 -35
- data/spec/spec_helper.rb +0 -92
data/CODE_OF_CONDUCT.md
DELETED
|
@@ -1,132 +0,0 @@
|
|
|
1
|
-
# Contributor Covenant Code of Conduct
|
|
2
|
-
|
|
3
|
-
## Our Pledge
|
|
4
|
-
|
|
5
|
-
We as members, contributors, and leaders pledge to make participation in our
|
|
6
|
-
community a harassment-free experience for everyone, regardless of age, body
|
|
7
|
-
size, visible or invisible disability, ethnicity, sex characteristics, gender
|
|
8
|
-
identity and expression, level of experience, education, socio-economic status,
|
|
9
|
-
nationality, personal appearance, race, caste, color, religion, or sexual
|
|
10
|
-
identity and orientation.
|
|
11
|
-
|
|
12
|
-
We pledge to act and interact in ways that contribute to an open, welcoming,
|
|
13
|
-
diverse, inclusive, and healthy community.
|
|
14
|
-
|
|
15
|
-
## Our Standards
|
|
16
|
-
|
|
17
|
-
Examples of behavior that contributes to a positive environment for our
|
|
18
|
-
community include:
|
|
19
|
-
|
|
20
|
-
* Demonstrating empathy and kindness toward other people
|
|
21
|
-
* Being respectful of differing opinions, viewpoints, and experiences
|
|
22
|
-
* Giving and gracefully accepting constructive feedback
|
|
23
|
-
* Accepting responsibility and apologizing to those affected by our mistakes,
|
|
24
|
-
and learning from the experience
|
|
25
|
-
* Focusing on what is best not just for us as individuals, but for the overall
|
|
26
|
-
community
|
|
27
|
-
|
|
28
|
-
Examples of unacceptable behavior include:
|
|
29
|
-
|
|
30
|
-
* The use of sexualized language or imagery, and sexual attention or advances of
|
|
31
|
-
any kind
|
|
32
|
-
* Trolling, insulting or derogatory comments, and personal or political attacks
|
|
33
|
-
* Public or private harassment
|
|
34
|
-
* Publishing others' private information, such as a physical or email address,
|
|
35
|
-
without their explicit permission
|
|
36
|
-
* Other conduct which could reasonably be considered inappropriate in a
|
|
37
|
-
professional setting
|
|
38
|
-
|
|
39
|
-
## Enforcement Responsibilities
|
|
40
|
-
|
|
41
|
-
Community leaders are responsible for clarifying and enforcing our standards of
|
|
42
|
-
acceptable behavior and will take appropriate and fair corrective action in
|
|
43
|
-
response to any behavior that they deem inappropriate, threatening, offensive,
|
|
44
|
-
or harmful.
|
|
45
|
-
|
|
46
|
-
Community leaders have the right and responsibility to remove, edit, or reject
|
|
47
|
-
comments, commits, code, wiki edits, issues, and other contributions that are
|
|
48
|
-
not aligned to this Code of Conduct, and will communicate reasons for moderation
|
|
49
|
-
decisions when appropriate.
|
|
50
|
-
|
|
51
|
-
## Scope
|
|
52
|
-
|
|
53
|
-
This Code of Conduct applies within all community spaces, and also applies when
|
|
54
|
-
an individual is officially representing the community in public spaces.
|
|
55
|
-
Examples of representing our community include using an official e-mail address,
|
|
56
|
-
posting via an official social media account, or acting as an appointed
|
|
57
|
-
representative at an online or offline event.
|
|
58
|
-
|
|
59
|
-
## Enforcement
|
|
60
|
-
|
|
61
|
-
Instances of abusive, harassing, or otherwise unacceptable behavior may be
|
|
62
|
-
reported to the community leaders responsible for enforcement at
|
|
63
|
-
[open-source@deepl.com](mailto:open-source@deepl.com).
|
|
64
|
-
All complaints will be reviewed and investigated promptly and fairly.
|
|
65
|
-
|
|
66
|
-
All community leaders are obligated to respect the privacy and security of the
|
|
67
|
-
reporter of any incident.
|
|
68
|
-
|
|
69
|
-
## Enforcement Guidelines
|
|
70
|
-
|
|
71
|
-
Community leaders will follow these Community Impact Guidelines in determining
|
|
72
|
-
the consequences for any action they deem in violation of this Code of Conduct:
|
|
73
|
-
|
|
74
|
-
### 1. Correction
|
|
75
|
-
|
|
76
|
-
**Community Impact**: Use of inappropriate language or other behavior deemed
|
|
77
|
-
unprofessional or unwelcome in the community.
|
|
78
|
-
|
|
79
|
-
**Consequence**: A private, written warning from community leaders, providing
|
|
80
|
-
clarity around the nature of the violation and an explanation of why the
|
|
81
|
-
behavior was inappropriate. A public apology may be requested.
|
|
82
|
-
|
|
83
|
-
### 2. Warning
|
|
84
|
-
|
|
85
|
-
**Community Impact**: A violation through a single incident or series of
|
|
86
|
-
actions.
|
|
87
|
-
|
|
88
|
-
**Consequence**: A warning with consequences for continued behavior. No
|
|
89
|
-
interaction with the people involved, including unsolicited interaction with
|
|
90
|
-
those enforcing the Code of Conduct, for a specified period of time. This
|
|
91
|
-
includes avoiding interactions in community spaces as well as external channels
|
|
92
|
-
like social media. Violating these terms may lead to a temporary or permanent
|
|
93
|
-
ban.
|
|
94
|
-
|
|
95
|
-
### 3. Temporary Ban
|
|
96
|
-
|
|
97
|
-
**Community Impact**: A serious violation of community standards, including
|
|
98
|
-
sustained inappropriate behavior.
|
|
99
|
-
|
|
100
|
-
**Consequence**: A temporary ban from any sort of interaction or public
|
|
101
|
-
communication with the community for a specified period of time. No public or
|
|
102
|
-
private interaction with the people involved, including unsolicited interaction
|
|
103
|
-
with those enforcing the Code of Conduct, is allowed during this period.
|
|
104
|
-
Violating these terms may lead to a permanent ban.
|
|
105
|
-
|
|
106
|
-
### 4. Permanent Ban
|
|
107
|
-
|
|
108
|
-
**Community Impact**: Demonstrating a pattern of violation of community
|
|
109
|
-
standards, including sustained inappropriate behavior, harassment of an
|
|
110
|
-
individual, or aggression toward or disparagement of classes of individuals.
|
|
111
|
-
|
|
112
|
-
**Consequence**: A permanent ban from any sort of public interaction within the
|
|
113
|
-
community.
|
|
114
|
-
|
|
115
|
-
## Attribution
|
|
116
|
-
|
|
117
|
-
This Code of Conduct is adapted from the [Contributor Covenant][homepage],
|
|
118
|
-
version 2.1, available at
|
|
119
|
-
[https://www.contributor-covenant.org/version/2/1/code_of_conduct.html][v2.1].
|
|
120
|
-
|
|
121
|
-
Community Impact Guidelines were inspired by
|
|
122
|
-
[Mozilla's code of conduct enforcement ladder][Mozilla CoC].
|
|
123
|
-
|
|
124
|
-
For answers to common questions about this code of conduct, see the FAQ at
|
|
125
|
-
[https://www.contributor-covenant.org/faq][FAQ]. Translations are available at
|
|
126
|
-
[https://www.contributor-covenant.org/translations][translations].
|
|
127
|
-
|
|
128
|
-
[homepage]: https://www.contributor-covenant.org
|
|
129
|
-
[v2.1]: https://www.contributor-covenant.org/version/2/1/code_of_conduct.html
|
|
130
|
-
[Mozilla CoC]: https://github.com/mozilla/diversity
|
|
131
|
-
[FAQ]: https://www.contributor-covenant.org/faq
|
|
132
|
-
[translations]: https://www.contributor-covenant.org/translations
|
data/CONTRIBUTING.md
DELETED
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
# Contributing guidelines
|
|
2
|
-
|
|
3
|
-
* [Code of Conduct](#code-of-conduct)
|
|
4
|
-
* [Issues](#issues)
|
|
5
|
-
* [Pull Requests](#pull-requests)
|
|
6
|
-
|
|
7
|
-
## Code of Conduct
|
|
8
|
-
|
|
9
|
-
This project has a [Code of Conduct](CODE_OF_CONDUCT.md) to which all
|
|
10
|
-
contributors must adhere when participating in the project. Instances of
|
|
11
|
-
abusive, harassing, or otherwise unacceptable behavior may be reported by
|
|
12
|
-
contacting [open-source@deepl.com](mailto:open-source@deepl.com) and/or a
|
|
13
|
-
project maintainer.
|
|
14
|
-
|
|
15
|
-
## Issues
|
|
16
|
-
|
|
17
|
-
If you experience problems using the library, or would like to request a new
|
|
18
|
-
feature, please open an [issue][issues].
|
|
19
|
-
|
|
20
|
-
Please provide as much context as possible when you open an issue. The
|
|
21
|
-
information you provide must be comprehensive enough for us to reproduce the
|
|
22
|
-
issue.
|
|
23
|
-
|
|
24
|
-
## Pull Requests
|
|
25
|
-
|
|
26
|
-
You are welcome to contribute code and/or documentation in order to fix a bug or
|
|
27
|
-
to implement a new feature. Before beginning work, you should create an issue
|
|
28
|
-
describing the changes you plan to contribute, to avoid wasting or duplicating
|
|
29
|
-
effort. We will then let you know whether we would accept the changes.
|
|
30
|
-
|
|
31
|
-
Contributions must be licensed under the same license as the project:
|
|
32
|
-
[MIT License](LICENSE.md).
|
|
33
|
-
|
|
34
|
-
Currently automated testing is implemented internally at DeepL, however we plan
|
|
35
|
-
to implement publicly visible testing soon.
|
|
36
|
-
|
|
37
|
-
[issues]: https://www.github.com/DeepLcom/deepl-rb/issues
|
data/Gemfile
DELETED
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
# frozen_string_literal: true
|
|
2
|
-
|
|
3
|
-
source 'https://rubygems.org'
|
|
4
|
-
|
|
5
|
-
group :development do
|
|
6
|
-
# Gem management
|
|
7
|
-
gem 'juwelier'
|
|
8
|
-
end
|
|
9
|
-
|
|
10
|
-
group :test, :development do
|
|
11
|
-
gem 'byebug', require: 'byebug'
|
|
12
|
-
end
|
|
13
|
-
|
|
14
|
-
group :test do
|
|
15
|
-
# Test
|
|
16
|
-
gem 'rspec'
|
|
17
|
-
gem 'rspec_junit_formatter'
|
|
18
|
-
gem 'rubocop'
|
|
19
|
-
gem 'rubocop-rspec'
|
|
20
|
-
gem 'simplecov'
|
|
21
|
-
gem 'simplecov-cobertura'
|
|
22
|
-
gem 'vcr'
|
|
23
|
-
gem 'webmock'
|
|
24
|
-
end
|
data/Rakefile
DELETED
|
@@ -1,53 +0,0 @@
|
|
|
1
|
-
# frozen_string_literal: true
|
|
2
|
-
|
|
3
|
-
require 'rubygems'
|
|
4
|
-
require 'bundler'
|
|
5
|
-
|
|
6
|
-
begin
|
|
7
|
-
Bundler.setup(:default, :development)
|
|
8
|
-
rescue Bundler::BundlerError => e
|
|
9
|
-
warn e.message
|
|
10
|
-
warn 'Run `bundle install` to install missing gems'
|
|
11
|
-
exit e.status_code
|
|
12
|
-
end
|
|
13
|
-
|
|
14
|
-
require 'rake'
|
|
15
|
-
require 'juwelier'
|
|
16
|
-
|
|
17
|
-
Juwelier::Tasks.new do |gem|
|
|
18
|
-
gem.name = 'deepl-rb'
|
|
19
|
-
gem.homepage = 'https://github.com/DeepLcom/deepl-rb'
|
|
20
|
-
gem.license = 'MIT'
|
|
21
|
-
gem.summary = 'Official Ruby library for the DeepL language translation API.'
|
|
22
|
-
gem.description =
|
|
23
|
-
'Official Ruby library for the DeepL language translation API (v2). ' \
|
|
24
|
-
'For more information, check this: https://www.deepl.com/docs/api-reference.html'
|
|
25
|
-
|
|
26
|
-
gem.email = 'open-source@deepl.com'
|
|
27
|
-
gem.authors = ['DeepL SE']
|
|
28
|
-
gem.metadata = {
|
|
29
|
-
'bug_tracker_uri' => 'https://github.com/DeepLcom/deepl-rb/issues',
|
|
30
|
-
'changelog_uri' => 'https://github.com/DeepLcom/deepl-rb/blob/main/CHANGELOG.md',
|
|
31
|
-
'documentation_uri' => 'https://github.com/DeepLcom/deepl-rb/blob/main/README.md',
|
|
32
|
-
'homepage_uri' => 'https://github.com/DeepLcom/deepl-rb'
|
|
33
|
-
}
|
|
34
|
-
gem.files.exclude '.github'
|
|
35
|
-
gem.files.exclude '.circleci'
|
|
36
|
-
end
|
|
37
|
-
|
|
38
|
-
Juwelier::RubygemsDotOrgTasks.new
|
|
39
|
-
|
|
40
|
-
# Tests
|
|
41
|
-
require 'rspec/core/rake_task'
|
|
42
|
-
require 'rubocop/rake_task'
|
|
43
|
-
|
|
44
|
-
RuboCop::RakeTask.new
|
|
45
|
-
RSpec::Core::RakeTask.new(:spec)
|
|
46
|
-
|
|
47
|
-
desc 'Run all tests.'
|
|
48
|
-
task :test do
|
|
49
|
-
Rake::Task['spec'].invoke
|
|
50
|
-
Rake::Task['rubocop'].invoke
|
|
51
|
-
end
|
|
52
|
-
|
|
53
|
-
task default: :test
|
data/SECURITY.md
DELETED
|
@@ -1,58 +0,0 @@
|
|
|
1
|
-
To report security concerns or vulnerabilities within deepl-rb, please email
|
|
2
|
-
us at [security@deepl.com](mailto:security@deepl.com).
|
|
3
|
-
|
|
4
|
-
You can send us PGP-encrypted email using the following PGP public key:
|
|
5
|
-
|
|
6
|
-
```
|
|
7
|
-
-----BEGIN PGP PUBLIC KEY BLOCK-----
|
|
8
|
-
|
|
9
|
-
mQINBF7WSmABEADzRUp22VY7bVfUWScKLi9o8BRSEL4u3aPn9WOQoRLQH0j3dNNQ
|
|
10
|
-
FQlwTPn/Ez6qreEl8mX0aE+eLCEykXqsrU/UaTSTslF+H6UQyuGLXkRm8Lblt93I
|
|
11
|
-
OEhL069fC7rm+/zJq72+hishBF8DXqa+WtFd8VfK3i211vRhU/teKeAKT0xiuN/5
|
|
12
|
-
EQl1Bn7jR7mmQtNbPBhCsAlaC/tNUQ3Lyj6LYnnco7ums5Q/gCvfs2HM3mXJyvnG
|
|
13
|
-
1MC2IrECPowTt04W3V1uXuMcm766orTG/AmtBIbPmOzao4sfqwRVHGvc8zcr1az9
|
|
14
|
-
0nVyEJXx1eUVRDU1GAQuMjEkGgwvTd+nt6sHpn8C+9hMYJhon9veDSupViBuvNRC
|
|
15
|
-
p1PnpSLYYy7tA7DPXMhP3cMXe+Z4bYzgwi3xjOwh6SDyB4OFIxtGyuMrLGfZnd6A
|
|
16
|
-
hDH4H9zHPpciD5MxcOaqlKdgABQALvc6MvJ1Guf1ckGTbfHz1brtR1LPMK8rrnNu
|
|
17
|
-
kwQzgkogYV6YAnt8LPXMPa2Vgy8TAiby7GPaATPeSWdNHtkuYGhWNVbnb60kEWiJ
|
|
18
|
-
/RgHFZYfRT1dEcKoQEcDJ7AV14urEFIAfmhlsT8h7iJYUQMa45BakUubi3aWwcme
|
|
19
|
-
ya+5WXvp2xU14VMfrscApA0e1v0VcTNVwlKambs/lwims0/xiSaXJS6gV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Fc+QxSYrs1W4ZEGnZ3+9utqzlEiMusy9Rq0T
|
|
49
|
-
/W/wrG6SckebjhrwWZJmy/hkW6V6LUX4++vCVV5+zwsvgEortCV8bhvLfqQDr/WN
|
|
50
|
-
fnmbNZtXJbyhTYbcYReOLeKidxO2lZEemnX6iOt5xCdoMcYU23xDT9+tE7Eh6Nfw
|
|
51
|
-
einZemBwfku5vxxPF73pOoQUCRq9tgvUrEq+3BqkqidhnFUOPi0J5726q1PBG65x
|
|
52
|
-
5o+SQyvB3NA3al3mEH65z3V3/g0UHnhGcEMwVOXBkffgdKNhWYw59qhSVQnkiq0U
|
|
53
|
-
MG10g/RL7VdiISAFPTDmKWUaEDYosinKqOMHwcaVdJq9ssvPf89et6yP/ZkbLIHs
|
|
54
|
-
2y3oiPonh2RMxi2OedlDz+Jp/A2o3qHmwNvBx/meGB0praGUonFVZTAA1EMS39Bi
|
|
55
|
-
NhG/L8giTyzA0mMkTJAPXtUVlRe5rEjORgYJsgRqZxEfpsJC9OkvYS4ayO0eCEs=
|
|
56
|
-
=jVHt
|
|
57
|
-
-----END PGP PUBLIC KEY BLOCK-----
|
|
58
|
-
```%
|
data/VERSION
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
3.2.0
|
data/deepl-rb.gemspec
DELETED
|
@@ -1,132 +0,0 @@
|
|
|
1
|
-
# Generated by juwelier
|
|
2
|
-
# DO NOT EDIT THIS FILE DIRECTLY
|
|
3
|
-
# Instead, edit Juwelier::Tasks in Rakefile, and run 'rake gemspec'
|
|
4
|
-
# -*- encoding: utf-8 -*-
|
|
5
|
-
# stub: deepl-rb 3.2.0 ruby lib
|
|
6
|
-
|
|
7
|
-
Gem::Specification.new do |s|
|
|
8
|
-
s.name = "deepl-rb".freeze
|
|
9
|
-
s.version = "3.2.0".freeze
|
|
10
|
-
|
|
11
|
-
s.required_rubygems_version = Gem::Requirement.new(">= 0".freeze) if s.respond_to? :required_rubygems_version=
|
|
12
|
-
s.metadata = { "bug_tracker_uri" => "https://github.com/DeepLcom/deepl-rb/issues", "changelog_uri" => "https://github.com/DeepLcom/deepl-rb/blob/main/CHANGELOG.md", "documentation_uri" => "https://github.com/DeepLcom/deepl-rb/blob/main/README.md", "homepage_uri" => "https://github.com/DeepLcom/deepl-rb" } if s.respond_to? :metadata=
|
|
13
|
-
s.require_paths = ["lib".freeze]
|
|
14
|
-
s.authors = ["DeepL SE".freeze]
|
|
15
|
-
s.date = "2025-01-15"
|
|
16
|
-
s.description = "Official Ruby library for the DeepL language translation API (v2). For more information, check this: https://www.deepl.com/docs/api-reference.html".freeze
|
|
17
|
-
s.email = "open-source@deepl.com".freeze
|
|
18
|
-
s.extra_rdoc_files = [
|
|
19
|
-
"CHANGELOG.md",
|
|
20
|
-
"LICENSE.md",
|
|
21
|
-
"README.md",
|
|
22
|
-
"license_checker.sh"
|
|
23
|
-
]
|
|
24
|
-
s.files = [
|
|
25
|
-
".circleci/config.yml",
|
|
26
|
-
".github/workflows/add_issues_to_kanban.yml",
|
|
27
|
-
".gitlab-ci.yml",
|
|
28
|
-
".rubocop.yml",
|
|
29
|
-
"CHANGELOG.md",
|
|
30
|
-
"CODE_OF_CONDUCT.md",
|
|
31
|
-
"CONTRIBUTING.md",
|
|
32
|
-
"Gemfile",
|
|
33
|
-
"LICENSE.md",
|
|
34
|
-
"README.md",
|
|
35
|
-
"Rakefile",
|
|
36
|
-
"SECURITY.md",
|
|
37
|
-
"VERSION",
|
|
38
|
-
"deepl-rb.gemspec",
|
|
39
|
-
"lib/deepl.rb",
|
|
40
|
-
"lib/deepl/api.rb",
|
|
41
|
-
"lib/deepl/configuration.rb",
|
|
42
|
-
"lib/deepl/constants/base_constant.rb",
|
|
43
|
-
"lib/deepl/constants/formality.rb",
|
|
44
|
-
"lib/deepl/constants/model_type.rb",
|
|
45
|
-
"lib/deepl/constants/split_sentences.rb",
|
|
46
|
-
"lib/deepl/constants/tag_handling.rb",
|
|
47
|
-
"lib/deepl/constants/tone.rb",
|
|
48
|
-
"lib/deepl/constants/writing_style.rb",
|
|
49
|
-
"lib/deepl/document_api.rb",
|
|
50
|
-
"lib/deepl/exceptions/authorization_failed.rb",
|
|
51
|
-
"lib/deepl/exceptions/bad_request.rb",
|
|
52
|
-
"lib/deepl/exceptions/document_translation_error.rb",
|
|
53
|
-
"lib/deepl/exceptions/error.rb",
|
|
54
|
-
"lib/deepl/exceptions/limit_exceeded.rb",
|
|
55
|
-
"lib/deepl/exceptions/not_found.rb",
|
|
56
|
-
"lib/deepl/exceptions/not_supported.rb",
|
|
57
|
-
"lib/deepl/exceptions/quota_exceeded.rb",
|
|
58
|
-
"lib/deepl/exceptions/request_entity_too_large.rb",
|
|
59
|
-
"lib/deepl/exceptions/request_error.rb",
|
|
60
|
-
"lib/deepl/exceptions/server_error.rb",
|
|
61
|
-
"lib/deepl/glossary_api.rb",
|
|
62
|
-
"lib/deepl/requests/base.rb",
|
|
63
|
-
"lib/deepl/requests/document/download.rb",
|
|
64
|
-
"lib/deepl/requests/document/get_status.rb",
|
|
65
|
-
"lib/deepl/requests/document/upload.rb",
|
|
66
|
-
"lib/deepl/requests/glossary/create.rb",
|
|
67
|
-
"lib/deepl/requests/glossary/destroy.rb",
|
|
68
|
-
"lib/deepl/requests/glossary/entries.rb",
|
|
69
|
-
"lib/deepl/requests/glossary/find.rb",
|
|
70
|
-
"lib/deepl/requests/glossary/language_pairs.rb",
|
|
71
|
-
"lib/deepl/requests/glossary/list.rb",
|
|
72
|
-
"lib/deepl/requests/languages.rb",
|
|
73
|
-
"lib/deepl/requests/rephrase.rb",
|
|
74
|
-
"lib/deepl/requests/translate.rb",
|
|
75
|
-
"lib/deepl/requests/usage.rb",
|
|
76
|
-
"lib/deepl/resources/base.rb",
|
|
77
|
-
"lib/deepl/resources/document_handle.rb",
|
|
78
|
-
"lib/deepl/resources/document_translation_status.rb",
|
|
79
|
-
"lib/deepl/resources/glossary.rb",
|
|
80
|
-
"lib/deepl/resources/language.rb",
|
|
81
|
-
"lib/deepl/resources/language_pair.rb",
|
|
82
|
-
"lib/deepl/resources/text.rb",
|
|
83
|
-
"lib/deepl/resources/usage.rb",
|
|
84
|
-
"lib/deepl/utils/backoff_timer.rb",
|
|
85
|
-
"lib/deepl/utils/exception_builder.rb",
|
|
86
|
-
"lib/http_client_options.rb",
|
|
87
|
-
"license_checker.sh",
|
|
88
|
-
"spec/api/api_spec.rb",
|
|
89
|
-
"spec/api/configuration_spec.rb",
|
|
90
|
-
"spec/api/deepl_spec.rb",
|
|
91
|
-
"spec/constants/constants_spec.rb",
|
|
92
|
-
"spec/fixtures/vcr_cassettes/deepl_document.yml",
|
|
93
|
-
"spec/fixtures/vcr_cassettes/deepl_document_download.yml",
|
|
94
|
-
"spec/fixtures/vcr_cassettes/deepl_glossaries.yml",
|
|
95
|
-
"spec/fixtures/vcr_cassettes/deepl_languages.yml",
|
|
96
|
-
"spec/fixtures/vcr_cassettes/deepl_translate.yml",
|
|
97
|
-
"spec/fixtures/vcr_cassettes/deepl_usage.yml",
|
|
98
|
-
"spec/fixtures/vcr_cassettes/glossaries.yml",
|
|
99
|
-
"spec/fixtures/vcr_cassettes/languages.yml",
|
|
100
|
-
"spec/fixtures/vcr_cassettes/rephrase_texts.yml",
|
|
101
|
-
"spec/fixtures/vcr_cassettes/translate_texts.yml",
|
|
102
|
-
"spec/fixtures/vcr_cassettes/usage.yml",
|
|
103
|
-
"spec/integration_tests/document_api_spec.rb",
|
|
104
|
-
"spec/integration_tests/integration_test_utils.rb",
|
|
105
|
-
"spec/requests/glossary/create_spec.rb",
|
|
106
|
-
"spec/requests/glossary/destroy_spec.rb",
|
|
107
|
-
"spec/requests/glossary/entries_spec.rb",
|
|
108
|
-
"spec/requests/glossary/find_spec.rb",
|
|
109
|
-
"spec/requests/glossary/language_pairs_spec.rb",
|
|
110
|
-
"spec/requests/glossary/list_spec.rb",
|
|
111
|
-
"spec/requests/languages_spec.rb",
|
|
112
|
-
"spec/requests/rephrase_spec.rb",
|
|
113
|
-
"spec/requests/translate_spec.rb",
|
|
114
|
-
"spec/requests/usage_spec.rb",
|
|
115
|
-
"spec/resources/glossary_spec.rb",
|
|
116
|
-
"spec/resources/language_pair_spec.rb",
|
|
117
|
-
"spec/resources/language_spec.rb",
|
|
118
|
-
"spec/resources/text_spec.rb",
|
|
119
|
-
"spec/resources/usage_spec.rb",
|
|
120
|
-
"spec/spec_helper.rb"
|
|
121
|
-
]
|
|
122
|
-
s.homepage = "https://github.com/DeepLcom/deepl-rb".freeze
|
|
123
|
-
s.licenses = ["MIT".freeze]
|
|
124
|
-
s.rubygems_version = "3.5.3".freeze
|
|
125
|
-
s.summary = "Official Ruby library for the DeepL language translation API.".freeze
|
|
126
|
-
|
|
127
|
-
s.specification_version = 4
|
|
128
|
-
|
|
129
|
-
s.add_development_dependency(%q<juwelier>.freeze, [">= 0".freeze])
|
|
130
|
-
s.add_development_dependency(%q<byebug>.freeze, [">= 0".freeze])
|
|
131
|
-
end
|
|
132
|
-
|
data/lib/deepl/api.rb
DELETED
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
# Copyright 2018 Daniel Herzog
|
|
2
|
-
# Use of this source code is governed by an MIT
|
|
3
|
-
# license that can be found in the LICENSE.md file.
|
|
4
|
-
# frozen_string_literal: true
|
|
5
|
-
|
|
6
|
-
module DeepL
|
|
7
|
-
class API
|
|
8
|
-
attr_reader :configuration, :http_client
|
|
9
|
-
|
|
10
|
-
def initialize(configuration)
|
|
11
|
-
@configuration = configuration
|
|
12
|
-
configuration.validate!
|
|
13
|
-
uri = URI(configuration.host)
|
|
14
|
-
@http_client = Net::HTTP.new(uri.host, uri.port)
|
|
15
|
-
@http_client.use_ssl = uri.scheme == 'https'
|
|
16
|
-
end
|
|
17
|
-
|
|
18
|
-
def update_http_client(client)
|
|
19
|
-
@http_client = client
|
|
20
|
-
end
|
|
21
|
-
end
|
|
22
|
-
end
|
data/lib/deepl/configuration.rb
DELETED
|
@@ -1,59 +0,0 @@
|
|
|
1
|
-
# Copyright 2018 Daniel Herzog
|
|
2
|
-
# Use of this source code is governed by an MIT
|
|
3
|
-
# license that can be found in the LICENSE.md file.
|
|
4
|
-
# frozen_string_literal: true
|
|
5
|
-
|
|
6
|
-
module DeepL
|
|
7
|
-
class Configuration
|
|
8
|
-
ATTRIBUTES = %i[auth_key host logger max_doc_status_queries max_network_retries user_agent
|
|
9
|
-
version].freeze
|
|
10
|
-
|
|
11
|
-
attr_accessor(*ATTRIBUTES)
|
|
12
|
-
|
|
13
|
-
DEEPL_SERVER_URL = 'https://api.deepl.com'
|
|
14
|
-
DEEPL_SERVER_URL_FREE = 'https://api-free.deepl.com'
|
|
15
|
-
private_constant :DEEPL_SERVER_URL, :DEEPL_SERVER_URL_FREE
|
|
16
|
-
|
|
17
|
-
def initialize(data = {}, app_info_name = nil, app_info_version = nil, send_platform_info = true) # rubocop:disable all
|
|
18
|
-
data.each { |key, value| send("#{key}=", value) }
|
|
19
|
-
@auth_key ||= ENV.fetch('DEEPL_AUTH_KEY', nil)
|
|
20
|
-
@host ||= ENV.fetch('DEEPL_SERVER_URL', nil)
|
|
21
|
-
@host ||= if self.class.free_account_auth_key?(@auth_key)
|
|
22
|
-
DEEPL_SERVER_URL_FREE
|
|
23
|
-
else
|
|
24
|
-
DEEPL_SERVER_URL
|
|
25
|
-
end
|
|
26
|
-
@version ||= 'v2'
|
|
27
|
-
@user_agent ||= construct_user_agent(send_platform_info, app_info_name, app_info_version)
|
|
28
|
-
@max_network_retries ||= 5
|
|
29
|
-
@logger ||= nil
|
|
30
|
-
end
|
|
31
|
-
|
|
32
|
-
def validate!
|
|
33
|
-
raise Exceptions::Error, 'auth_key not provided' if auth_key.nil? || auth_key.empty?
|
|
34
|
-
end
|
|
35
|
-
|
|
36
|
-
def attributes
|
|
37
|
-
ATTRIBUTES.to_h { |attr| [attr, send(attr)] }
|
|
38
|
-
end
|
|
39
|
-
|
|
40
|
-
def ==(other)
|
|
41
|
-
attributes == other.attributes
|
|
42
|
-
end
|
|
43
|
-
|
|
44
|
-
def self.free_account_auth_key?(key)
|
|
45
|
-
key&.end_with?(':fx')
|
|
46
|
-
end
|
|
47
|
-
|
|
48
|
-
def construct_user_agent(send_platform_info, app_info_name, app_info_version)
|
|
49
|
-
library_info_str = 'deepl-ruby/3.0.2'
|
|
50
|
-
if send_platform_info
|
|
51
|
-
library_info_str += " (#{RbConfig::CONFIG['host_os']}) ruby/#{RUBY_VERSION}"
|
|
52
|
-
end
|
|
53
|
-
if app_info_name && app_info_version
|
|
54
|
-
library_info_str += " #{app_info_name}/#{app_info_version}"
|
|
55
|
-
end
|
|
56
|
-
library_info_str
|
|
57
|
-
end
|
|
58
|
-
end
|
|
59
|
-
end
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
# Copyright 2025 DeepL SE (https://www.deepl.com)
|
|
2
|
-
# Use of this source code is governed by an MIT
|
|
3
|
-
# license that can be found in the LICENSE.md file.
|
|
4
|
-
# frozen_string_literal: true
|
|
5
|
-
|
|
6
|
-
module DeepL
|
|
7
|
-
module Constants
|
|
8
|
-
class BaseConstant
|
|
9
|
-
def self.options
|
|
10
|
-
constants.map { |const| const_get(const) }
|
|
11
|
-
end
|
|
12
|
-
|
|
13
|
-
def self.valid?(value)
|
|
14
|
-
options.include?(value)
|
|
15
|
-
end
|
|
16
|
-
end
|
|
17
|
-
end
|
|
18
|
-
end
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
# Copyright 2025 DeepL SE (https://www.deepl.com)
|
|
2
|
-
# Use of this source code is governed by an MIT
|
|
3
|
-
# license that can be found in the LICENSE.md file.
|
|
4
|
-
# frozen_string_literal: true
|
|
5
|
-
|
|
6
|
-
module DeepL
|
|
7
|
-
module Constants
|
|
8
|
-
class Formality < BaseConstant
|
|
9
|
-
DEFAULT = 'default'
|
|
10
|
-
MORE = 'more'
|
|
11
|
-
LESS = 'less'
|
|
12
|
-
PREFER_MORE = 'prefer_more'
|
|
13
|
-
PREFER_LESS = 'prefer_less'
|
|
14
|
-
end
|
|
15
|
-
end
|
|
16
|
-
end
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
# Copyright 2025 DeepL SE (https://www.deepl.com)
|
|
2
|
-
# Use of this source code is governed by an MIT
|
|
3
|
-
# license that can be found in the LICENSE.md file.
|
|
4
|
-
# frozen_string_literal: true
|
|
5
|
-
|
|
6
|
-
module DeepL
|
|
7
|
-
module Constants
|
|
8
|
-
class ModelType < BaseConstant
|
|
9
|
-
QUALITY_OPTIMIZED = 'quality_optimized'
|
|
10
|
-
PREFER_QUALITY_OPTIMIZED = 'prefer_quality_optimized'
|
|
11
|
-
LATENCY_OPTIMIZED = 'latency_optimized'
|
|
12
|
-
end
|
|
13
|
-
end
|
|
14
|
-
end
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
# Copyright 2025 DeepL SE (https://www.deepl.com)
|
|
2
|
-
# Use of this source code is governed by an MIT
|
|
3
|
-
# license that can be found in the LICENSE.md file.
|
|
4
|
-
# frozen_string_literal: true
|
|
5
|
-
|
|
6
|
-
module DeepL
|
|
7
|
-
module Constants
|
|
8
|
-
class SplitSentences < BaseConstant
|
|
9
|
-
NO_SPLITTING = '0'
|
|
10
|
-
SPLIT_ON_PUNCTUATION_AND_NEWLINES = '1'
|
|
11
|
-
SPLIT_ON_PUNCTUATION_ONLY = 'nonewlines'
|
|
12
|
-
end
|
|
13
|
-
end
|
|
14
|
-
end
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
# Copyright 2025 DeepL SE (https://www.deepl.com)
|
|
2
|
-
# Use of this source code is governed by an MIT
|
|
3
|
-
# license that can be found in the LICENSE.md file.
|
|
4
|
-
# frozen_string_literal: true
|
|
5
|
-
|
|
6
|
-
module DeepL
|
|
7
|
-
module Constants
|
|
8
|
-
class TagHandling < BaseConstant
|
|
9
|
-
XML = 'xml'
|
|
10
|
-
HTML = 'html'
|
|
11
|
-
end
|
|
12
|
-
end
|
|
13
|
-
end
|
data/lib/deepl/constants/tone.rb
DELETED
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
# Copyright 2025 DeepL SE (https://www.deepl.com)
|
|
2
|
-
# Use of this source code is governed by an MIT
|
|
3
|
-
# license that can be found in the LICENSE.md file.
|
|
4
|
-
# frozen_string_literal: true
|
|
5
|
-
|
|
6
|
-
module DeepL
|
|
7
|
-
module Constants
|
|
8
|
-
class Tone < BaseConstant
|
|
9
|
-
DEFAULT = 'default'
|
|
10
|
-
ENTHUSIASTIC = 'enthusiastic'
|
|
11
|
-
FRIENDLY = 'friendly'
|
|
12
|
-
CONFIDENT = 'confident'
|
|
13
|
-
DIPLOMATIC = 'diplomatic'
|
|
14
|
-
PREFER_ENTHUSIASTIC = 'prefer_enthusiastic'
|
|
15
|
-
PREFER_FRIENDLY = 'prefer_friendly'
|
|
16
|
-
PREFER_CONFIDENT = 'prefer_confident'
|
|
17
|
-
PREFER_DIPLOMATIC = 'prefer_diplomatic'
|
|
18
|
-
end
|
|
19
|
-
end
|
|
20
|
-
end
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
# Copyright 2025 DeepL SE (https://www.deepl.com)
|
|
2
|
-
# Use of this source code is governed by an MIT
|
|
3
|
-
# license that can be found in the LICENSE.md file.
|
|
4
|
-
# frozen_string_literal: true
|
|
5
|
-
|
|
6
|
-
module DeepL
|
|
7
|
-
module Constants
|
|
8
|
-
class WritingStyle < BaseConstant
|
|
9
|
-
DEFAULT = 'default'
|
|
10
|
-
SIMPLE = 'simple'
|
|
11
|
-
BUSINESS = 'business'
|
|
12
|
-
ACADEMIC = 'academic'
|
|
13
|
-
CASUAL = 'casual'
|
|
14
|
-
PREFER_SIMPLE = 'prefer_simple'
|
|
15
|
-
PREFER_BUSINESS = 'prefer_business'
|
|
16
|
-
PREFER_ACADEMIC = 'prefer_academic'
|
|
17
|
-
PREFER_CASUAL = 'prefer_casual'
|
|
18
|
-
end
|
|
19
|
-
end
|
|
20
|
-
end
|