languagetool 1.1.0 → 1.3.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: e3951d16607042eb58de48a2b362eb3cc186d232
4
- data.tar.gz: 189f84c48190b4ccd6e0dd284ac60bf55c2e707e
2
+ SHA256:
3
+ metadata.gz: 28c6bdf101d13f1e0a9a9f381d61ee941623117e24d25822fb702b0dc237136f
4
+ data.tar.gz: ab809abfa4f382e994875fc486dc5464189258fb9291bc24ab88ff5f2afe80c0
5
5
  SHA512:
6
- metadata.gz: 443bbd46730308455cd9a74d276271d474dc7c126aacf17540c92ee7c04b4ecf86692758deef15f9d4ab56291ae6837d2628affb8a47b700a0146ee0ba22de35
7
- data.tar.gz: 254603472017be375c71da99938228888f00131d7bb85d6eb26d798cfd87176808304b9162129ea3aad7ed34b4b609817c8226dc45e2627c02bc168cc6973c49
6
+ metadata.gz: fc3f222075ca4395d323fd11c20b90524bdfd67befd4969f0390332f7bdd5ca12ba48b608daea587475827a8e0fef78e0b65378ade10d7b9ce3d76d184a2e169
7
+ data.tar.gz: 28f88273d8c5ed4444ed0945ff3bc328c61061bb8fc0cacb924cf8f8874c1331e80c8a3ce1bafb92891b83b1ea89616b9abbf3e45af6590ee860e485d00d5da4
data/Gemfile CHANGED
@@ -1,13 +1,13 @@
1
1
  source 'https://rubygems.org'
2
2
 
3
- ruby '2.2.4'
3
+ ruby '>= 3.0.0'
4
4
 
5
5
  gem 'rest-client'
6
6
 
7
7
  group :development do
8
8
  gem 'rdoc', '~> 3.12'
9
- gem 'bundler', '~> 1.0'
10
- gem 'jeweler', '~> 2.0.1'
9
+ gem 'bundler', '~> 2'
10
+ gem 'juwelier', '~> 2'
11
11
  end
12
12
 
13
13
  group :test do
data/Gemfile.lock CHANGED
@@ -1,105 +1,160 @@
1
1
  GEM
2
2
  remote: https://rubygems.org/
3
3
  specs:
4
- activesupport (5.0.1)
4
+ activesupport (7.1.3.4)
5
+ base64
6
+ bigdecimal
5
7
  concurrent-ruby (~> 1.0, >= 1.0.2)
6
- i18n (~> 0.7)
7
- minitest (~> 5.1)
8
- tzinfo (~> 1.1)
9
- addressable (2.4.0)
10
- builder (3.2.3)
11
- concurrent-ruby (1.0.4)
12
- crack (0.4.3)
13
- safe_yaml (~> 1.0.0)
8
+ connection_pool (>= 2.2.5)
9
+ drb
10
+ i18n (>= 1.6, < 2)
11
+ minitest (>= 5.1)
12
+ mutex_m
13
+ tzinfo (~> 2.0)
14
+ addressable (2.8.6)
15
+ public_suffix (>= 2.0.2, < 6.0)
16
+ base64 (0.2.0)
17
+ bigdecimal (3.1.8)
18
+ builder (3.3.0)
19
+ concurrent-ruby (1.3.3)
20
+ connection_pool (2.4.1)
21
+ crack (1.0.0)
22
+ bigdecimal
23
+ rexml
14
24
  descendants_tracker (0.0.4)
15
25
  thread_safe (~> 0.3, >= 0.3.1)
