Skip to content

Commit 7db8788

Browse files
committed
rubocop and gem lib upgrades.
1 parent e694396 commit 7db8788

File tree

9 files changed

+9
-99
lines changed

9 files changed

+9
-99
lines changed

.rubocop.yml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1 @@
11
inherit_from: .rubocop_todo.yml
2-
3-
AllCops:
4-
TargetRubyVersion: 2.6

.rubocop_todo.yml

Lines changed: 0 additions & 88 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,6 @@ Style/IfUnlessModifier:
5656
- 'lib/name_deduplication_parameters.rb'
5757
- 'lib/name_similarity_parameters.rb'
5858

59-
6059
# Offense count: 8
6160
# Competes with RDoc directives.
6261
# https://docs.ruby-lang.org/en/2.1.0/RDoc/Markup.html
@@ -72,93 +71,6 @@ Style/CommentedKeyword:
7271
- 'lib/name_translation_parameters.rb'
7372
- 'lib/rosette_api_error.rb'
7473

75-
76-
77-
# Offense count: 1
78-
# Cop supports --auto-correct.
79-
# Configuration parameters: TreatCommentsAsGroupSeparators, Include.
80-
# Include: **/*.gemfile, **/Gemfile, **/gems.rb
81-
Bundler/OrderedGems:
82-
Exclude:
83-
- 'Gemfile'
84-
85-
# Offense count: 1
86-
# Configuration parameters: Include.
87-
# Include: **/*.gemspec,
88-
Gemspec/RequiredRubyVersion:
89-
Exclude:
90-
- 'rosette_api.gemspec'
91-
92-
# Offense count: 3
93-
# Cop supports --auto-correct.
94-
Layout/EmptyLineAfterGuardClause:
95-
Exclude:
96-
- 'lib/name_deduplication_parameters.rb'
97-
- 'lib/name_similarity_parameters.rb'
98-
- 'lib/request_builder.rb'
99-
100-
# Offense count: 3
101-
# Cop supports --auto-correct.
102-
Layout/EmptyLineAfterMagicComment:
103-
Exclude:
104-
- 'examples/entities.rb'
105-
- 'lib/request_builder.rb'
106-
- 'tests/tests_spec.rb'
107-
108-
# Offense count: 3
109-
# Cop supports --auto-correct.
110-
Layout/EmptyLines:
111-
Exclude:
112-
- 'lib/rosette_api.rb'
113-
- 'rosette_api.gemspec'
114-
115-
# Offense count: 2
116-
# Cop supports --auto-correct.
117-
# Configuration parameters: EnforcedStyle.
118-
# SupportedStyles: empty_lines, no_empty_lines
119-
Layout/EmptyLinesAroundBlockBody:
120-
Exclude:
121-
- 'tests/tests_spec.rb'
122-
123-
# Offense count: 18
124-
# Cop supports --auto-correct.
125-
# Configuration parameters: Width, IgnoredPatterns.
126-
Layout/IndentationWidth:
127-
Exclude:
128-
- 'examples/entities.rb'
129-
- 'examples/info.rb'
130-
- 'examples/language.rb'
131-
- 'examples/morphology_complete.rb'
132-
- 'examples/morphology_compound-components.rb'
133-
- 'examples/morphology_han-readings.rb'
134-
- 'examples/morphology_lemmas.rb'
135-
- 'examples/morphology_parts-of-speech.rb'
136-
137-
# Offense count: 1
138-
# Cop supports --auto-correct.
139-
# Configuration parameters: EnforcedStyle, IndentationWidth.
140-
# SupportedStyles: aligned, indented, indented_relative_to_receiver
141-
Layout/MultilineMethodCallIndentation:
142-
Exclude:
143-
- 'tests/tests_spec.rb'
144-
145-
# Offense count: 2
146-
# Cop supports --auto-correct.
147-
# Configuration parameters: AllowForAlignment.
148-
Layout/SpaceAroundOperators:
149-
Exclude:
150-
- 'examples/language.rb'
151-
- 'rosette_api.gemspec'
152-
153-
# Offense count: 2
154-
# Cop supports --auto-correct.
155-
# Configuration parameters: EnforcedStyle, EnforcedStyleForEmptyBrackets.
156-
# SupportedStyles: space, no_space, compact
157-
# SupportedStylesForEmptyBrackets: space, no_space
158-
Layout/SpaceInsideArrayLiteralBrackets:
159-
Exclude:
160-
- 'tests/tests_spec.rb'
161-
16274
# Offense count: 12
16375
# Cop supports --auto-correct.
16476
# Configuration parameters: .

