deepl-rb 3.6.0 → 3.6.1

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 (103) hide show
  1. checksums.yaml +4 -4
  2. data/.circleci/config.yml +27 -0
  3. data/.github/workflows/add_issues_to_kanban.yml +16 -0
  4. data/.gitlab-ci.yml +172 -0
  5. data/.rubocop.yml +51 -0
  6. data/CHANGELOG.md +22 -3
  7. data/CODE_OF_CONDUCT.md +132 -0
  8. data/CONTRIBUTING.md +37 -0
  9. data/Gemfile +24 -0
  10. data/Rakefile +56 -0
  11. data/SECURITY.md +58 -0
  12. data/VERSION +1 -0
  13. data/deepl-rb.gemspec +140 -0
  14. data/lib/deepl/api.rb +22 -0
  15. data/lib/deepl/configuration.rb +59 -0
  16. data/lib/deepl/constants/base_constant.rb +18 -0
  17. data/lib/deepl/constants/formality.rb +16 -0
  18. data/lib/deepl/constants/model_type.rb +14 -0
  19. data/lib/deepl/constants/split_sentences.rb +14 -0
  20. data/lib/deepl/constants/tag_handling.rb +13 -0
  21. data/lib/deepl/constants/tone.rb +20 -0
  22. data/lib/deepl/constants/writing_style.rb +20 -0
  23. data/lib/deepl/document_api.rb +121 -0
  24. data/lib/deepl/exceptions/authorization_failed.rb +14 -0
  25. data/lib/deepl/exceptions/bad_request.rb +16 -0
  26. data/lib/deepl/exceptions/document_translation_error.rb +15 -0
  27. data/lib/deepl/exceptions/error.rb +14 -0
  28. data/lib/deepl/exceptions/limit_exceeded.rb +18 -0
  29. data/lib/deepl/exceptions/not_found.rb +16 -0
  30. data/lib/deepl/exceptions/not_supported.rb +14 -0
  31. data/lib/deepl/exceptions/quota_exceeded.rb +14 -0
  32. data/lib/deepl/exceptions/request_entity_too_large.rb +15 -0
  33. data/lib/deepl/exceptions/request_error.rb +21 -0
  34. data/lib/deepl/exceptions/server_error.rb +18 -0
  35. data/lib/deepl/glossary_api.rb +38 -0
  36. data/lib/deepl/requests/base.rb +196 -0
  37. data/lib/deepl/requests/document/download.rb +44 -0
  38. data/lib/deepl/requests/document/get_status.rb +44 -0
  39. data/lib/deepl/requests/document/upload.rb +74 -0
  40. data/lib/deepl/requests/glossary/create.rb +59 -0
  41. data/lib/deepl/requests/glossary/destroy.rb +37 -0
  42. data/lib/deepl/requests/glossary/entries.rb +37 -0
  43. data/lib/deepl/requests/glossary/find.rb +38 -0
  44. data/lib/deepl/requests/glossary/language_pairs.rb +38 -0
  45. data/lib/deepl/requests/glossary/list.rb +37 -0
  46. data/lib/deepl/requests/languages.rb +37 -0
  47. data/lib/deepl/requests/rephrase.rb +55 -0
  48. data/lib/deepl/requests/style_rule/list.rb +59 -0
  49. data/lib/deepl/requests/translate.rb +93 -0
  50. data/lib/deepl/requests/usage.rb +33 -0
  51. data/lib/deepl/resources/base.rb +17 -0
  52. data/lib/deepl/resources/document_handle.rb +57 -0
  53. data/lib/deepl/resources/document_translation_status.rb +54 -0
  54. data/lib/deepl/resources/glossary.rb +28 -0
  55. data/lib/deepl/resources/language.rb +30 -0
  56. data/lib/deepl/resources/language_pair.rb +23 -0
  57. data/lib/deepl/resources/style_rule.rb +85 -0
  58. data/lib/deepl/resources/text.rb +24 -0
  59. data/lib/deepl/resources/usage.rb +27 -0
  60. data/lib/deepl/style_rule_api.rb +17 -0
  61. data/lib/deepl/utils/backoff_timer.rb +46 -0
  62. data/lib/deepl/utils/exception_builder.rb +34 -0
  63. data/lib/deepl.rb +158 -0
  64. data/lib/http_client_options.rb +22 -0
  65. data/lib/version.rb +8 -0
  66. data/spec/api/api_spec.rb +20 -0
  67. data/spec/api/configuration_spec.rb +122 -0
  68. data/spec/api/deepl_spec.rb +460 -0
  69. data/spec/constants/constants_spec.rb +158 -0
  70. data/spec/fixtures/vcr_cassettes/deepl_document.yml +95 -0
  71. data/spec/fixtures/vcr_cassettes/deepl_document_download.yml +1214 -0
  72. data/spec/fixtures/vcr_cassettes/deepl_glossaries.yml +1163 -0
  73. data/spec/fixtures/vcr_cassettes/deepl_languages.yml +54 -0
  74. data/spec/fixtures/vcr_cassettes/deepl_rephrase.yml +87 -0
  75. data/spec/fixtures/vcr_cassettes/deepl_translate.yml +358 -0
  76. data/spec/fixtures/vcr_cassettes/deepl_usage.yml +129 -0
  77. data/spec/fixtures/vcr_cassettes/glossaries.yml +1702 -0
  78. data/spec/fixtures/vcr_cassettes/languages.yml +229 -0
  79. data/spec/fixtures/vcr_cassettes/rephrase_texts.yml +401 -0
  80. data/spec/fixtures/vcr_cassettes/style_rules.yml +92 -0
  81. data/spec/fixtures/vcr_cassettes/translate_texts.yml +10630 -0
  82. data/spec/fixtures/vcr_cassettes/usage.yml +171 -0
  83. data/spec/integration_tests/document_api_spec.rb +178 -0
  84. data/spec/integration_tests/integration_test_utils.rb +170 -0
  85. data/spec/integration_tests/style_rule_api_spec.rb +79 -0
  86. data/spec/requests/extra_body_parameters_types_spec.rb +82 -0
  87. data/spec/requests/glossary/create_spec.rb +65 -0
  88. data/spec/requests/glossary/destroy_spec.rb +66 -0
  89. data/spec/requests/glossary/entries_spec.rb +62 -0
  90. data/spec/requests/glossary/find_spec.rb +68 -0
  91. data/spec/requests/glossary/language_pairs_spec.rb +40 -0
  92. data/spec/requests/glossary/list_spec.rb +54 -0
  93. data/spec/requests/languages_spec.rb +68 -0
  94. data/spec/requests/rephrase_spec.rb +172 -0
  95. data/spec/requests/translate_spec.rb +493 -0
  96. data/spec/requests/usage_spec.rb +43 -0
  97. data/spec/resources/glossary_spec.rb +38 -0
  98. data/spec/resources/language_pair_spec.rb +23 -0
  99. data/spec/resources/language_spec.rb +45 -0
  100. data/spec/resources/text_spec.rb +23 -0
  101. data/spec/resources/usage_spec.rb +35 -0
  102. data/spec/spec_helper.rb +92 -0
  103. metadata +102 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 5778d1b4102e5d798b157de8dcaeecd069d55f0f333eb190e510eb6b0593df9f