16
- docile (1.1.5)
17
- domain_name (0.5.20161129)
18
- unf (>= 0.0.5, < 1.0.0)
19
- faraday (0.9.2)
20
- multipart-post (>= 1.2, < 3)
21
- git (1.3.0)
22
- github_api (0.14.5)
23
- addressable (~> 2.4.0)
26
+ docile (1.4.0)
27
+ domain_name (0.6.20240107)
28
+ drb (2.2.1)
29
+ faraday (1.10.3)
30
+ faraday-em_http (~> 1.0)
31
+ faraday-em_synchrony (~> 1.0)
32
+ faraday-excon (~> 1.1)
33
+ faraday-httpclient (~> 1.0)
34
+ faraday-multipart (~> 1.0)
35
+ faraday-net_http (~> 1.0)
36
+ faraday-net_http_persistent (~> 1.0)
37
+ faraday-patron (~> 1.0)
38
+ faraday-rack (~> 1.0)
39
+ faraday-retry (~> 1.0)
40
+ ruby2_keywords (>= 0.0.4)
41
+ faraday-em_http (1.0.0)
42
+ faraday-em_synchrony (1.0.0)
43
+ faraday-excon (1.1.0)
44
+ faraday-httpclient (1.0.1)
45
+ faraday-multipart (1.0.4)
46
+ multipart-post (~> 2)
47
+ faraday-net_http (1.0.1)
48
+ faraday-net_http_persistent (1.2.0)
49
+ faraday-patron (1.0.0)
50
+ faraday-rack (1.0.0)
51
+ faraday-retry (1.0.3)
52
+ git (2.1.1)
53
+ activesupport (>= 5.0)
54
+ addressable (~> 2.8)
55
+ process_executer (~> 1.1)
56
+ rchardet (~> 1.8)
57
+ github_api (0.19.0)
58
+ addressable (~> 2.4)
24
59
  descendants_tracker (~> 0.0.4)
25
- faraday (~> 0.8, < 0.10)
26
- hashie (>= 3.4)
60
+ faraday (>= 0.8, < 2)
61
+ hashie (~> 3.5, >= 3.5.2)
27
62
  oauth2 (~> 1.0)
28
- hashdiff (0.3.2)
29
- hashie (3.5.3)
30
- highline (1.7.8)
31
- http-cookie (1.0.3)
63
+ hashdiff (1.1.0)
64
+ hashie (3.6.0)
65
+ highline (3.0.1)
66
+ http-accept (1.7.0)
67
+ http-cookie (1.0.6)
32
68
  domain_name (~> 0.5)
33
- i18n (0.8.0)
34
- jeweler (2.0.1)
69
+ i18n (1.14.5)
70
+ concurrent-ruby (~> 1.0)
71
+ json (1.8.6)
72
+ juwelier (2.4.9)
35
73
  builder
36
- bundler (>= 1.0)
37
- git (>= 1.2.5)
74
+ bundler
75
+ git
38
76
  github_api
39
- highline (>= 1.6.15)
40
- nokogiri (>= 1.5.10)
77
+ highline
78
+ kamelcase (~> 0)
79
+ nokogiri
80
+ psych
41
81
  rake
42
82
  rdoc
43
- json (1.8.6)
44
- jwt (1.5.6)
45
- mime-types (3.1)
83
+ semver2
84
+ jwt (2.8.1)
85
+ base64
86
+ kamelcase (0.0.2)
87
+ semver2 (~> 3)
88
+ mime-types (3.5.2)
46
89
  mime-types-data (~> 3.2015)
47
- mime-types-data (3.2016.0521)
48
- mini_portile2 (2.1.0)
49
- minitest (5.10.1)
50
- multi_json (1.12.1)
90
+ mime-types-data (3.2024.0604)
91
+ mini_portile2 (2.8.7)
92
+ minitest (5.23.1)
93
+ multi_json (1.15.0)
51
94
  multi_xml (0.6.0)
52
- multipart-post (2.0.0)
95
+ multipart-post (2.4.1)
96
+ mutex_m (0.2.0)
53
97
  netrc (0.11.0)
