deepl-rb 2.2.2 → 2.2.3
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 +5 -5
- data/.circleci/config.yml +1 -13
- data/.rubocop.yml +1 -0
- data/Gemfile +2 -0
- data/README.md +1 -9
- data/Rakefile +2 -0
- data/VERSION +1 -1
- data/deepl-rb.gemspec +7 -10
- data/lib/deepl.rb +2 -0
- data/lib/deepl/api.rb +2 -0
- data/lib/deepl/configuration.rb +2 -0
- data/lib/deepl/exceptions/authorization_failed.rb +2 -0
- data/lib/deepl/exceptions/bad_request.rb +2 -0
- data/lib/deepl/exceptions/error.rb +2 -0
- data/lib/deepl/exceptions/limit_exceeded.rb +2 -0
- data/lib/deepl/exceptions/quota_exceeded.rb +2 -0
- data/lib/deepl/exceptions/request_error.rb +3 -0
- data/lib/deepl/requests/base.rb +3 -1
- data/lib/deepl/requests/translate.rb +3 -0
- data/lib/deepl/requests/usage.rb +2 -0
- data/lib/deepl/resources/base.rb +2 -0
- data/lib/deepl/resources/text.rb +2 -0
- data/lib/deepl/resources/usage.rb +2 -0
- data/spec/api/api_spec.rb +2 -0
- data/spec/api/configuration_spec.rb +2 -0
- data/spec/api/deepl_spec.rb +2 -0
- data/spec/requests/translate_spec.rb +2 -0
- data/spec/requests/usage_spec.rb +2 -0
- data/spec/resources/text_spec.rb +2 -0
- data/spec/resources/usage_spec.rb +2 -0
- data/spec/spec_helper.rb +2 -0
- metadata +6 -8
- data/Gemfile.lock +0 -113
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 83485dc84bdce1dd11492bc0eb141825202b624e903cc747cc7bcc2f0afbc74e
|
4
|
+
data.tar.gz: 2f39d5af1a2926e123fa2fb1e3a3cae247546234f6382a0fc185f3e0fb5d7599
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 44bb0eb91abfea54a199830b26abdf52b275badcf3cad7ca0a905cd2bfef7360cd3ced29690047438f263c46dfa71e2ce9c34abab09b30f4af25565aac7309d4
|
7
|
+
data.tar.gz: df542383415d3c0eecb848d29e01c0c1e8ef2b8d7e272ce224383251ea1ca876edb4f6cc65f8c78f9978621f918cb75e946737a9bffc2a40fc8e87506bc5e5f3
|
data/.circleci/config.yml
CHANGED
@@ -3,26 +3,14 @@ jobs:
|
|
3
3
|
build:
|
4
4
|
working_directory: ~/deepl-rb
|
5
5
|
docker:
|
6
|
-
- image: circleci/ruby:2.
|
6
|
+
- image: circleci/ruby:2.7
|
7
7
|
steps:
|
8
8
|
- checkout
|
9
9
|
|
10
|
-
# Restore bundle cache
|
11
|
-
- type: cache-restore
|
12
|
-
name: Restore bundle cache
|
13
|
-
key: deepl-rb-bundle-{{ checksum "Gemfile.lock" }}
|
14
|
-
|
15
10
|
- run:
|
16
11
|
name: Bundle Install
|
17
12
|
command: bundle install --path vendor/bundle
|
18
13
|
|
19
|
-
# Store bundle cache
|
20
|
-
- type: cache-save
|
21
|
-
name: Store bundle cache
|
22
|
-
key: deepl-rb-bundle-{{ checksum "Gemfile.lock" }}
|
23
|
-
paths:
|
24
|
-
- vendor/bundle
|
25
|
-
|
26
14
|
# Run rspec
|
27
15
|
- type: shell
|
28
16
|
command: |
|
data/.rubocop.yml
CHANGED
data/Gemfile
CHANGED
data/README.md
CHANGED
@@ -171,7 +171,7 @@ Since the DeepL service is defined globally, you can use service anywhere in you
|
|
171
171
|
### i18n-tasks
|
172
172
|
|
173
173
|
You may also take a look at [`i18n-tasks`](https://github.com/glebm/i18n-tasks), which is a gem
|
174
|
-
that helps you find and manage missing and unused translations. `deepl-rb` is used as one the
|
174
|
+
that helps you find and manage missing and unused translations. `deepl-rb` is used as one of the
|
175
175
|
backend services to translate content.
|
176
176
|
|
177
177
|
## Development
|
@@ -189,11 +189,3 @@ To run tests (rspec and rubocop), use
|
|
189
189
|
```
|
190
190
|
bundle exec rake test
|
191
191
|
```
|
192
|
-
|
193
|
-
## Contributors
|
194
|
-
|
195
|
-
This project has been developed by:
|
196
|
-
|
197
|
-
| Avatar | Name | Nickname | Email |
|
198
|
-
| ------ | ---- | -------- | ----- |
|
199
|
-
|  | Daniel Herzog | Wikiti | [info@danielherzog.es](mailto:info@danielherzog.es)
|
data/Rakefile
CHANGED
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
2.2.
|
1
|
+
2.2.3
|
data/deepl-rb.gemspec
CHANGED
@@ -2,16 +2,16 @@
|
|
2
2
|
# DO NOT EDIT THIS FILE DIRECTLY
|
3
3
|
# Instead, edit Juwelier::Tasks in Rakefile, and run 'rake gemspec'
|
4
4
|
# -*- encoding: utf-8 -*-
|
5
|
-
# stub: deepl-rb 2.2.
|
5
|
+
# stub: deepl-rb 2.2.3 ruby lib
|
6
6
|
|
7
7
|
Gem::Specification.new do |s|
|
8
8
|
s.name = "deepl-rb".freeze
|
9
|
-
s.version = "2.2.
|
9
|
+
s.version = "2.2.3"
|
10
10
|
|
11
11
|
s.required_rubygems_version = Gem::Requirement.new(">= 0".freeze) if s.respond_to? :required_rubygems_version=
|
12
12
|
s.require_paths = ["lib".freeze]
|
13
13
|
s.authors = ["Daniel Herzog".freeze]
|
14
|
-
s.date = "2020-
|
14
|
+
s.date = "2020-11-14"
|
15
15
|
s.description = "A simple ruby wrapper for the DeepL translation API (v1). For more information, check this: https://www.deepl.com/docs/api-reference.html".freeze
|
16
16
|
s.email = "info@danielherzog.es".freeze
|
17
17
|
s.extra_rdoc_files = [
|
@@ -22,7 +22,6 @@ Gem::Specification.new do |s|
|
|
22
22
|
".circleci/config.yml",
|
23
23
|
".rubocop.yml",
|
24
24
|
"Gemfile",
|
25
|
-
"Gemfile.lock",
|
26
25
|
"LICENSE.md",
|
27
26
|
"README.md",
|
28
27
|
"Rakefile",
|
@@ -58,17 +57,15 @@ Gem::Specification.new do |s|
|
|
58
57
|
]
|
59
58
|
s.homepage = "http://github.com/wikiti/deepl-rb".freeze
|
60
59
|
s.licenses = ["MIT".freeze]
|
61
|
-
s.rubygems_version = "
|
60
|
+
s.rubygems_version = "3.1.2".freeze
|
62
61
|
s.summary = "A simple ruby wrapper for the DeepL API".freeze
|
63
62
|
|
64
63
|
if s.respond_to? :specification_version then
|
65
64
|
s.specification_version = 4
|
65
|
+
end
|
66
66
|
|
67
|
-
|
68
|
-
|
69
|
-
else
|
70
|
-
s.add_dependency(%q<juwelier>.freeze, [">= 0"])
|
71
|
-
end
|
67
|
+
if s.respond_to? :add_runtime_dependency then
|
68
|
+
s.add_development_dependency(%q<juwelier>.freeze, [">= 0"])
|
72
69
|
else
|
73
70
|
s.add_dependency(%q<juwelier>.freeze, [">= 0"])
|
74
71
|
end
|
data/lib/deepl.rb
CHANGED
data/lib/deepl/api.rb
CHANGED
data/lib/deepl/configuration.rb
CHANGED
data/lib/deepl/requests/base.rb
CHANGED
@@ -1,3 +1,5 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
module DeepL
|
2
4
|
module Requests
|
3
5
|
class Base
|
@@ -32,7 +34,7 @@ module DeepL
|
|
32
34
|
|
33
35
|
def post(payload)
|
34
36
|
request = Net::HTTP::Post.new(uri.request_uri)
|
35
|
-
request.set_form_data(payload.
|
37
|
+
request.set_form_data(payload.compact)
|
36
38
|
response = http.request(request)
|
37
39
|
|
38
40
|
validate_response!(request, response)
|
@@ -1,3 +1,5 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
module DeepL
|
2
4
|
module Requests
|
3
5
|
class Translate < Base
|
@@ -31,6 +33,7 @@ module DeepL
|
|
31
33
|
def tweak_parameters!
|
32
34
|
OPTIONS_CONVERSIONS.each do |param, converter|
|
33
35
|
next unless option?(param) && converter[option(param)]
|
36
|
+
|
34
37
|
set_option(param, converter[option(param)])
|
35
38
|
end
|
36
39
|
end
|
data/lib/deepl/requests/usage.rb
CHANGED
data/lib/deepl/resources/base.rb
CHANGED
data/lib/deepl/resources/text.rb
CHANGED
data/spec/api/api_spec.rb
CHANGED
data/spec/api/deepl_spec.rb
CHANGED
data/spec/requests/usage_spec.rb
CHANGED
data/spec/resources/text_spec.rb
CHANGED
data/spec/spec_helper.rb
CHANGED
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: 2.2.
|
4
|
+
version: 2.2.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Daniel Herzog
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-
|
11
|
+
date: 2020-11-14 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: juwelier
|
@@ -36,7 +36,6 @@ files:
|
|
36
36
|
- ".circleci/config.yml"
|
37
37
|
- ".rubocop.yml"
|
38
38
|
- Gemfile
|
39
|
-
- Gemfile.lock
|
40
39
|
- LICENSE.md
|
41
40
|
- README.md
|
42
41
|
- Rakefile
|
@@ -73,7 +72,7 @@ homepage: http://github.com/wikiti/deepl-rb
|
|
73
72
|
licenses:
|
74
73
|
- MIT
|
75
74
|
metadata: {}
|
76
|
-
post_install_message:
|
75
|
+
post_install_message:
|
77
76
|
rdoc_options: []
|
78
77
|
require_paths:
|
79
78
|
- lib
|
@@ -88,9 +87,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
88
87
|
- !ruby/object:Gem::Version
|
89
88
|
version: '0'
|
90
89
|
requirements: []
|
91
|
-
|
92
|
-
|
93
|
-
signing_key:
|
90
|
+
rubygems_version: 3.1.2
|
91
|
+
signing_key:
|
94
92
|
specification_version: 4
|
95
93
|
summary: A simple ruby wrapper for the DeepL API
|
96
94
|
test_files: []
|
data/Gemfile.lock
DELETED
@@ -1,113 +0,0 @@
|
|
1
|
-
GEM
|
2
|
-
remote: https://rubygems.org/
|
3
|
-
specs:
|
4
|
-
addressable (2.5.2)
|
5
|
-
public_suffix (>= 2.0.2, < 4.0)
|
6
|
-
ast (2.3.0)
|
7
|
-
builder (3.2.3)
|
8
|
-
codecov (0.1.10)
|
9
|
-
json
|
10
|
-
simplecov
|
11
|
-
url
|
12
|
-
crack (0.4.3)
|
13
|
-
safe_yaml (~> 1.0.0)
|
14
|
-
descendants_tracker (0.0.4)
|
15
|
-
thread_safe (~> 0.3, >= 0.3.1)
|
16
|
-
diff-lcs (1.3)
|
17
|
-
docile (1.1.5)
|
18
|
-
faraday (0.12.2)
|
19
|
-
multipart-post (>= 1.2, < 3)
|
20
|
-
git (1.3.0)
|
21
|
-
github_api (0.18.2)
|
22
|
-
addressable (~> 2.4)
|
23
|
-
descendants_tracker (~> 0.0.4)
|
24
|
-
faraday (~> 0.8)
|
25
|
-
hashie (~> 3.5, >= 3.5.2)
|
26
|
-
oauth2 (~> 1.0)
|
27
|
-
hashdiff (0.3.7)
|
28
|
-
hashie (3.5.7)
|
29
|
-
highline (1.7.10)
|
30
|
-
json (2.1.0)
|
31
|
-
juwelier (2.1.3)
|
32
|
-
builder
|
33
|
-
bundler (>= 1.13)
|
34
|
-
git (>= 1.2.5)
|
35
|
-
github_api
|
36
|
-
highline (>= 1.6.15)
|
37
|
-
nokogiri (>= 1.5.10)
|
38
|
-
rake
|
39
|
-
rdoc
|
40
|
-
semver
|
41
|
-
jwt (1.5.6)
|
42
|
-
mini_portile2 (2.3.0)
|
43
|
-
multi_json (1.12.2)
|
44
|
-
multi_xml (0.6.0)
|
45
|
-
multipart-post (2.0.0)
|
46
|
-
nokogiri (1.8.1)
|
47
|
-
mini_portile2 (~> 2.3.0)
|
48
|
-
oauth2 (1.4.0)
|
49
|
-
faraday (>= 0.8, < 0.13)
|
50
|
-
jwt (~> 1.0)
|
51
|
-
multi_json (~> 1.3)
|
52
|
-
multi_xml (~> 0.5)
|
53
|
-
rack (>= 1.2, < 3)
|
54
|
-
parallel (1.12.1)
|
55
|
-
parser (2.4.0.2)
|
56
|
-
ast (~> 2.3)
|
57
|
-
powerpack (0.1.1)
|
58
|
-
public_suffix (3.0.1)
|
59
|
-
rack (1.6.8)
|
60
|
-
rainbow (3.0.0)
|
61
|
-
rake (12.3.0)
|
62
|
-
rdoc (5.1.0)
|
63
|
-
rspec (3.7.0)
|
64
|
-
rspec-core (~> 3.7.0)
|
65
|
-
rspec-expectations (~> 3.7.0)
|
66
|
-
rspec-mocks (~> 3.7.0)
|
67
|
-
rspec-core (3.7.1)
|
68
|
-
rspec-support (~> 3.7.0)
|
69
|
-
rspec-expectations (3.7.0)
|
70
|
-
diff-lcs (>= 1.2.0, < 2.0)
|
71
|
-
rspec-support (~> 3.7.0)
|
72
|
-
rspec-mocks (3.7.0)
|
73
|
-
diff-lcs (>= 1.2.0, < 2.0)
|
74
|
-
rspec-support (~> 3.7.0)
|
75
|
-
rspec-support (3.7.0)
|
76
|
-
rubocop (0.52.1)
|
77
|
-
parallel (~> 1.10)
|
78
|
-
parser (>= 2.4.0.2, < 3.0)
|
79
|
-
powerpack (~> 0.1)
|
80
|
-
rainbow (>= 2.2.2, < 4.0)
|
81
|
-
ruby-progressbar (~> 1.7)
|
82
|
-
unicode-display_width (~> 1.0, >= 1.0.1)
|
83
|
-
ruby-progressbar (1.9.0)
|
84
|
-
safe_yaml (1.0.4)
|
85
|
-
semver (1.0.1)
|
86
|
-
simplecov (0.15.1)
|
87
|
-
docile (~> 1.1.0)
|
88
|
-
json (>= 1.8, < 3)
|
89
|
-
simplecov-html (~> 0.10.0)
|
90
|
-
simplecov-html (0.10.2)
|
91
|
-
thread_safe (0.3.6)
|
92
|
-
unicode-display_width (1.3.0)
|
93
|
-
url (0.3.2)
|
94
|
-
vcr (4.0.0)
|
95
|
-
webmock (3.2.1)
|
96
|
-
addressable (>= 2.3.6)
|
97
|
-
crack (>= 0.3.2)
|
98
|
-
hashdiff
|
99
|
-
|
100
|
-
PLATFORMS
|
101
|
-
ruby
|
102
|
-
|
103
|
-
DEPENDENCIES
|
104
|
-
codecov
|
105
|
-
juwelier
|
106
|
-
rspec
|
107
|
-
rubocop
|
108
|
-
simplecov
|
109
|
-
vcr
|
110
|
-
webmock
|
111
|
-
|
112
|
-
BUNDLED WITH
|
113
|
-
1.16.0.pre.2
|