4
- data.tar.gz: 117d03157edd90e2da5e6064f5d9c4b8c0ede6beddd009b7016b48d0e2673e19
3
+ metadata.gz: 8ea8e9d6cc6601abfadddf2b0b70169a7449e71434a8b695c534789d2263d681
4
+ data.tar.gz: '029b836b133bbf60d9b4a8acecf90b89d969d991e793db1bf5643f5633895282'
5
5
  SHA512:
6
- metadata.gz: e0b437203711dabb1b30f20a04964d940f17b5e85e41559436ea46dea5a2e093600122c58b15b486e81062831bb12534a146820b8cca69fd262710b8757caab1
7
- data.tar.gz: c581a473d282486dcd516eacb8a20996302806bf0a40cf4e34467e11ea0f4445660a938addd64f60be5e01b05e32e17d54e3fdea542c14f23ee6b203fd789391
6
+ metadata.gz: 83070b04ae93261b4524cb5353bdb888c2b9f5a98c9314239ed4ae8c76a53182363bb31ba31f7468a7a5d705162c09fbb69fb0f4a71bc802d8b373d97c46aeaa
7
+ data.tar.gz: 8ac545b8fb392b31a0e3fa00f4ed7f556bcf92304d8852226e57d099d365554c6eb5f510fe76891c329bdf89851c2bff217417f157947ffb96e41e50ef58b562
@@ -0,0 +1,27 @@
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
@@ -0,0 +1,16 @@
1
+ name: Add bugs to bugs project
2
+
3
+ on:
4
+ issues:
5
+ types:
6
+ - opened
7
+
8
+ jobs:
9
+ add-to-project:
10
+ name: Add issue to project
11
+ runs-on: ubuntu-latest
12
+ steps:
13
+ - uses: actions/add-to-project@v0.5.0
14
+ with:
15
+ project-url: https://github.com/orgs/DeepLcom/projects/1
16
+ github-token: ${{ secrets.ADD_TO_PROJECT_PAT }}
data/.gitlab-ci.yml ADDED
@@ -0,0 +1,172 @@
1
+ # Note: This GitLab CI configuration is used for internal testing, users can ignore it.
2
+ include:
3
+ - template: Security/SAST.gitlab-ci.yml
4
+ - project: '${CI_PROJECT_NAMESPACE}/ci-libs-for-client-libraries'
5
+ file:
6
+ - '/${CI_PROJECT_NAME}/.gitlab-ci.yml'
7
+ - project: 'deepl/ops/ci-cd-infrastructure/gitlab-ci-lib'
8
+ file:
9
+ - '/templates/.buildkit.yml'
10
+ - '/templates/.secret-detection.yml'
11
+ - '/templates/.gitlab-release.yml'
12
+
13
+ # Global --------------------------
14
+
15
+ workflow:
16
+ rules:
17
+ - if: $CI_PIPELINE_SOURCE == "merge_request_event"
18
+ - if: $CI_COMMIT_TAG
19
+ - if: '$CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH'
20
+
21
+ variables:
22
+ GITLAB_ADVANCED_SAST_ENABLED: 'true'
23
+
24
+ stages:
25
+ - install
26
+ - check
27
+ - test
28
+ - publish # Only for internal tracking
29
+
30
+
31
+ before_script:
32
+ - ruby --version
33
+ - bundle install
34
+
35
+ # stage: install ----------------------
36
+
37
+ package:
38
+ stage: install
39
+ parallel:
40
+ matrix:
41
+ - DOCKER_IMAGE: 'ruby:2.7'
42
+ - DOCKER_IMAGE: 'ruby:3.2'
43
+ - DOCKER_IMAGE: 'ruby:3.3'
44
+ image:
45
+ name: ${DOCKER_IMAGE}
46
+ entrypoint: ['/builds/deepl/backend/oss-client-libs/deepl-ruby']
47
+ script:
48
+ - bundle exec rake build
49
+ artifacts:
50
+ paths:
51
+ - pkg/
52
+
53
+ # stage: check ----------------------
54
+
55
+ .rubocop_base:
56
+ stage: check
57
+ image:
58
+ name: ruby:2.7
59
+ entrypoint: ['/builds/deepl/backend/oss-client-libs/deepl-ruby']
60
+ script: bundle exec rubocop
61
+
62
+ rubocop_scheduled:
63
+ extends: .rubocop_base
64
+ rules:
65
+ - if: $CI_PIPELINE_SOURCE == "schedule"
66
+ retry: 2
67
+
68
+ rubocop_manual:
69
+ extends: .rubocop_base
70
+ rules:
71
+ - if: $CI_PIPELINE_SOURCE != "schedule"
72
+
73
+ secret_detection:
74
+ extends: .secret-detection
75
+ stage: check
76
+ image: !reference [.secret-detection, image]
77
+ before_script:
78
+ - echo "overriding default before_script..."
79
+ rules:
80
+ - if: $CI_MERGE_REQUEST_ID
81
+
82
+ license_check:
83
+ stage: check
84
+ before_script:
85
+ - echo "overriding default before_script..."
86
+ script:
87
+ - ./license_checker.sh '*.rb' | tee license_check_output.txt
88
+ - '[ ! -s license_check_output.txt ]'
89
+
90
+ gitlab-advanced-sast:
91
+ stage: check
92
+ before_script:
93
+ - ''
94
+ rules:
95
+ - when: always
96
+ variables:
97
+ SAST_EXCLUDED_PATHS: '$DEFAULT_SAST_EXCLUDED_PATHS,/spec'
98
+ GIT_STRATEGY: clone
99
+ KUBERNETES_HELPER_MEMORY_LIMIT: 8Gi
100
+ SAST_SCANNER_ALLOWED_CLI_OPTS: --multi-core 8
101
+
102
+ semgrep-sast:
103
+ stage: check
104
+ before_script:
105
+ - ''
106
+ rules:
107
+ - when: always
108
+ variables:
109
+ SAST_EXCLUDED_PATHS: '$DEFAULT_SAST_EXCLUDED_PATHS,/spec'
110
+ GIT_STRATEGY: clone
111
+ KUBERNETES_MEMORY_LIMIT: 8Gi
112
+
113
+
114
+ # stage: test ----------------------
115
+
116
+ .test_base:
117
+ stage: test
118
+ extends: .test
119
+ parallel:
120
+ matrix:
121
+ - DOCKER_IMAGE: 'ruby:2.7'
122
+ - DOCKER_IMAGE: 'ruby:3.2'
123
+ - DOCKER_IMAGE: 'ruby:3.3'
124
+ - DOCKER_IMAGE: 'ruby:2.7'
125
+ USE_MOCK_SERVER: "use mock server"
126
+ - DOCKER_IMAGE: 'ruby:3.2'
127
+ USE_MOCK_SERVER: "use mock server"
128
+ - DOCKER_IMAGE: 'ruby:3.3'
129
+ USE_MOCK_SERVER: "use mock server"
130
+ image:
131
+ name: ${DOCKER_IMAGE}
132
+ entrypoint: ['/builds/deepl/backend/oss-client-libs/deepl-ruby']
133
+ script:
134
+ - >
135
+ if [[ ! -z "${USE_MOCK_SERVER}" ]]; then
136
+ echo "Using mock server"
137
+ export DEEPL_SERVER_URL=http://deepl-mock:3000
138
+ export DEEPL_MOCK_SERVER_PORT=3000
139
+ export DEEPL_PROXY_URL=http://deepl-mock:3001
140
+ export DEEPL_MOCK_PROXY_SERVER_PORT=3001
141
+ fi
142
+ - bundle exec rake test
143
+ - bundle exec rspec --format RspecJunitFormatter --out rspec.xml
144
+ artifacts:
145
+ reports:
146
+ coverage_report:
147
+ coverage_format: cobertura
148
+ path: coverage/coverage.xml
149
+ junit:
150
+ - rspec.xml
151
+ when: always
152
+
153
+ test_scheduled:
154
+ extends: .test_base
155
+ rules:
156
+ - if: $CI_PIPELINE_SOURCE == "schedule"
157
+ retry: 2
158
+
159
+ test_manual:
160
+ stage: test
161
+ extends: .test_base
162
+ rules:
163
+ - if: $CI_PIPELINE_SOURCE != "schedule"
164
+
165
+
166
+ # stage: publish ----------------------
167
+
168
+ gitlab release:
169
+ stage: publish
170
+ extends: .create_gitlab_release
171
+ rules:
172
+ - if: '$CI_COMMIT_TAG =~ /^v[0-9]+\.[0-9]+\.[0-9]+$/'
data/.rubocop.yml ADDED
@@ -0,0 +1,51 @@
1
+ # Custom rubocop configuration
2
+
3
+ require:
4
+ - rubocop-rspec
5
+
6
+ AllCops:
7
+ DisplayCopNames: true
8
+ NewCops: enable
9
+ Exclude:
10
+ - deepl-rb.gemspec
11
+ - vendor/**/*
12
+ TargetRubyVersion: 2.7.5
13
+
14
+ Metrics/BlockLength:
15
+ Exclude:
16
+ - "**/*_spec.rb"
17
+
18
+ Metrics/ParameterLists:
19
+ Max: 6
20
+
21
+ Layout/LineLength:
22
+ Max: 100
23
+
24
+ RSpec/ExampleLength:
25
+ Max: 10
26
+ CountAsOne: ['heredoc']
27
+
28
+ RSpec/MessageSpies:
29
+ EnforcedStyle: 'receive'
30
+
31
+ RSpec/MultipleExpectations:
32
+ Max: 8
33
+
34
+ RSpec/MultipleMemoizedHelpers:
35
+ Max: 7
36
+
37
+ RSpec/NestedGroups:
38
+ Max: 4
39
+
40
+ RSpec/SpecFilePathSuffix:
41
+ Enabled: false
42
+
43
+ RSpec/SpecFilePathFormat:
44
+ CustomTransform:
45
+ DeepL: ''
46
+
47
+ Style/Documentation:
48
+ Enabled: false
49
+
50
+ Style/ModuleFunction:
51
+ EnforcedStyle: extend_self
data/CHANGELOG.md CHANGED
@@ -6,10 +6,22 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
6
6
 
