deepl-rb 2.2.4 → 2.3.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/Gemfile +4 -0
- data/README.md +30 -16
- data/VERSION +1 -1
- data/deepl-rb.gemspec +11 -3
- data/lib/deepl.rb +6 -0
- data/lib/deepl/requests/languages.rb +28 -0
- data/lib/deepl/resources/language.rb +20 -0
- data/spec/api/configuration_spec.rb +1 -1
- data/spec/api/deepl_spec.rb +22 -0
- data/spec/fixtures/vcr_cassettes/deepl_languages.yml +41 -0
- data/spec/fixtures/vcr_cassettes/deepl_translate.yml +4 -5
- data/spec/fixtures/vcr_cassettes/deepl_usage.yml +10 -7
- data/spec/fixtures/vcr_cassettes/languages.yml +108 -0
- data/spec/fixtures/vcr_cassettes/translate_texts.yml +69 -33
- data/spec/fixtures/vcr_cassettes/usage.yml +10 -7
- data/spec/requests/languages_spec.rb +58 -0
- data/spec/requests/translate_spec.rb +4 -3
- data/spec/resources/language_spec.rb +20 -0
- data/spec/resources/text_spec.rb +2 -2
- data/spec/resources/usage_spec.rb +3 -3
- data/spec/spec_helper.rb +1 -1
- metadata +22 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f531ff13d2ba139bab65f6027f2e673f6480b097847d898531ecc7a9b247faea
|
4
|
+
data.tar.gz: e12727852eff8153dbb3a95d853d0fbd5ef5c703f02eaf7dedd089320e6873a2
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1d783cba5c207fb772589bc3f328a942919eff214778ea739a6924022bb7589a1898ab62a1cad2b9f6b177f857beb1bd0c5fbe290eba1467c31b26ab9cad461e
|
7
|
+
data.tar.gz: f14387ba9bc6e7ca3b97176fe1d51f4fa001ca9caba1dc6377d13e4c573896f953575f6efa682bbf55d6704657a53eb73686f9ec51711298549b49a2e5a07701
|
data/Gemfile
CHANGED
data/README.md
CHANGED
@@ -40,11 +40,39 @@ You can also configure the API host and the API version:
|
|
40
40
|
```rb
|
41
41
|
DeepL.configure do |config|
|
42
42
|
config.auth_key = 'your-api-token'
|
43
|
-
config.host = 'https://
|
43
|
+
config.host = 'https://api-free.deepl.com' # Default value is 'https://api.deepl.com'
|
44
44
|
config.version = 'v1' # Default value is 'v2'
|
45
45
|
end
|
46
46
|
```
|
47
47
|
|
48
|
+
### Available languages
|
49
|
+
|
50
|
+
Available languages can be retrieved via API:
|
51
|
+
|
52
|
+
```rb
|
53
|
+
languages = DeepL.languages
|
54
|
+
|
55
|
+
puts languages.class
|
56
|
+
# => Array
|
57
|
+
puts languages.first.class
|
58
|
+
# => DeepL::Resources::Language
|
59
|
+
puts "#{languages.first.code} -> #{languages.first.name}"
|
60
|
+
# => "ES -> Spanish"
|
61
|
+
```
|
62
|
+
|
63
|
+
Note that source and target languages may be different, which can be retrieved by using the `type`
|
64
|
+
option:
|
65
|
+
|
66
|
+
```rb
|
67
|
+
puts DeepL.languages(type: :source).count
|
68
|
+
# => 24
|
69
|
+
puts DeepL.languages(type: :target).count
|
70
|
+
# => 26
|
71
|
+
```
|
72
|
+
|
73
|
+
All languages are also defined on the
|
74
|
+
[official API documentation](https://www.deepl.com/docs-api/translating-text/)
|
75
|
+
|
48
76
|
### Translate
|
49
77
|
|
50
78
|
To translate a simple text, use the `translate` method:
|
@@ -79,20 +107,6 @@ puts translations.first.class
|
|
79
107
|
# => DeepL::Resources::Text
|
80
108
|
```
|
81
109
|
|
82
|
-
Here's a list of available language codes:
|
83
|
-
|
84
|
-
| Language code | Language
|
85
|
-
| --------------- | ---------------
|
86
|
-
| `EN` | English
|
87
|
-
| `DE` | German
|
88
|
-
| `FR` | French
|
89
|
-
| `ES` | Spanish
|
90
|
-
| `PT` | Portuguese
|
91
|
-
| `IT` | Italian
|
92
|
-
| `NL` | Dutch
|
93
|
-
| `PL` | Polish
|
94
|
-
| `RU` | Russian
|
95
|
-
|
96
110
|
You can also use custom query parameters, like `tag_handling`, `split_sentences`, `non_splitting_tags` or `ignore_tags`:
|
97
111
|
|
98
112
|
```rb
|
@@ -113,7 +127,7 @@ The following parameters will be automatically converted:
|
|
113
127
|
| `non_splitting_tags` | Converts arrays to strings joining by commas
|
114
128
|
| `ignore_tags` | Converts arrays to strings joining by commas
|
115
129
|
|
116
|
-
###
|
130
|
+
### Monitor usage
|
117
131
|
|
118
132
|
To check current API usage, use:
|
119
133
|
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
2.
|
1
|
+
2.3.0
|
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.
|
5
|
+
# stub: deepl-rb 2.3.0 ruby lib
|
6
6
|
|
7
7
|
Gem::Specification.new do |s|
|
8
8
|
s.name = "deepl-rb".freeze
|
9
|
-
s.version = "2.
|
9
|
+
s.version = "2.3.0"
|
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 = "2021-
|
14
|
+
s.date = "2021-05-17"
|
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 = [
|
@@ -37,20 +37,26 @@ Gem::Specification.new do |s|
|
|
37
37
|
"lib/deepl/exceptions/quota_exceeded.rb",
|
38
38
|
"lib/deepl/exceptions/request_error.rb",
|
39
39
|
"lib/deepl/requests/base.rb",
|
40
|
+
"lib/deepl/requests/languages.rb",
|
40
41
|
"lib/deepl/requests/translate.rb",
|
41
42
|
"lib/deepl/requests/usage.rb",
|
42
43
|
"lib/deepl/resources/base.rb",
|
44
|
+
"lib/deepl/resources/language.rb",
|
43
45
|
"lib/deepl/resources/text.rb",
|
44
46
|
"lib/deepl/resources/usage.rb",
|
45
47
|
"spec/api/api_spec.rb",
|
46
48
|
"spec/api/configuration_spec.rb",
|
47
49
|
"spec/api/deepl_spec.rb",
|
50
|
+
"spec/fixtures/vcr_cassettes/deepl_languages.yml",
|
48
51
|
"spec/fixtures/vcr_cassettes/deepl_translate.yml",
|
49
52
|
"spec/fixtures/vcr_cassettes/deepl_usage.yml",
|
53
|
+
"spec/fixtures/vcr_cassettes/languages.yml",
|
50
54
|
"spec/fixtures/vcr_cassettes/translate_texts.yml",
|
51
55
|
"spec/fixtures/vcr_cassettes/usage.yml",
|
56
|
+
"spec/requests/languages_spec.rb",
|
52
57
|
"spec/requests/translate_spec.rb",
|
53
58
|
"spec/requests/usage_spec.rb",
|
59
|
+
"spec/resources/language_spec.rb",
|
54
60
|
"spec/resources/text_spec.rb",
|
55
61
|
"spec/resources/usage_spec.rb",
|
56
62
|
"spec/spec_helper.rb"
|
@@ -66,8 +72,10 @@ Gem::Specification.new do |s|
|
|
66
72
|
|
67
73
|
if s.respond_to? :add_runtime_dependency then
|
68
74
|
s.add_development_dependency(%q<juwelier>.freeze, [">= 0"])
|
75
|
+
s.add_development_dependency(%q<byebug>.freeze, [">= 0"])
|
69
76
|
else
|
70
77
|
s.add_dependency(%q<juwelier>.freeze, [">= 0"])
|
78
|
+
s.add_dependency(%q<byebug>.freeze, [">= 0"])
|
71
79
|
end
|
72
80
|
end
|
73
81
|
|
data/lib/deepl.rb
CHANGED
@@ -14,11 +14,13 @@ require 'deepl/exceptions/quota_exceeded'
|
|
14
14
|
|
15
15
|
# -- Requests
|
16
16
|
require 'deepl/requests/base'
|
17
|
+
require 'deepl/requests/languages'
|
17
18
|
require 'deepl/requests/translate'
|
18
19
|
require 'deepl/requests/usage'
|
19
20
|
|
20
21
|
# -- Responses and resources
|
21
22
|
require 'deepl/resources/base'
|
23
|
+
require 'deepl/resources/language'
|
22
24
|
require 'deepl/resources/text'
|
23
25
|
require 'deepl/resources/usage'
|
24
26
|
|
@@ -36,6 +38,10 @@ module DeepL
|
|
36
38
|
@api ||= API.new(configuration)
|
37
39
|
end
|
38
40
|
|
41
|
+
def languages(options = {})
|
42
|
+
Requests::Languages.new(api, options).request
|
43
|
+
end
|
44
|
+
|
39
45
|
def translate(text, source_lang, target_lang, options = {})
|
40
46
|
configure if @configuration.nil?
|
41
47
|
Requests::Translate.new(api, text, source_lang, target_lang, options).request
|
@@ -0,0 +1,28 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module DeepL
|
4
|
+
module Requests
|
5
|
+
class Languages < Base
|
6
|
+
def initialize(api, options = {})
|
7
|
+
super(api, options)
|
8
|
+
end
|
9
|
+
|
10
|
+
def request
|
11
|
+
build_languages(*get)
|
12
|
+
end
|
13
|
+
|
14
|
+
private
|
15
|
+
|
16
|
+
def build_languages(request, response)
|
17
|
+
data = JSON.parse(response.body)
|
18
|
+
data.map do |language|
|
19
|
+
Resources::Language.new(language['language'], language['name'], request, response)
|
20
|
+
end
|
21
|
+
end
|
22
|
+
|
23
|
+
def path
|
24
|
+
'languages'
|
25
|
+
end
|
26
|
+
end
|
27
|
+
end
|
28
|
+
end
|
@@ -0,0 +1,20 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module DeepL
|
4
|
+
module Resources
|
5
|
+
class Language < Base
|
6
|
+
attr_reader :code, :name
|
7
|
+
|
8
|
+
def initialize(code, name, *args)
|
9
|
+
super(*args)
|
10
|
+
|
11
|
+
@code = code
|
12
|
+
@name = name
|
13
|
+
end
|
14
|
+
|
15
|
+
def to_s
|
16
|
+
"#{code} - #{name}"
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
@@ -16,7 +16,7 @@ describe DeepL::Configuration do
|
|
16
16
|
end
|
17
17
|
|
18
18
|
context 'When using custom configuration attributes' do
|
19
|
-
let(:attributes) { { auth_key: 'SAMPLE', host: '
|
19
|
+
let(:attributes) { { auth_key: 'SAMPLE', host: 'https://api-free.deepl.com', version: 'v1' } }
|
20
20
|
|
21
21
|
it 'should use custom attributes' do
|
22
22
|
expect(subject.auth_key).to eq(attributes[:auth_key])
|
data/spec/api/deepl_spec.rb
CHANGED
@@ -47,6 +47,7 @@ describe DeepL do
|
|
47
47
|
let(:options) { { param: 'fake' } }
|
48
48
|
|
49
49
|
around do |example|
|
50
|
+
subject.configure { |config| config.host = 'https://api-free.deepl.com' }
|
50
51
|
VCR.use_cassette('deepl_translate') { example.call }
|
51
52
|
end
|
52
53
|
|
@@ -65,6 +66,7 @@ describe DeepL do
|
|
65
66
|
let(:options) { {} }
|
66
67
|
|
67
68
|
around do |example|
|
69
|
+
subject.configure { |config| config.host = 'https://api-free.deepl.com' }
|
68
70
|
VCR.use_cassette('deepl_usage') { example.call }
|
69
71
|
end
|
70
72
|
|
@@ -78,4 +80,24 @@ describe DeepL do
|
|
78
80
|
end
|
79
81
|
end
|
80
82
|
end
|
83
|
+
|
84
|
+
describe '#languages' do
|
85
|
+
let(:options) { { type: :target } }
|
86
|
+
|
87
|
+
around do |example|
|
88
|
+
subject.configure { |config| config.host = 'https://api-free.deepl.com' }
|
89
|
+
VCR.use_cassette('deepl_languages') { example.call }
|
90
|
+
end
|
91
|
+
|
92
|
+
context 'When checking languages' do
|
93
|
+
it 'should create and call a request object' do
|
94
|
+
expect(DeepL::Requests::Languages).to receive(:new)
|
95
|
+
.with(subject.api, options).and_call_original
|
96
|
+
|
97
|
+
languages = subject.languages(options)
|
98
|
+
expect(languages).to be_an(Array)
|
99
|
+
expect(languages.all? { |l| l.is_a?(DeepL::Resources::Language) }).to be_truthy
|
100
|
+
end
|
101
|
+
end
|
102
|
+
end
|
81
103
|
end
|
@@ -0,0 +1,41 @@
|
|
1
|
+
---
|
2
|
+
http_interactions:
|
3
|
+
- request:
|
4
|
+
method: get
|
5
|
+
uri: https://api-free.deepl.com/v2/languages?auth_key=VALID_TOKEN&type=target
|
6
|
+
body:
|
7
|
+
encoding: US-ASCII
|
8
|
+
string: ''
|
9
|
+
headers:
|
10
|
+
Accept-Encoding:
|
11
|
+
- gzip;q=1.0,deflate;q=0.6,identity;q=0.3
|
12
|
+
Accept:
|
13
|
+
- "*/*"
|
14
|
+
User-Agent:
|
15
|
+
- Ruby
|
16
|
+
response:
|
17
|
+
status:
|
18
|
+
code: 200
|
19
|
+
message: OK
|
20
|
+
headers:
|
21
|
+
Server:
|
22
|
+
- nginx
|
23
|
+
Date:
|
24
|
+
- Mon, 17 May 2021 15:07:54 GMT
|
25
|
+
Content-Type:
|
26
|
+
- application/json
|
27
|
+
Content-Length:
|
28
|
+
- '1667'
|
29
|
+
Connection:
|
30
|
+
- keep-alive
|
31
|
+
Access-Control-Allow-Origin:
|
32
|
+
- "*"
|
33
|
+
body:
|
34
|
+
encoding: UTF-8
|
35
|
+
string: '[{"language":"BG","name":"Bulgarian","supports_formality":false},{"language":"CS","name":"Czech","supports_formality":false},{"language":"DA","name":"Danish","supports_formality":false},{"language":"DE","name":"German","supports_formality":true},{"language":"EL","name":"Greek","supports_formality":false},{"language":"EN-GB","name":"English
|
36
|
+
(British)","supports_formality":false},{"language":"EN-US","name":"English
|
37
|
+
(American)","supports_formality":false},{"language":"ES","name":"Spanish","supports_formality":true},{"language":"ET","name":"Estonian","supports_formality":false},{"language":"FI","name":"Finnish","supports_formality":false},{"language":"FR","name":"French","supports_formality":true},{"language":"HU","name":"Hungarian","supports_formality":false},{"language":"IT","name":"Italian","supports_formality":true},{"language":"JA","name":"Japanese","supports_formality":false},{"language":"LT","name":"Lithuanian","supports_formality":false},{"language":"LV","name":"Latvian","supports_formality":false},{"language":"NL","name":"Dutch","supports_formality":true},{"language":"PL","name":"Polish","supports_formality":true},{"language":"PT-BR","name":"Portuguese
|
38
|
+
(Brazilian)","supports_formality":true},{"language":"PT-PT","name":"Portuguese
|
39
|
+
(European)","supports_formality":true},{"language":"RO","name":"Romanian","supports_formality":false},{"language":"RU","name":"Russian","supports_formality":true},{"language":"SK","name":"Slovak","supports_formality":false},{"language":"SL","name":"Slovenian","supports_formality":false},{"language":"SV","name":"Swedish","supports_formality":false},{"language":"ZH","name":"Chinese","supports_formality":false}]'
|
40
|
+
recorded_at: Mon, 17 May 2021 15:07:54 GMT
|
41
|
+
recorded_with: VCR 6.0.0
|
@@ -2,7 +2,7 @@
|
|
2
2
|
http_interactions:
|
3
3
|
- request:
|
4
4
|
method: post
|
5
|
-
uri: https://api.deepl.com/v2/translate?auth_key=VALID_TOKEN¶m=fake
|
5
|
+
uri: https://api-free.deepl.com/v2/translate?auth_key=VALID_TOKEN¶m=fake
|
6
6
|
body:
|
7
7
|
encoding: US-ASCII
|
8
8
|
string: text=Sample&source_lang=EN&target_lang=ES
|
@@ -23,7 +23,7 @@ http_interactions:
|
|
23
23
|
Server:
|
24
24
|
- nginx
|
25
25
|
Date:
|
26
|
-
-
|
26
|
+
- Mon, 17 May 2021 14:42:56 GMT
|
27
27
|
Content-Type:
|
28
28
|
- application/json
|
29
29
|
Content-Length:
|
@@ -35,6 +35,5 @@ http_interactions:
|
|
35
35
|
body:
|
36
36
|
encoding: UTF-8
|
37
37
|
string: '{"translations":[{"detected_source_language":"EN","text":"Muestra"}]}'
|
38
|
-
|
39
|
-
|
40
|
-
recorded_with: VCR 4.0.0
|
38
|
+
recorded_at: Mon, 17 May 2021 14:42:56 GMT
|
39
|
+
recorded_with: VCR 6.0.0
|
@@ -2,7 +2,7 @@
|
|
2
2
|
http_interactions:
|
3
3
|
- request:
|
4
4
|
method: get
|
5
|
-
uri: https://api.deepl.com/v2/usage?auth_key=VALID_TOKEN
|
5
|
+
uri: https://api-free.deepl.com/v2/usage?auth_key=VALID_TOKEN
|
6
6
|
body:
|
7
7
|
encoding: US-ASCII
|
8
8
|
string: ''
|
@@ -21,14 +21,17 @@ http_interactions:
|
|
21
21
|
Server:
|
22
22
|
- nginx
|
23
23
|
Date:
|
24
|
-
-
|
24
|
+
- Mon, 17 May 2021 14:18:28 GMT
|
25
|
+
Content-Type:
|
26
|
+
- application/json
|
25
27
|
Content-Length:
|
26
|
-
- '
|
28
|
+
- '48'
|
27
29
|
Connection:
|
28
30
|
- keep-alive
|
31
|
+
Access-Control-Allow-Origin:
|
32
|
+
- "*"
|
29
33
|
body:
|
30
34
|
encoding: UTF-8
|
31
|
-
string: '{"character_count":
|
32
|
-
|
33
|
-
|
34
|
-
recorded_with: VCR 4.0.0
|
35
|
+
string: '{"character_count":303,"character_limit":500000}'
|
36
|
+
recorded_at: Mon, 17 May 2021 14:18:28 GMT
|
37
|
+
recorded_with: VCR 6.0.0
|
@@ -0,0 +1,108 @@
|
|
1
|
+
---
|
2
|
+
http_interactions:
|
3
|
+
- request:
|
4
|
+
method: get
|
5
|
+
uri: https://api-free.deepl.com/v2/languages?auth_key=VALID_TOKEN
|
6
|
+
body:
|
7
|
+
encoding: US-ASCII
|
8
|
+
string: ''
|
9
|
+
headers:
|
10
|
+
Accept-Encoding:
|
11
|
+
- gzip;q=1.0,deflate;q=0.6,identity;q=0.3
|
12
|
+
Accept:
|
13
|
+
- "*/*"
|
14
|
+
User-Agent:
|
15
|
+
- Ruby
|
16
|
+
response:
|
17
|
+
status:
|
18
|
+
code: 200
|
19
|
+
message: OK
|
20
|
+
headers:
|
21
|
+
Server:
|
22
|
+
- nginx
|
23
|
+
Date:
|
24
|
+
- Mon, 17 May 2021 14:49:42 GMT
|
25
|
+
Content-Type:
|
26
|
+
- application/json
|
27
|
+
Content-Length:
|
28
|
+
- '845'
|
29
|
+
Connection:
|
30
|
+
- keep-alive
|
31
|
+
Access-Control-Allow-Origin:
|
32
|
+
- "*"
|
33
|
+
body:
|
34
|
+
encoding: UTF-8
|
35
|
+
string: '[{"language":"BG","name":"Bulgarian"},{"language":"CS","name":"Czech"},{"language":"DA","name":"Danish"},{"language":"DE","name":"German"},{"language":"EL","name":"Greek"},{"language":"EN","name":"English"},{"language":"ES","name":"Spanish"},{"language":"ET","name":"Estonian"},{"language":"FI","name":"Finnish"},{"language":"FR","name":"French"},{"language":"HU","name":"Hungarian"},{"language":"IT","name":"Italian"},{"language":"JA","name":"Japanese"},{"language":"LT","name":"Lithuanian"},{"language":"LV","name":"Latvian"},{"language":"NL","name":"Dutch"},{"language":"PL","name":"Polish"},{"language":"PT","name":"Portuguese"},{"language":"RO","name":"Romanian"},{"language":"RU","name":"Russian"},{"language":"SK","name":"Slovak"},{"language":"SL","name":"Slovenian"},{"language":"SV","name":"Swedish"},{"language":"ZH","name":"Chinese"}]'
|
36
|
+
recorded_at: Mon, 17 May 2021 14:49:42 GMT
|
37
|
+
- request:
|
38
|
+
method: get
|
39
|
+
uri: https://api-free.deepl.com/v2/languages?auth_key=VALID_TOKEN&type=target
|
40
|
+
body:
|
41
|
+
encoding: US-ASCII
|
42
|
+
string: ''
|
43
|
+
headers:
|
44
|
+
Accept-Encoding:
|
45
|
+
- gzip;q=1.0,deflate;q=0.6,identity;q=0.3
|
46
|
+
Accept:
|
47
|
+
- "*/*"
|
48
|
+
User-Agent:
|
49
|
+
- Ruby
|
50
|
+
response:
|
51
|
+
status:
|
52
|
+
code: 200
|
53
|
+
message: OK
|
54
|
+
headers:
|
55
|
+
Server:
|
56
|
+
- nginx
|
57
|
+
Date:
|
58
|
+
- Mon, 17 May 2021 14:55:30 GMT
|
59
|
+
Content-Type:
|
60
|
+
- application/json
|
61
|
+
Content-Length:
|
62
|
+
- '1667'
|
63
|
+
Connection:
|
64
|
+
- keep-alive
|
65
|
+
Access-Control-Allow-Origin:
|
66
|
+
- "*"
|
67
|
+
body:
|
68
|
+
encoding: UTF-8
|
69
|
+
string: '[{"language":"BG","name":"Bulgarian","supports_formality":false},{"language":"CS","name":"Czech","supports_formality":false},{"language":"DA","name":"Danish","supports_formality":false},{"language":"DE","name":"German","supports_formality":true},{"language":"EL","name":"Greek","supports_formality":false},{"language":"EN-GB","name":"English
|
70
|
+
(British)","supports_formality":false},{"language":"EN-US","name":"English
|
71
|
+
(American)","supports_formality":false},{"language":"ES","name":"Spanish","supports_formality":true},{"language":"ET","name":"Estonian","supports_formality":false},{"language":"FI","name":"Finnish","supports_formality":false},{"language":"FR","name":"French","supports_formality":true},{"language":"HU","name":"Hungarian","supports_formality":false},{"language":"IT","name":"Italian","supports_formality":true},{"language":"JA","name":"Japanese","supports_formality":false},{"language":"LT","name":"Lithuanian","supports_formality":false},{"language":"LV","name":"Latvian","supports_formality":false},{"language":"NL","name":"Dutch","supports_formality":true},{"language":"PL","name":"Polish","supports_formality":true},{"language":"PT-BR","name":"Portuguese
|
72
|
+
(Brazilian)","supports_formality":true},{"language":"PT-PT","name":"Portuguese
|
73
|
+
(European)","supports_formality":true},{"language":"RO","name":"Romanian","supports_formality":false},{"language":"RU","name":"Russian","supports_formality":true},{"language":"SK","name":"Slovak","supports_formality":false},{"language":"SL","name":"Slovenian","supports_formality":false},{"language":"SV","name":"Swedish","supports_formality":false},{"language":"ZH","name":"Chinese","supports_formality":false}]'
|
74
|
+
recorded_at: Mon, 17 May 2021 14:55:30 GMT
|
75
|
+
- request:
|
76
|
+
method: get
|
77
|
+
uri: https://api-free.deepl.com/v2/languages?auth_key=VALID_TOKEN&type=invalid
|
78
|
+
body:
|
79
|
+
encoding: US-ASCII
|
80
|
+
string: ''
|
81
|
+
headers:
|
82
|
+
Accept-Encoding:
|
83
|
+
- gzip;q=1.0,deflate;q=0.6,identity;q=0.3
|
84
|
+
Accept:
|
85
|
+
- "*/*"
|
86
|
+
User-Agent:
|
87
|
+
- Ruby
|
88
|
+
response:
|
89
|
+
status:
|
90
|
+
code: 400
|
91
|
+
message: Bad Request
|
92
|
+
headers:
|
93
|
+
Server:
|
94
|
+
- nginx
|
95
|
+
Date:
|
96
|
+
- Mon, 17 May 2021 14:57:00 GMT
|
97
|
+
Content-Length:
|
98
|
+
- '82'
|
99
|
+
Connection:
|
100
|
+
- keep-alive
|
101
|
+
Access-Control-Allow-Origin:
|
102
|
+
- "*"
|
103
|
+
body:
|
104
|
+
encoding: UTF-8
|
105
|
+
string: '{"message":"Parameter ''type'' is invalid. ''source'' and ''target''
|
106
|
+
are valid values."}'
|
107
|
+
recorded_at: Mon, 17 May 2021 14:57:00 GMT
|
108
|
+
recorded_with: VCR 6.0.0
|
@@ -2,7 +2,7 @@
|
|
2
2
|
http_interactions:
|
3
3
|
- request:
|
4
4
|
method: post
|
5
|
-
uri: https://api.deepl.com/v2/translate?auth_key=VALID_TOKEN
|
5
|
+
uri: https://api-free.deepl.com/v2/translate?auth_key=VALID_TOKEN
|
6
6
|
body:
|
7
7
|
encoding: US-ASCII
|
8
8
|
string: text=Sample+text&source_lang=EN&target_lang=ES
|
@@ -23,11 +23,11 @@ http_interactions:
|
|
23
23
|
Server:
|
24
24
|
- nginx
|
25
25
|
Date:
|
26
|
-
-
|
26
|
+
- Mon, 17 May 2021 14:20:14 GMT
|
27
27
|
Content-Type:
|
28
28
|
- application/json
|
29
29
|
Content-Length:
|
30
|
-
- '
|
30
|
+
- '78'
|
31
31
|
Connection:
|
32
32
|
- keep-alive
|
33
33
|
Access-Control-Allow-Origin:
|
@@ -36,11 +36,10 @@ http_interactions:
|
|
36
36
|
encoding: UTF-8
|
37
37
|
string: '{"translations":[{"detected_source_language":"EN","text":"Texto de
|
38
38
|
muestra"}]}'
|
39
|
-
|
40
|
-
recorded_at: Tue, 08 May 2018 16:31:34 GMT
|
39
|
+
recorded_at: Mon, 17 May 2021 14:20:14 GMT
|
41
40
|
- request:
|
42
41
|
method: post
|
43
|
-
uri: https://api.deepl.com/v2/translate?auth_key=VALID_TOKEN
|
42
|
+
uri: https://api-free.deepl.com/v2/translate?auth_key=VALID_TOKEN
|
44
43
|
body:
|
45
44
|
encoding: US-ASCII
|
46
45
|
string: text=Sample&text=Word&source_lang=EN&target_lang=ES
|
@@ -61,7 +60,7 @@ http_interactions:
|
|
61
60
|
Server:
|
62
61
|
- nginx
|
63
62
|
Date:
|
64
|
-
-
|
63
|
+
- Mon, 17 May 2021 14:20:14 GMT
|
65
64
|
Content-Type:
|
66
65
|
- application/json
|
67
66
|
Content-Length:
|
@@ -73,11 +72,10 @@ http_interactions:
|
|
73
72
|
body:
|
74
73
|
encoding: UTF-8
|
75
74
|
string: '{"translations":[{"detected_source_language":"EN","text":"Muestra"},{"detected_source_language":"EN","text":"Palabra"}]}'
|
76
|
-
|
77
|
-
recorded_at: Tue, 08 May 2018 16:31:35 GMT
|
75
|
+
recorded_at: Mon, 17 May 2021 14:20:14 GMT
|
78
76
|
- request:
|
79
77
|
method: post
|
80
|
-
uri: https://api.deepl.com/v2/translate?auth_key=VALID_TOKEN
|
78
|
+
uri: https://api-free.deepl.com/v2/translate?auth_key=VALID_TOKEN&tag_handling=xml
|
81
79
|
body:
|
82
80
|
encoding: US-ASCII
|
83
81
|
string: text=%3Cp%3ESample+text%3C%2Fp%3E&source_lang=EN&target_lang=ES
|
@@ -98,7 +96,7 @@ http_interactions:
|
|
98
96
|
Server:
|
99
97
|
- nginx
|
100
98
|
Date:
|
101
|
-
-
|
99
|
+
- Mon, 17 May 2021 14:20:15 GMT
|
102
100
|
Content-Type:
|
103
101
|
- application/json
|
104
102
|
Content-Length:
|
@@ -111,11 +109,47 @@ http_interactions:
|
|
111
109
|
encoding: UTF-8
|
112
110
|
string: '{"translations":[{"detected_source_language":"EN","text":"<p>Texto
|
113
111
|
de muestra</p>"}]}'
|
114
|
-
|
115
|
-
recorded_at: Tue, 08 May 2018 16:31:36 GMT
|
112
|
+
recorded_at: Mon, 17 May 2021 14:20:15 GMT
|
116
113
|
- request:
|
117
114
|
method: post
|
118
|
-
uri: https://api.deepl.com/v2/translate?auth_key=
|
115
|
+
uri: https://api-free.deepl.com/v2/translate?auth_key=VALID_TOKEN&ignore_tags=code,span
|
116
|
+
body:
|
117
|
+
encoding: US-ASCII
|
118
|
+
string: text=Welcome+and+%3Ccode%3EHello+great+World%3C%2Fcode%3E+Good+Morning%21&source_lang=EN&target_lang=ES
|
119
|
+
headers:
|
120
|
+
Accept-Encoding:
|
121
|
+
- gzip;q=1.0,deflate;q=0.6,identity;q=0.3
|
122
|
+
Accept:
|
123
|
+
- "*/*"
|
124
|
+
User-Agent:
|
125
|
+
- Ruby
|
126
|
+
Content-Type:
|
127
|
+
- application/x-www-form-urlencoded
|
128
|
+
response:
|
129
|
+
status:
|
130
|
+
code: 200
|
131
|
+
message: OK
|
132
|
+
headers:
|
133
|
+
Server:
|
134
|
+
- nginx
|
135
|
+
Date:
|
136
|
+
- Mon, 17 May 2021 14:20:16 GMT
|
137
|
+
Content-Type:
|
138
|
+
- application/json
|
139
|
+
Content-Length:
|
140
|
+
- '119'
|
141
|
+
Connection:
|
142
|
+
- keep-alive
|
143
|
+
Access-Control-Allow-Origin:
|
144
|
+
- "*"
|
145
|
+
body:
|
146
|
+
encoding: ASCII-8BIT
|
147
|
+
string: !binary |-
|
148
|
+
eyJ0cmFuc2xhdGlvbnMiOlt7ImRldGVjdGVkX3NvdXJjZV9sYW5ndWFnZSI6IkVOIiwidGV4dCI6IkJpZW52ZW5pZG8geSA8Y29kZT5Ib2xhIGdyYW4gbXVuZG88L2NvZGU+IMKhQnVlbm9zIGTDrWFzISJ9XX0=
|
149
|
+
recorded_at: Mon, 17 May 2021 14:20:16 GMT
|
150
|
+
- request:
|
151
|
+
method: post
|
152
|
+
uri: https://api-free.deepl.com/v2/translate?auth_key=invalid
|
119
153
|
body:
|
120
154
|
encoding: US-ASCII
|
121
155
|
string: text=Sample+text&source_lang=EN&target_lang=ES
|
@@ -136,19 +170,20 @@ http_interactions:
|
|
136
170
|
Server:
|
137
171
|
- nginx
|
138
172
|
Date:
|
139
|
-
-
|
173
|
+
- Mon, 17 May 2021 14:20:16 GMT
|
140
174
|
Content-Length:
|
141
175
|
- '0'
|
142
176
|
Connection:
|
143
177
|
- keep-alive
|
178
|
+
Access-Control-Allow-Origin:
|
179
|
+
- "*"
|
144
180
|
body:
|
145
181
|
encoding: UTF-8
|
146
182
|
string: ''
|
147
|
-
|
148
|
-
recorded_at: Tue, 08 May 2018 16:31:37 GMT
|
183
|
+
recorded_at: Mon, 17 May 2021 14:20:16 GMT
|
149
184
|
- request:
|
150
185
|
method: post
|
151
|
-
uri: https://api.deepl.com/v2/translate?auth_key=VALID_TOKEN
|
186
|
+
uri: https://api-free.deepl.com/v2/translate?auth_key=VALID_TOKEN
|
152
187
|
body:
|
153
188
|
encoding: US-ASCII
|
154
189
|
string: source_lang=EN&target_lang=ES
|
@@ -169,19 +204,20 @@ http_interactions:
|
|
169
204
|
Server:
|
170
205
|
- nginx
|
171
206
|
Date:
|
172
|
-
-
|
207
|
+
- Mon, 17 May 2021 14:20:16 GMT
|
173
208
|
Content-Length:
|
174
209
|
- '45'
|
175
210
|
Connection:
|
176
211
|
- keep-alive
|
212
|
+
Access-Control-Allow-Origin:
|
213
|
+
- "*"
|
177
214
|
body:
|
178
215
|
encoding: UTF-8
|
179
216
|
string: '{"message":"Parameter ''text'' not specified."}'
|
180
|
-
|
181
|
-
recorded_at: Tue, 08 May 2018 16:31:37 GMT
|
217
|
+
recorded_at: Mon, 17 May 2021 14:20:16 GMT
|
182
218
|
- request:
|
183
219
|
method: post
|
184
|
-
uri: https://api.deepl.com/v2/translate?auth_key=VALID_TOKEN
|
220
|
+
uri: https://api-free.deepl.com/v2/translate?auth_key=VALID_TOKEN
|
185
221
|
body:
|
186
222
|
encoding: US-ASCII
|
187
223
|
string: text=Sample+text&source_lang=EN
|
@@ -202,19 +238,20 @@ http_interactions:
|
|
202
238
|
Server:
|
203
239
|
- nginx
|
204
240
|
Date:
|
205
|
-
-
|
241
|
+
- Mon, 17 May 2021 14:20:17 GMT
|
206
242
|
Content-Length:
|
207
243
|
- '52'
|
208
244
|
Connection:
|
209
245
|
- keep-alive
|
246
|
+
Access-Control-Allow-Origin:
|
247
|
+
- "*"
|
210
248
|
body:
|
211
249
|
encoding: UTF-8
|
212
|
-
string: '{"message":"
|
213
|
-
|
214
|
-
recorded_at: Tue, 08 May 2018 16:31:37 GMT
|
250
|
+
string: '{"message":"Value for ''target_lang'' not supported."}'
|
251
|
+
recorded_at: Mon, 17 May 2021 14:20:17 GMT
|
215
252
|
- request:
|
216
253
|
method: post
|
217
|
-
uri: https://api.deepl.com/v2/translate?auth_key=VALID_TOKEN&ignore_tags=code
|
254
|
+
uri: https://api-free.deepl.com/v2/translate?auth_key=VALID_TOKEN&ignore_tags=code,span&tag_handling=xml
|
218
255
|
body:
|
219
256
|
encoding: US-ASCII
|
220
257
|
string: text=Welcome+and+%3Ccode%3EHello+great+World%3C%2Fcode%3E+Good+Morning%21&source_lang=EN&target_lang=ES
|
@@ -235,11 +272,11 @@ http_interactions:
|
|
235
272
|
Server:
|
236
273
|
- nginx
|
237
274
|
Date:
|
238
|
-
-
|
275
|
+
- Mon, 17 May 2021 14:20:56 GMT
|
239
276
|
Content-Type:
|
240
277
|
- application/json
|
241
278
|
Content-Length:
|
242
|
-
- '
|
279
|
+
- '121'
|
243
280
|
Connection:
|
244
281
|
- keep-alive
|
245
282
|
Access-Control-Allow-Origin:
|
@@ -247,7 +284,6 @@ http_interactions:
|
|
247
284
|
body:
|
248
285
|
encoding: ASCII-8BIT
|
249
286
|
string: !binary |-
|
250
|
-
|
251
|
-
|
252
|
-
|
253
|
-
recorded_with: VCR 4.0.0
|
287
|
+
eyJ0cmFuc2xhdGlvbnMiOlt7ImRldGVjdGVkX3NvdXJjZV9sYW5ndWFnZSI6IkVOIiwidGV4dCI6IkJpZW52ZW5pZG8geSA8Y29kZT5IZWxsbyBncmVhdCBXb3JsZDwvY29kZT4gwqFCdWVub3MgZMOtYXMhIn1dfQ==
|
288
|
+
recorded_at: Mon, 17 May 2021 14:20:56 GMT
|
289
|
+
recorded_with: VCR 6.0.0
|
@@ -2,7 +2,7 @@
|
|
2
2
|
http_interactions:
|
3
3
|
- request:
|
4
4
|
method: get
|
5
|
-
uri: https://api.deepl.com/v2/usage?auth_key=VALID_TOKEN
|
5
|
+
uri: https://api-free.deepl.com/v2/usage?auth_key=VALID_TOKEN
|
6
6
|
body:
|
7
7
|
encoding: US-ASCII
|
8
8
|
string: ''
|
@@ -21,14 +21,17 @@ http_interactions:
|
|
21
21
|
Server:
|
22
22
|
- nginx
|
23
23
|
Date:
|
24
|
-
-
|
24
|
+
- Mon, 17 May 2021 14:18:32 GMT
|
25
|
+
Content-Type:
|
26
|
+
- application/json
|
25
27
|
Content-Length:
|
26
|
-
- '
|
28
|
+
- '48'
|
27
29
|
Connection:
|
28
30
|
- keep-alive
|
31
|
+
Access-Control-Allow-Origin:
|
32
|
+
- "*"
|
29
33
|
body:
|
30
34
|
encoding: UTF-8
|
31
|
-
string: '{"character_count":
|
32
|
-
|
33
|
-
|
34
|
-
recorded_with: VCR 4.0.0
|
35
|
+
string: '{"character_count":353,"character_limit":500000}'
|
36
|
+
recorded_at: Mon, 17 May 2021 14:18:32 GMT
|
37
|
+
recorded_with: VCR 6.0.0
|
@@ -0,0 +1,58 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'spec_helper'
|
4
|
+
|
5
|
+
describe DeepL::Requests::Languages do
|
6
|
+
let(:api) { build_deepl_api }
|
7
|
+
let(:options) { {} }
|
8
|
+
subject { DeepL::Requests::Languages.new(api, options) }
|
9
|
+
|
10
|
+
describe '#initialize' do
|
11
|
+
context 'When building a request' do
|
12
|
+
it 'should create a request object' do
|
13
|
+
expect(subject).to be_a(described_class)
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|
17
|
+
|
18
|
+
describe '#request' do
|
19
|
+
around do |example|
|
20
|
+
VCR.use_cassette('languages') { example.call }
|
21
|
+
end
|
22
|
+
|
23
|
+
context 'When requesting source languages' do
|
24
|
+
it 'should return an usage object' do
|
25
|
+
languages = subject.request
|
26
|
+
|
27
|
+
expect(languages).to be_an(Array)
|
28
|
+
expect(languages.size).to eq(24)
|
29
|
+
expect(languages.any? { |l| l.code == 'EN' && l.name == 'English' }).to be_truthy
|
30
|
+
expect(languages.any? { |l| l.code == 'ES' && l.name == 'Spanish' }).to be_truthy
|
31
|
+
end
|
32
|
+
end
|
33
|
+
|
34
|
+
context 'When requesting target languages' do
|
35
|
+
let(:options) { { type: :target } }
|
36
|
+
|
37
|
+
it 'should return an usage object' do
|
38
|
+
languages = subject.request
|
39
|
+
|
40
|
+
expect(languages).to be_an(Array)
|
41
|
+
expect(languages.size).to eq(26)
|
42
|
+
expect(languages.any? { |l| l.code == 'EN' && l.name == 'English' }).to be_falsey
|
43
|
+
expect(languages.any? { |l| l.code == 'ES' && l.name == 'Spanish' }).to be_truthy
|
44
|
+
expect(languages.any? { |l| l.code == 'EN-US' && l.name == 'English (American)' })
|
45
|
+
.to be_truthy
|
46
|
+
end
|
47
|
+
end
|
48
|
+
|
49
|
+
context 'When using an invalid type' do
|
50
|
+
let(:options) { { type: :invalid } }
|
51
|
+
|
52
|
+
it 'should return an usage object' do
|
53
|
+
message = "Parameter 'type' is invalid. 'source' and 'target' are valid values."
|
54
|
+
expect { subject.request }.to raise_error(DeepL::Exceptions::BadRequest, message)
|
55
|
+
end
|
56
|
+
end
|
57
|
+
end
|
58
|
+
end
|
@@ -151,6 +151,7 @@ describe DeepL::Requests::Translate do
|
|
151
151
|
|
152
152
|
context 'When performing a valid request with tag handling' do
|
153
153
|
let(:text) { '<p>Sample text</p>' }
|
154
|
+
let(:options) { { tag_handling: 'xml' } }
|
154
155
|
|
155
156
|
it 'should return a text object' do
|
156
157
|
text = subject.request
|
@@ -163,13 +164,13 @@ describe DeepL::Requests::Translate do
|
|
163
164
|
|
164
165
|
context 'When performing a valid request and passing a variable' do
|
165
166
|
let(:text) { 'Welcome and <code>Hello great World</code> Good Morning!' }
|
166
|
-
let(:options) { { ignore_tags: 'code,
|
167
|
+
let(:options) { { tag_handling: 'xml', ignore_tags: 'code,span' } }
|
167
168
|
|
168
169
|
it 'should return a text object' do
|
169
170
|
text = subject.request
|
170
171
|
|
171
172
|
expect(text).to be_a(DeepL::Resources::Text)
|
172
|
-
expect(text.text).to eq('Bienvenido y <code>Hello great World</code> Buenos días!')
|
173
|
+
expect(text.text).to eq('Bienvenido y <code>Hello great World</code> ¡Buenos días!')
|
173
174
|
expect(text.detected_source_language).to eq('EN')
|
174
175
|
end
|
175
176
|
end
|
@@ -200,7 +201,7 @@ describe DeepL::Requests::Translate do
|
|
200
201
|
let(:target_lang) { nil }
|
201
202
|
|
202
203
|
it 'should raise a bad request error' do
|
203
|
-
message = "
|
204
|
+
message = "Value for 'target_lang' not supported."
|
204
205
|
expect { subject.request }.to raise_error(DeepL::Exceptions::BadRequest, message)
|
205
206
|
end
|
206
207
|
end
|
@@ -0,0 +1,20 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'spec_helper'
|
4
|
+
|
5
|
+
describe DeepL::Resources::Language do
|
6
|
+
subject { described_class.new('EN', 'English', nil, nil) }
|
7
|
+
|
8
|
+
describe '#initialize' do
|
9
|
+
context 'When building a basic object' do
|
10
|
+
it 'should create a resource' do
|
11
|
+
expect(subject).to be_a(described_class)
|
12
|
+
end
|
13
|
+
|
14
|
+
it 'should assign the attributes' do
|
15
|
+
expect(subject.code).to eq('EN')
|
16
|
+
expect(subject.name).to eq('English')
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
data/spec/resources/text_spec.rb
CHANGED
@@ -3,12 +3,12 @@
|
|
3
3
|
require 'spec_helper'
|
4
4
|
|
5
5
|
describe DeepL::Resources::Text do
|
6
|
-
subject {
|
6
|
+
subject { described_class.new('Target', 'es', nil, nil) }
|
7
7
|
|
8
8
|
describe '#initialize' do
|
9
9
|
context 'When building a basic object' do
|
10
10
|
it 'should create a resource' do
|
11
|
-
expect(subject).to be_a(
|
11
|
+
expect(subject).to be_a(described_class)
|
12
12
|
end
|
13
13
|
|
14
14
|
it 'should assign the attributes' do
|
@@ -3,12 +3,12 @@
|
|
3
3
|
require 'spec_helper'
|
4
4
|
|
5
5
|
describe DeepL::Resources::Usage do
|
6
|
-
subject {
|
6
|
+
subject { described_class.new(3, 5, nil, nil) }
|
7
7
|
|
8
8
|
describe '#initialize' do
|
9
9
|
context 'When building a basic object' do
|
10
10
|
it 'should create a resource' do
|
11
|
-
expect(subject).to be_a(
|
11
|
+
expect(subject).to be_a(described_class)
|
12
12
|
end
|
13
13
|
|
14
14
|
it 'should assign the attributes' do
|
@@ -22,7 +22,7 @@ describe DeepL::Resources::Usage do
|
|
22
22
|
end
|
23
23
|
|
24
24
|
context 'When building a quota exceeded object' do
|
25
|
-
subject {
|
25
|
+
subject { described_class.new(5, 5, nil, nil) }
|
26
26
|
|
27
27
|
it 'should exceed the quota' do
|
28
28
|
expect(subject.quota_exceeded?).to be_truthy
|
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.
|
4
|
+
version: 2.3.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Daniel Herzog
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-
|
11
|
+
date: 2021-05-17 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: byebug
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - ">="
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '0'
|
34
|
+
type: :development
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - ">="
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '0'
|
27
41
|
description: 'A simple ruby wrapper for the DeepL translation API (v1). For more information,
|
28
42
|
check this: https://www.deepl.com/docs/api-reference.html'
|
29
43
|
email: info@danielherzog.es
|
@@ -51,20 +65,26 @@ files:
|
|
51
65
|
- lib/deepl/exceptions/quota_exceeded.rb
|
52
66
|
- lib/deepl/exceptions/request_error.rb
|
53
67
|
- lib/deepl/requests/base.rb
|
68
|
+
- lib/deepl/requests/languages.rb
|
54
69
|
- lib/deepl/requests/translate.rb
|
55
70
|
- lib/deepl/requests/usage.rb
|
56
71
|
- lib/deepl/resources/base.rb
|
72
|
+
- lib/deepl/resources/language.rb
|
57
73
|
- lib/deepl/resources/text.rb
|
58
74
|
- lib/deepl/resources/usage.rb
|
59
75
|
- spec/api/api_spec.rb
|
60
76
|
- spec/api/configuration_spec.rb
|
61
77
|
- spec/api/deepl_spec.rb
|
78
|
+
- spec/fixtures/vcr_cassettes/deepl_languages.yml
|
62
79
|
- spec/fixtures/vcr_cassettes/deepl_translate.yml
|
63
80
|
- spec/fixtures/vcr_cassettes/deepl_usage.yml
|
81
|
+
- spec/fixtures/vcr_cassettes/languages.yml
|
64
82
|
- spec/fixtures/vcr_cassettes/translate_texts.yml
|
65
83
|
- spec/fixtures/vcr_cassettes/usage.yml
|
84
|
+
- spec/requests/languages_spec.rb
|
66
85
|
- spec/requests/translate_spec.rb
|
67
86
|
- spec/requests/usage_spec.rb
|
87
|
+
- spec/resources/language_spec.rb
|
68
88
|
- spec/resources/text_spec.rb
|
69
89
|
- spec/resources/usage_spec.rb
|
70
90
|
- spec/spec_helper.rb
|