translator-text 0.3.0 → 0.3.2
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 +9 -0
- data/Gemfile +1 -1
- data/Gemfile.lock +73 -64
- data/lib/translator_text/client.rb +12 -15
- data/lib/translator_text/types/translation_result.rb +1 -1
- data/lib/translator_text/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 54c058e4acf692c426853d07ee76ad66247935f317255c23d92bcb071b037a2e
|
4
|
+
data.tar.gz: 91a337fa2068cc29c7d547a544b2060f327787748a3711d186f9deba142cd7a2
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 87723ed79f936925c4c802e4a9e7d95f60386ec641fd625f7f0d1846a77623c9494646362aa7db575aa66155ce9582f8b733b720c51277d2cfff9a741e1e58c7
|
7
|
+
data.tar.gz: 975b6e4ee1a8a7c005ff791cb44d7959aaa8db4defa7a6aceaa550ef28aae1b72643a1dde255b55f9039c8ae92a495941482032a467700ffa28747bc6ef8b64a
|
data/CHANGELOG.md
CHANGED
@@ -4,6 +4,15 @@ All notable changes to this project will be documented in this file.
|
|
4
4
|
The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
|
5
5
|
and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).
|
6
6
|
|
7
|
+
## [0.3.2] - 2025-05-12
|
8
|
+
### Fixes
|
9
|
+
- Bump some gems
|
10
|
+
- Remove warning
|
11
|
+
|
12
|
+
## [0.3.1] - 2024-03-05
|
13
|
+
### Fixes
|
14
|
+
- Better support of errors
|
15
|
+
|
7
16
|
## [0.3.0] - 2023-11-15
|
8
17
|
### Changed
|
9
18
|
- Add support of the COGNITIVE_SUBSCRIPTION_REGION
|
data/Gemfile
CHANGED
data/Gemfile.lock
CHANGED
@@ -1,115 +1,124 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
translator-text (0.3.
|
4
|
+
translator-text (0.3.2)
|
5
5
|
dry-struct (~> 1)
|
6
6
|
httparty (~> 0.21)
|
7
7
|
|
8
8
|
GEM
|
9
9
|
remote: https://rubygems.org/
|
10
10
|
specs:
|
11
|
-
addressable (2.8.
|
12
|
-
public_suffix (>= 2.0.2, <
|
13
|
-
ast (2.4.
|
14
|
-
|
15
|
-
|
11
|
+
addressable (2.8.7)
|
12
|
+
public_suffix (>= 2.0.2, < 7.0)
|
13
|
+
ast (2.4.3)
|
14
|
+
bigdecimal (3.1.9)
|
15
|
+
concurrent-ruby (1.3.5)
|
16
|
+
crack (1.0.0)
|
17
|
+
bigdecimal
|
16
18
|
rexml
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
19
|
+
csv (3.3.4)
|
20
|
+
diff-lcs (1.6.2)
|
21
|
+
docile (1.4.1)
|
22
|
+
dotenv (3.1.8)
|
23
|
+
dry-core (1.1.0)
|
21
24
|
concurrent-ruby (~> 1.0)
|
25
|
+
logger
|
22
26
|
zeitwerk (~> 2.6)
|
23
|
-
dry-inflector (1.
|
24
|
-
dry-logic (1.
|
27
|
+
dry-inflector (1.2.0)
|
28
|
+
dry-logic (1.6.0)
|
29
|
+
bigdecimal
|
25
30
|
concurrent-ruby (~> 1.0)
|
26
|
-
dry-core (~> 1.
|
31
|
+
dry-core (~> 1.1)
|
27
32
|
zeitwerk (~> 2.6)
|
28
|
-
dry-struct (1.
|
29
|
-
dry-core (~> 1.
|
30
|
-
dry-types (
|
33
|
+
dry-struct (1.8.0)
|
34
|
+
dry-core (~> 1.1)
|
35
|
+
dry-types (~> 1.8, >= 1.8.2)
|
31
36
|
ice_nine (~> 0.11)
|
32
37
|
zeitwerk (~> 2.6)
|
33
|
-
dry-types (1.
|
38
|
+
dry-types (1.8.2)
|
39
|
+
bigdecimal (~> 3.0)
|
34
40
|
concurrent-ruby (~> 1.0)
|
35
41
|
dry-core (~> 1.0)
|
36
42
|
dry-inflector (~> 1.0)
|
37
43
|
dry-logic (~> 1.4)
|
38
44
|
zeitwerk (~> 2.6)
|
39
|
-
hashdiff (1.
|
40
|
-
httparty (0.
|
45
|
+
hashdiff (1.1.2)
|
46
|
+
httparty (0.23.1)
|
47
|
+
csv
|
41
48
|
mini_mime (>= 1.0.0)
|
42
49
|
multi_xml (>= 0.5.2)
|
43
50
|
ice_nine (0.11.2)
|
44
|
-
json (2.
|
45
|
-
language_server-protocol (3.17.0.
|
51
|
+
json (2.12.0)
|
52
|
+
language_server-protocol (3.17.0.5)
|
53
|
+
lint_roller (1.1.0)
|
54
|
+
logger (1.7.0)
|
46
55
|
mini_mime (1.1.5)
|
47
|
-
multi_xml (0.
|
48
|
-
|
49
|
-
|
56
|
+
multi_xml (0.7.1)
|
57
|
+
bigdecimal (~> 3.1)
|
58
|
+
parallel (1.27.0)
|
59
|
+
parser (3.3.8.0)
|
50
60
|
ast (~> 2.4.1)
|
51
61
|
racc
|
52
|
-
|
53
|
-
|
62
|
+
prism (1.4.0)
|
63
|
+
public_suffix (6.0.2)
|
64
|
+
racc (1.8.1)
|
54
65
|
rainbow (3.1.1)
|
55
|
-
rake (
|
56
|
-
regexp_parser (2.
|
57
|
-
rexml (3.
|
58
|
-
rspec (3.
|
59
|
-
rspec-core (~> 3.
|
60
|
-
rspec-expectations (~> 3.
|
61
|
-
rspec-mocks (~> 3.
|
62
|
-
rspec-core (3.
|
63
|
-
rspec-support (~> 3.
|
64
|
-
rspec-expectations (3.
|
66
|
+
rake (13.2.1)
|
67
|
+
regexp_parser (2.10.0)
|
68
|
+
rexml (3.4.1)
|
69
|
+
rspec (3.13.0)
|
70
|
+
rspec-core (~> 3.13.0)
|
71
|
+
rspec-expectations (~> 3.13.0)
|
72
|
+
rspec-mocks (~> 3.13.0)
|
73
|
+
rspec-core (3.13.3)
|
74
|
+
rspec-support (~> 3.13.0)
|
75
|
+
rspec-expectations (3.13.4)
|
65
76
|
diff-lcs (>= 1.2.0, < 2.0)
|
66
|
-
rspec-support (~> 3.
|
67
|
-
rspec-mocks (3.
|
77
|
+
rspec-support (~> 3.13.0)
|
78
|
+
rspec-mocks (3.13.4)
|
68
79
|
diff-lcs (>= 1.2.0, < 2.0)
|
69
|
-
rspec-support (~> 3.
|
70
|
-
rspec-support (3.
|
71
|
-
rubocop (1.
|
80
|
+
rspec-support (~> 3.13.0)
|
81
|
+
rspec-support (3.13.3)
|
82
|
+
rubocop (1.75.5)
|
72
83
|
json (~> 2.3)
|
73
|
-
language_server-protocol (
|
84
|
+
language_server-protocol (~> 3.17.0.2)
|
85
|
+
lint_roller (~> 1.1.0)
|
74
86
|
parallel (~> 1.10)
|
75
|
-
parser (>= 3.
|
87
|
+
parser (>= 3.3.0.2)
|
76
88
|
rainbow (>= 2.2.2, < 4.0)
|
77
|
-
regexp_parser (>=
|
78
|
-
|
79
|
-
rubocop-ast (>= 1.28.1, < 2.0)
|
89
|
+
regexp_parser (>= 2.9.3, < 3.0)
|
90
|
+
rubocop-ast (>= 1.44.0, < 2.0)
|
80
91
|
ruby-progressbar (~> 1.7)
|
81
|
-
unicode-display_width (>= 2.4.0, <
|
82
|
-
rubocop-ast (1.
|
83
|
-
parser (>= 3.
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
rubocop (~> 1.
|
88
|
-
rubocop-rspec (2.25.0)
|
89
|
-
rubocop (~> 1.40)
|
90
|
-
rubocop-capybara (~> 2.17)
|
91
|
-
rubocop-factory_bot (~> 2.22)
|
92
|
+
unicode-display_width (>= 2.4.0, < 4.0)
|
93
|
+
rubocop-ast (1.44.1)
|
94
|
+
parser (>= 3.3.7.2)
|
95
|
+
prism (~> 1.4)
|
96
|
+
rubocop-rspec (3.6.0)
|
97
|
+
lint_roller (~> 1.1)
|
98
|
+
rubocop (~> 1.72, >= 1.72.1)
|
92
99
|
ruby-progressbar (1.13.0)
|
93
100
|
simplecov (0.22.0)
|
94
101
|
docile (~> 1.1)
|
95
102
|
simplecov-html (~> 0.11)
|
96
103
|
simplecov_json_formatter (~> 0.1)
|
97
|
-
simplecov-html (0.
|
104
|
+
simplecov-html (0.13.1)
|
98
105
|
simplecov_json_formatter (0.1.4)
|
99
|
-
unicode-display_width (
|
100
|
-
|
106
|
+
unicode-display_width (3.1.4)
|
107
|
+
unicode-emoji (~> 4.0, >= 4.0.4)
|
108
|
+
unicode-emoji (4.0.4)
|
109
|
+
webmock (3.25.1)
|
101
110
|
addressable (>= 2.8.0)
|
102
111
|
crack (>= 0.3.2)
|
103
112
|
hashdiff (>= 0.4.0, < 2.0.0)
|
104
|
-
yard (0.9.
|
105
|
-
zeitwerk (2.6.
|
113
|
+
yard (0.9.37)
|
114
|
+
zeitwerk (2.6.18)
|
106
115
|
|
107
116
|
PLATFORMS
|
108
117
|
ruby
|
109
118
|
|
110
119
|
DEPENDENCIES
|
111
120
|
dotenv
|
112
|
-
rake (~>
|
121
|
+
rake (~> 13)
|
113
122
|
rspec (~> 3)
|
114
123
|
rubocop
|
115
124
|
rubocop-rspec
|
@@ -119,4 +128,4 @@ DEPENDENCIES
|
|
119
128
|
yard
|
120
129
|
|
121
130
|
BUNDLED WITH
|
122
|
-
2.3.
|
131
|
+
2.3.27
|
@@ -93,22 +93,19 @@ module TranslatorText
|
|
93
93
|
# If success, return the response body
|
94
94
|
# If failure, raise an error
|
95
95
|
def handle_response(response)
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
message: response['error']['message']
|
104
|
-
)
|
105
|
-
else
|
106
|
-
raise NetError.new(
|
107
|
-
code: response.code,
|
108
|
-
message: response.response.message
|
109
|
-
)
|
110
|
-
end
|
96
|
+
return response if response.code.between?(200, 299)
|
97
|
+
|
98
|
+
if response.request.format == :json && response['error']
|
99
|
+
raise ServiceError.new(
|
100
|
+
code: response['error']['code'],
|
101
|
+
message: response['error']['message']
|
102
|
+
)
|
111
103
|
end
|
104
|
+
|
105
|
+
raise NetError.new(
|
106
|
+
code: response.code,
|
107
|
+
message: response.response.message
|
108
|
+
)
|
112
109
|
end
|
113
110
|
|
114
111
|
def headers
|
@@ -8,7 +8,7 @@ module TranslatorText
|
|
8
8
|
transform_keys(&:to_sym)
|
9
9
|
|
10
10
|
attribute :translations, Types::Array.of(Translation)
|
11
|
-
attribute :detectedLanguage, Types::Hash.default({})
|
11
|
+
attribute :detectedLanguage, Types::Hash.default({}.freeze)
|
12
12
|
|
13
13
|
# Returns the detected language
|
14
14
|
#
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: translator-text
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.3.
|
4
|
+
version: 0.3.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Aymeric Brisse
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2025-05-12 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: dry-struct
|
@@ -90,7 +90,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
90
90
|
- !ruby/object:Gem::Version
|
91
91
|
version: '0'
|
92
92
|
requirements: []
|
93
|
-
rubygems_version: 3.3.
|
93
|
+
rubygems_version: 3.3.27
|
94
94
|
signing_key:
|
95
95
|
specification_version: 4
|
96
96
|
summary: API Wrapper for the Microsoft Translator Text API
|