7
7
  ## [Unreleased]
8
8
 
9
+ ## [3.6.1] - 2025-12-19
10
+ ### Fixed
11
+ - Fixed broken 3.6.0 release
12
+
9
13
  ## [3.6.0] - 2025-12-10
10
14
  ### Added
11
15
  - Added `tag_handling_version` parameter to `translate()` to specify which version of the tag handling algorithm to use. Options are `v1` and `v2`.
12
16
 
17
+ ### Fixed
18
+ - `extra_body_parameters` will no longer cast values to string, as this library sends JSON-encoded requests
19
+ (allows e.g. sending booleans)
20
+
21
+ ## [3.5.1] - 2025-12-19
22
+ ### Fixed
23
+ - Fixed broken 3.5.0 release
24
+
13
25
  ## [3.5.0] - 2025-12-03
14
26
  ### Added
15
27
  - Added `custom_instructions` parameter to `translate()` to customize translation
@@ -19,6 +31,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
19
31
  model type as the default. Requests combining `custom_instructions` and the
20
32
  `latency_optimized` model type will be rejected.
21
33
 
34
+ ## [3.4.1] - 2025-12-19
35
+ ### Fixed
36
+ - Fixed broken 3.4.0 release
37
+
22
38
  ## [3.4.0] - 2025-11-17
