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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: 45fd2b316644d0fb624c9bcaadea7524c08933d1
4
- data.tar.gz: d79aa178b64a3a302e6fd4e82196fdca1a8bb85a
2
+ SHA256:
3
+ metadata.gz: 83485dc84bdce1dd11492bc0eb141825202b624e903cc747cc7bcc2f0afbc74e
4
+ data.tar.gz: 2f39d5af1a2926e123fa2fb1e3a3cae247546234f6382a0fc185f3e0fb5d7599
5
5
  SHA512:
6
- metadata.gz: 6d28b5d519aa43971e13af3675b67a58825f30674f75af82491dd2f2e7f59727fd95d5860ba4d9638fe88ff286a316420695d75dba65601e4e1f29ab78e79e0f
7
- data.tar.gz: b33fd1cf048c8ace82ea10d5a15007a2e97b57ec677760da1ba22207655aa190867f81e8c658550963f1d6b0efb03b20d0053b5dd3c95d4f3ea8d6629d1e2d6f
6
+ metadata.gz: 44bb0eb91abfea54a199830b26abdf52b275badcf3cad7ca0a905cd2bfef7360cd3ced29690047438f263c46dfa71e2ce9c34abab09b30f4af25565aac7309d4
7
+ data.tar.gz: df542383415d3c0eecb848d29e01c0c1e8ef2b8d7e272ce224383251ea1ca876edb4f6cc65f8c78f9978621f918cb75e946737a9bffc2a40fc8e87506bc5e5f3
@@ -3,26 +3,14 @@ jobs:
3
3
  build:
4
4
  working_directory: ~/deepl-rb
5
5
  docker:
6
- - image: circleci/ruby:2.1
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: |
@@ -2,6 +2,7 @@
2
2
 
3
3
  AllCops:
4
4
  DisplayCopNames: true
5
+ NewCops: enable
5
6
  Exclude:
6
7
  - deepl-rb.gemspec
7
8
  - vendor/**/*
data/Gemfile CHANGED
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  source 'https://rubygems.org'
2
4
 
3
5
  group :development do
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
- | ![](http://www.gravatar.com/avatar/2ae6d81e0605177ba9e17b19f54e6b6c.jpg?s=64) | Daniel Herzog | Wikiti | [info@danielherzog.es](mailto:info@danielherzog.es)
data/Rakefile CHANGED
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'rubygems'
2
4
  require 'bundler'
3
5
 
data/VERSION CHANGED
@@ -1 +1 @@
1
- 2.2.2
1
+ 2.2.3
@@ -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.2 ruby lib
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.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-06-18"
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 = "2.6.14".freeze
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
- if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
68
- s.add_development_dependency(%q<juwelier>.freeze, [">= 0"])
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
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  # -- Dependencies
2
4
  require 'json'
3
5
  require 'net/http'
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module DeepL
2
4
  class API
3
5
  attr_reader :configuration
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module DeepL
2
4
  class Configuration
3
5
  ATTRIBUTES = %i[auth_key host version].freeze
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module DeepL
2
4
  module Exceptions
3
5
  class AuthorizationFailed < RequestError
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module DeepL
2
4
  module Exceptions
3
5
  class BadRequest < RequestError
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module DeepL
2
4
  module Exceptions
3
5
  class Error < StandardError
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module DeepL
2
4
  module Exceptions
3
5
  class LimitExceeded < RequestError
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module DeepL
2
4
  module Exceptions
3
5
  class QuotaExceeded < RequestError
@@ -1,9 +1,12 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module DeepL
2
4
  module Exceptions
3
5
  class RequestError < Error
4
6
  attr_reader :request, :response
5
7
 
6
8
  def initialize(request, response)
9
+ super()
7
10
  @request = request
8
11
  @response = response
9
12
  end
@@ -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.reject { |_, v| v.nil? })
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
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module DeepL
2
4
  module Requests
3
5
  class Usage < Base
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module DeepL
2
4
  module Resources
3
5
  class Base
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module DeepL
2
4
  module Resources
3
5
  class Text < Base
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module DeepL
2
4
  module Resources
3
5
  class Usage < Base
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'spec_helper'
2
4
 
3
5
  describe DeepL::API do
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'spec_helper'
2
4
 
3
5
  describe DeepL::Configuration do
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'spec_helper'
2
4
 
3
5
  describe DeepL do
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'spec_helper'
2
4
 
3
5
  describe DeepL::Requests::Translate do
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'spec_helper'
2
4
 
3
5
  describe DeepL::Requests::Usage do
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'spec_helper'
2
4
 
3
5
  describe DeepL::Resources::Text do
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'spec_helper'
2
4
 
3
5
  describe DeepL::Resources::Usage do
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  # Coverage
2
4
  require 'simplecov'
3
5
  SimpleCov.start
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.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-06-18 00:00:00.000000000 Z
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
- rubyforge_project:
92
- rubygems_version: 2.6.14
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: []
@@ -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