Gemfile

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22

33
source 'https://rubygems.org'
44

5+
gem 'rdoc', '6.2.0'
56
gem 'rubysl-securerandom', '2.0.0'
6-
gem 'rdoc', '4.2.2'
77

8-
gem 'rspec', '3.4.0', group: [:test]
9-
gem 'webmock', '1.24.5', group: [:test]
8+
gem 'rspec', '3.9.0', group: [:test]
9+
gem 'webmock', '3.7.6', group: [:test]

examples/language.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
language_data = 'Por favor Señorita, says the man.'
1414
begin
1515
params = DocumentParameters.new(content: language_data)
16-
params.custom_headers = { 'X-RosetteAPI-App'=> 'ruby-app' }
16+
params.custom_headers = { 'X-RosetteAPI-App' => 'ruby-app' }
1717
response = rosette_api.get_language(params)
1818
puts JSON.pretty_generate(response)
1919
rescue RosetteAPIError => e

lib/name_deduplication_parameters.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ def initialize(names, threshold, options = {}) #:notnew:
2727
def validate_params
2828
param_msg = 'names must be an array of name_parameter'
2929
raise BadRequestError.new(param_msg) unless @names.instance_of? Array
30+
3031
float_msg = 'threshold must be a float'
3132
thresh_msg = 'threshold must be in the range of 0 to 1'
3233
if @threshold

lib/name_similarity_parameters.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,10 @@ def initialize(name1, name2, options = {}) #:notnew:
3131
def validate_params
3232
n1_msg = 'name1 option can only be an instance of a String or NameParameter'
3333
raise BadRequestError.new(n1_msg) if [String, NameParameter].none? { |clazz| @name1.is_a? clazz }
34+
3435
n2_msg = 'name2 option can only be an instance of a String or NameParameter'
3536
raise BadRequestError.new(n2_msg) if [String, NameParameter].none? { |clazz| @name2.is_a? clazz }
37+
3638
opt_msg = 'rosette_options can only be an instance of a Hash'
3739
if @rosette_options
3840
raise BadRequestError.new(opt_msg) unless @rosette_options.is_a? Hash

lib/request_builder.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ def initialize(user_key, alternate_url, http_client, binding_version,
3131
@user_agent = 'Ruby/' + binding_version + '/' + RUBY_VERSION
3232

3333
return unless url_parameters
34+
3435
@alternate_url = @alternate_url + '?' + URI.encode_www_form(url_parameters)
3536
end
3637

lib/rosette_api.rb

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,6 @@ class RosetteAPI
5252
# Topics endpoint
5353
TOPICS_ENDPOINT = '/topics'
5454

55-
5655
# Rosette API key
5756
attr_accessor :user_key
5857
# Alternate Rosette API URL

tests/tests_spec.rb

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,6 @@
5858
expect { RosetteAPI.new('0123456789').get_language(params) }
5959
.to raise_error(BadRequestFormatError)
6060
end
61-
6261
end
6362

6463
describe '.get_morphology_complete' do
@@ -399,7 +398,7 @@
399398

400399
describe '.name_deduplication' do
401400
names = ['John Smith', 'Johnathon Smith', 'Fred Jones']
402-
.map { |n| NameParameter.new(n) }
401+
.map { |n| NameParameter.new(n) }
403402
before do
404403
names_json = { names: names.map(&:load_param), threshold: 0.75 }.to_json
405404

@@ -760,5 +759,4 @@
760759
expect(response).instance_of? Hash
761760
end
762761
end
763-
764762
end

0 commit comments

Comments
 (0)