23
39
  ### Added
24
40
  - Added support for the `GET /v3/style_rules` endpoint in the client library, the
@@ -86,9 +102,12 @@ The change in major version is only due to the change in maintainership, there i
86
102
  ### Fixed
87
103
  - Make RequestEntityTooLarge error message more clear
88
104
 
89
- [Unreleased]: https://github.com/DeepLcom/deepl-rb/compare/v3.6.0...HEAD
90
- [3.6.0]: https://github.com/DeepLcom/deepl-rb/compare/v3.5.0...v3.6.0
91
- [3.5.0]: https://github.com/DeepLcom/deepl-rb/compare/v3.4.0...v3.5.0
105
+ [Unreleased]: https://github.com/DeepLcom/deepl-rb/compare/v3.6.1...HEAD
106
+ [3.6.1]: https://github.com/DeepLcom/deepl-rb/compare/v3.6.0...v3.6.1
107
+ [3.6.0]: https://github.com/DeepLcom/deepl-rb/compare/v3.5.1...v3.6.0
108
+ [3.5.1]: https://github.com/DeepLcom/deepl-rb/compare/v3.5.0...v3.5.1
109
+ [3.5.0]: https://github.com/DeepLcom/deepl-rb/compare/v3.4.1...v3.5.0
110
+ [3.4.1]: https://github.com/DeepLcom/deepl-rb/compare/v3.4.0...v3.4.1
92
111
  [3.4.0]: https://github.com/DeepLcom/deepl-rb/compare/v3.3.0...v3.4.0