54
- nokogiri (1.7.0.1)
55
- mini_portile2 (~> 2.1.0)
56
- oauth2 (1.3.0)
57
- faraday (>= 0.8, < 0.11)
58
- jwt (~> 1.0)
98
+ nokogiri (1.16.6)
99
+ mini_portile2 (~> 2.8.2)
100
+ racc (~> 1.4)
101
+ oauth2 (1.4.11)
102
+ faraday (>= 0.17.3, < 3.0)
103
+ jwt (>= 1.0, < 3.0)
59
104
  multi_json (~> 1.3)
60
105
  multi_xml (~> 0.5)
61
- rack (>= 1.2, < 3)
62
- power_assert (1.0.1)
63
- rack (2.0.1)
64
- rake (12.0.0)
106
+ rack (>= 1.2, < 4)
107
+ power_assert (2.0.3)
108
+ process_executer (1.1.0)
109
+ psych (5.1.2)
110
+ stringio
111
+ public_suffix (5.1.0)
112
+ racc (1.8.0)
113
+ rack (3.1.3)
114
+ rake (13.2.1)
115
+ rchardet (1.8.0)
65
116
  rdoc (3.12.2)
66
117
  json (~> 1.4)
67
- rest-client (2.0.1)
118
+ rest-client (2.1.0)
119
+ http-accept (>= 1.7.0, < 2.0)
68
120
  http-cookie (>= 1.0.2, < 2.0)
69
121
  mime-types (>= 1.16, < 4.0)
70
122
  netrc (~> 0.8)
71
- safe_yaml (1.0.4)
72
- shoulda (3.5.0)
73
- shoulda-context (~> 1.0, >= 1.0.1)
74
- shoulda-matchers (>= 1.4.1, < 3.0)
75
- shoulda-context (1.2.2)
76
- shoulda-matchers (2.8.0)
77
- activesupport (>= 3.0.0)
78
- simplecov (0.13.0)
79
- docile (~> 1.1.0)
80
- json (>= 1.8, < 3)
81
- simplecov-html (~> 0.10.0)
82
- simplecov-html (0.10.0)
83
- test-unit (3.2.3)
123
+ rexml (3.3.0)
124
+ strscan
125
+ ruby2_keywords (0.0.5)
126
+ semver2 (3.4.2)
127
+ shoulda (4.0.0)
128
+ shoulda-context (~> 2.0)
129
+ shoulda-matchers (~> 4.0)
130
+ shoulda-context (2.0.0)
131
+ shoulda-matchers (4.5.1)
132
+ activesupport (>= 4.2.0)
133
+ simplecov (0.22.0)
134
+ docile (~> 1.1)
135
+ simplecov-html (~> 0.11)
136
+ simplecov_json_formatter (~> 0.1)
137
+ simplecov-html (0.12.3)
138
+ simplecov_json_formatter (0.1.4)
139
+ stringio (3.1.1)
140
+ strscan (3.1.0)
141
+ test-unit (3.6.2)
84
142
  power_assert
85
- thread_safe (0.3.5)
86
- tzinfo (1.2.2)
87
- thread_safe (~> 0.1)
88
- unf (0.1.4)
89
- unf_ext
90
- unf_ext (0.0.7.2)
91
- vcr (3.0.3)
92
- webmock (2.3.2)
93
- addressable (>= 2.3.6)
143
+ thread_safe (0.3.6)
144
+ tzinfo (2.0.6)
145
+ concurrent-ruby (~> 1.0)
146
+ vcr (6.2.0)
147
+ webmock (3.23.1)
148
+ addressable (>= 2.8.0)
94
149
  crack (>= 0.3.2)
95
- hashdiff
150
+ hashdiff (>= 0.4.0, < 2.0.0)
96
151
 
97
152
  PLATFORMS
98
153
  ruby
99
154
 
100
155
  DEPENDENCIES
101
- bundler (~> 1.0)
102
- jeweler (~> 2.0.1)
156
+ bundler (~> 2)
157
+ juwelier (~> 2)
103
158
  rdoc (~> 3.12)