93
112
  [3.3.0]: https://github.com/DeepLcom/deepl-rb/compare/v3.2.0...v3.3.0
94
113
  [3.2.0]: https://github.com/DeepLcom/deepl-rb/compare/v3.1.0...v3.2.0
@@ -0,0 +1,132 @@
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 ADDED
@@ -0,0 +1,37 @@
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 ADDED
@@ -0,0 +1,24 @@
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 ADDED
@@ -0,0 +1,56 @@
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
+ require_relative 'lib/version'
17
+
18
+ Juwelier::Tasks.new do |gem|
19
+ gem.name = 'deepl-rb'
20
+ gem.homepage = 'https://github.com/DeepLcom/deepl-rb'
21
+ gem.license = 'MIT'
22
+ gem.summary = 'Official Ruby library for the DeepL language translation API.'
23
+ gem.description =
24
+ 'Official Ruby library for the DeepL language translation API (v2). ' \
25
+ 'For more information, check this: https://www.deepl.com/docs/api-reference.html'
26
+ gem.version = DeepL::VERSION
27
+
28
+ gem.email = 'open-source@deepl.com'
29
+ gem.authors = ['DeepL SE']
30
+ gem.metadata = {
31
+ 'bug_tracker_uri' => 'https://github.com/DeepLcom/deepl-rb/issues',
32
+ 'changelog_uri' => 'https://github.com/DeepLcom/deepl-rb/blob/main/CHANGELOG.md',
33
+ 'documentation_uri' => 'https://github.com/DeepLcom/deepl-rb/blob/main/README.md',
34
+ 'homepage_uri' => 'https://github.com/DeepLcom/deepl-rb'
35
+ }
36
+ gem.files.exclude '.github'
37
+ gem.files.exclude '.circleci'
38
+ gem.files.exclude 'catalog-info.yaml'
39
+ end
40
+
41
+ Juwelier::RubygemsDotOrgTasks.new
42
+
43
+ # Tests
44
+ require 'rspec/core/rake_task'
45
+ require 'rubocop/rake_task'
46
+
47
+ RuboCop::RakeTask.new
48
+ RSpec::Core::RakeTask.new(:spec)
49
+
50
+ desc 'Run all tests.'
51
+ task :test do
52
+ Rake::Task['spec'].invoke
53
+ Rake::Task['rubocop'].invoke
54
+ end
55
+
56
+ task default: :test
data/SECURITY.md ADDED
@@ -0,0 +1,58 @@
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/Ez6qreEl8mX0a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