104
159
  rest-client
105
160
  shoulda
@@ -109,7 +164,7 @@ DEPENDENCIES
109
164
  webmock
110
165
 
111
166
  RUBY VERSION
112
- ruby 2.2.4p230
167
+ ruby 3.3.3p89
113
168
 
114
169
  BUNDLED WITH
115
- 1.12.5
170
+ 2.5.9
data/README.md CHANGED
@@ -1,14 +1,12 @@
1
- [![Gem Version](https://badge.fury.io/rb/languagetool.svg)](https://badge.fury.io/rb/languagetool) [![Dependency Status](https://gemnasium.com/badges/github.com/wikiti/languagetool-ruby.svg)](https://gemnasium.com/github.com/wikiti/languagetool-ruby) [![CircleCI](https://circleci.com/gh/wikiti/languagetool-ruby.svg?&style=shield&circle-token=30f27cf5467c3b815e1ea6102e551fd4be05ca83)](https://circleci.com/gh/wikiti/languagetool-ruby)
1
+ [![Gem Version](https://badge.fury.io/rb/languagetool.svg)](https://badge.fury.io/rb/languagetool) [![CircleCI](https://circleci.com/gh/wikiti/languagetool-ruby.svg?&style=shield&circle-token=30f27cf5467c3b815e1ea6102e551fd4be05ca83)](https://circleci.com/gh/wikiti/languagetool-ruby)
2
2
 
3
3
  # languagetool
4
4
 
5
- <img src="https://gitlab.com/uploads/project/avatar/1507736/languagetool-ruby.png" width="200">
6
-
7
5
  A simple ruby wrapper for the LanguageTool HTTP API. This gem is only compatible with LanguageTool 3.4 and above.
8
6
 
9
7
  Please visit the this [link](https://languagetool.org/http-api/swagger-ui/#/default) for more information about the public LanguageTool HTTP API, and its allowed parameters.
10
8
 
11
- This project uses [`jeweler`](https://github.com/technicalpickles/jeweler) for managing and releasing this gem.
9
+ This project uses [`juwelier`](https://github.com/technicalpickles/juwelier) for managing and releasing this gem.
12
10
 
13
11
  ## Installation
14
12
 
@@ -41,6 +39,18 @@ api = LanguageTool::API.new # Public LanguageTool API by default
41
39
 
42
40
  Please bear in mind that Ruby uses underscore names (`long_code`), while the LanguageTool API uses camelcase names (`longCode`).
43
41
 
42
+ The gem also works with the [premium API](https://languagetool.org/http-api/) too, just set the username and the API key when initializing the API:
43
+
44
+ ```ruby
45
+ LanguageTool::API.new(
46
+ base_uri: 'https://api.languagetoolplus.com/v2',
47
+ common_query_params: {
48
+ username: '...',
49
+ api_key: '...'
50
+ }
51
+ )
52
+ ```
53
+
44
54
  ### Available languages
45
55
 
46
56
  You can retrieve the available languages with `languages` method:
@@ -91,7 +101,7 @@ Then, use your custom local or remote url in your ruby code:
91
101
 
92
102
  ```ruby
93
103
  require 'languagetool'
94
- api = LanguageTool::API.new base_uri: 'http://localhost:8081/v2/'
104
+ api = LanguageTool::API.new base_uri: 'http://localhost:8081/v2'
95
105
  ```
96
106
 
97
107
  ## Custom options
data/Rakefile CHANGED
@@ -11,8 +11,8 @@ rescue Bundler::BundlerError => e
11
11
  end
12
12
  require 'rake'
13
13
 
14
- require 'jeweler'
15
- Jeweler::Tasks.new do |gem|
14
+ require 'juwelier'
15
+ Juwelier::Tasks.new do |gem|
16
16
  # gem is a Gem::Specification... see http://guides.rubygems.org/specification-reference/ for more options
17
17
  gem.name = "languagetool"
18
18
  gem.homepage = "https://github.com/wikiti/languagetool-ruby"
@@ -22,7 +22,7 @@ Jeweler::Tasks.new do |gem|
22
22
  gem.email = 'info@danielherzog.es'
23
23
  gem.authors = ['Daniel Herzog']
24
24
  end
25
- Jeweler::RubygemsDotOrgTasks.new
25
+ Juwelier::RubygemsDotOrgTasks.new
26
26
 
27
27
  require 'rake/testtask'
28
28
  Rake::TestTask.new(:test) do |test|
data/VERSION CHANGED
@@ -1 +1 @@
1
- 1.1.0
1
+ 1.3.0
data/languagetool.gemspec CHANGED
@@ -1,19 +1,19 @@
1
- # Generated by jeweler
1
+ # Generated by juwelier
2
2
  # DO NOT EDIT THIS FILE DIRECTLY
3
- # Instead, edit Jeweler::Tasks in Rakefile, and run 'rake gemspec'
3
+ # Instead, edit Juwelier::Tasks in Rakefile, and run 'rake gemspec'
4
4
  # -*- encoding: utf-8 -*-
5
- # stub: languagetool 1.1.0 ruby lib
5
+ # stub: languagetool 1.3.0 ruby lib
6
6
 
7
7
  Gem::Specification.new do |s|
8
- s.name = "languagetool"
9
- s.version = "1.1.0"
8
+ s.name = "languagetool".freeze
9
+ s.version = "1.3.0"
10
10
 
11
- s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
12
- s.require_paths = ["lib"]
13
- s.authors = ["Daniel Herzog"]
14
- s.date = "2017-02-20"
15
- s.description = "Gem wrapper for the LanguageTool API (public or private). It allows to correct texts."
16
- s.email = "info@danielherzog.es"
11
+ s.required_rubygems_version = Gem::Requirement.new(">= 0".freeze) if s.respond_to? :required_rubygems_version=
12
+ s.require_paths = ["lib".freeze]
13
+ s.authors = ["Daniel Herzog".freeze]
14
+ s.date = "2024-06-15"
15
+ s.description = "Gem wrapper for the LanguageTool API (public or private). It allows to correct texts.".freeze
16
+ s.email = "info@danielherzog.es".freeze
17
17
  s.extra_rdoc_files = [
18
18
  "LICENSE.txt",
19
19
  "README.md"
@@ -47,30 +47,25 @@ Gem::Specification.new do |s|
47
47
  "test/test_check.rb",
48
48
  "test/test_languages.rb"
49
49
  ]
50
- s.homepage = "https://github.com/wikiti/languagetool-ruby"
51
- s.licenses = ["MIT"]
52
- s.rubygems_version = "2.4.5.1"
53
- s.summary = "Gem wrapper for the LanguageTool API (public or private)"
50
+ s.homepage = "https://github.com/wikiti/languagetool-ruby".freeze
51
+ s.licenses = ["MIT".freeze]
52
+ s.rubygems_version = "3.3.7".freeze
53
+ s.summary = "Gem wrapper for the LanguageTool API (public or private)".freeze
54
54
 
55
55
  if s.respond_to? :specification_version then
56
56
  s.specification_version = 4
57
+ end
57
58
 
58
- if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
59
- s.add_runtime_dependency(%q<rest-client>, [">= 0"])
60
- s.add_development_dependency(%q<rdoc>, ["~> 3.12"])
61
- s.add_development_dependency(%q<bundler>, ["~> 1.0"])
62
- s.add_development_dependency(%q<jeweler>, ["~> 2.0.1"])
63
- else
64
- s.add_dependency(%q<rest-client>, [">= 0"])
65
- s.add_dependency(%q<rdoc>, ["~> 3.12"])
66
- s.add_dependency(%q<bundler>, ["~> 1.0"])
67
- s.add_dependency(%q<jeweler>, ["~> 2.0.1"])
68
- end
59
+ if s.respond_to? :add_runtime_dependency then
60
+ s.add_runtime_dependency(%q<rest-client>.freeze, [">= 0"])
61
+ s.add_development_dependency(%q<rdoc>.freeze, ["~> 3.12"])
62
+ s.add_development_dependency(%q<bundler>.freeze, ["~> 2"])
63
+ s.add_development_dependency(%q<juwelier>.freeze, ["~> 2"])
69
64
  else
70
- s.add_dependency(%q<rest-client>, [">= 0"])
71
- s.add_dependency(%q<rdoc>, ["~> 3.12"])
72
- s.add_dependency(%q<bundler>, ["~> 1.0"])
73
- s.add_dependency(%q<jeweler>, ["~> 2.0.1"])
65
+ s.add_dependency(%q<rest-client>.freeze, [">= 0"])
66
+ s.add_dependency(%q<rdoc>.freeze, ["~> 3.12"])
67
+ s.add_dependency(%q<bundler>.freeze, ["~> 2"])
68
+ s.add_dependency(%q<juwelier>.freeze, ["~> 2"])
74
69
  end
75
70
  end
76
71
 
@@ -24,15 +24,12 @@ module LanguageTool
24
24
  "#{api.base_uri}/#{path}"
25
25
  end
26
26
 
27
- def default_query
28
- {}
29
- end
30
-
31
27
  def underscore_to_camelcase(str)
32
28
  str.to_s.gsub(/_(.)/) { |match| "#{match[1].upcase}" }
33
29
  end
34
30
 
35
31
  def normalize_query(q)
32
+ q = api.common_query_params.merge(q)
36
33
  Hash[q.map { |k, v| [underscore_to_camelcase(k), v] }].select { |k, v| v }
37
34
  end
38
35
  end
@@ -3,7 +3,8 @@ module LanguageTool
3
3
  attr_reader :options
4
4
 
5
5
  DEFAULT_OPTIONS = {
6
- base_uri: 'https://languagetool.org/api/v2'
6
+ base_uri: 'https://languagetool.org/api/v2',
7
+ common_query_params: {}
7
8
  }.freeze
8
9
 
9
10
  def initialize(options = {})
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: languagetool
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.0
4
+ version: 1.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: 2017-02-20 00:00:00.000000000 Z
11
+ date: 2024-06-15 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rest-client
@@ -44,28 +44,28 @@ dependencies:
44
44
  requirements:
45
45
  - - "~>"
46
46
  - !ruby/object:Gem::Version
47
- version: '1.0'
47
+ version: '2'
48
48
  type: :development
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
52
  - - "~>"
53
53
  - !ruby/object:Gem::Version
54
- version: '1.0'
54
+ version: '2'
55
55
  - !ruby/object:Gem::Dependency
56
- name: jeweler
56
+ name: juwelier
57
57
  requirement: !ruby/object:Gem::Requirement
58
58
  requirements:
59
59
  - - "~>"
60
60
  - !ruby/object:Gem::Version
61
- version: 2.0.1
61
+ version: '2'
62
62
  type: :development
63
63
  prerelease: false
64
64
  version_requirements: !ruby/object:Gem::Requirement
65
65
  requirements:
66
66
  - - "~>"
67
67
  - !ruby/object:Gem::Version
68
- version: 2.0.1
68
+ version: '2'
69
69
  description: Gem wrapper for the LanguageTool API (public or private). It allows to
70
70
  correct texts.
71
71
  email: info@danielherzog.es
@@ -121,8 +121,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
121
121
  - !ruby/object:Gem::Version
122
122
  version: '0'
123
123
  requirements: []
124
- rubyforge_project:
125
- rubygems_version: 2.4.5.1
124
+ rubygems_version: 3.3.7
126
125
  signing_key:
127
126
  specification_version: 4
128
127
  summary: Gem wrapper for the LanguageTool API (public or private)