Skip to content

Commit

Permalink
Fixed rubocop warnings + Fixed rubocop version
Browse files Browse the repository at this point in the history
  • Loading branch information
pierresouchay committed Sep 6, 2018
1 parent d6b2975 commit 9ad9522
Show file tree
Hide file tree
Showing 7 changed files with 13 additions and 7 deletions.
6 changes: 6 additions & 0 deletions .rubocop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,9 @@ Metrics/LineLength:
# Allow classes longer than 100 lines of code
ClassLength:
Max: 250

Naming/UncommunicativeMethodParamName:
Enabled: false

Lint/UnneededCopDisableDirective:
Enabled: false
2 changes: 1 addition & 1 deletion diplomat.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ Gem::Specification.new 'diplomat', Diplomat::VERSION do |spec|
spec.add_development_dependency 'pry', '~> 0.9'
spec.add_development_dependency 'rake', '~> 12.0'
spec.add_development_dependency 'rspec', '~> 3.2'
spec.add_development_dependency 'rubocop', '~> 0.47', '>= 0.47.1'
spec.add_development_dependency 'rubocop', '~> 0.49'

spec.add_runtime_dependency 'faraday', '~> 0.9'
spec.add_runtime_dependency 'json' if RUBY_VERSION < '1.9.3'
Expand Down
4 changes: 2 additions & 2 deletions lib/diplomat.rb
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ def require_libs(*libs)

raise 'Diplomat only supports ruby >= 2.0.0' unless RUBY_VERSION.to_f >= 2.0

self.root_path = File.expand_path '..', __FILE__
self.lib_path = File.expand_path '../diplomat', __FILE__
self.root_path = File.expand_path __dir__
self.lib_path = File.expand_path 'diplomat', __dir__

require_libs 'configuration', 'rest_client', 'api_options', 'kv', 'datacenter',
'service', 'members', 'node', 'nodes', 'check', 'health', 'session', 'lock',
Expand Down
2 changes: 1 addition & 1 deletion lib/diplomat/kv.rb
Original file line number Diff line number Diff line change
Expand Up @@ -256,7 +256,7 @@ def decode_transaction(transaction) # rubocop:disable Metrics/MethodLength
next unless resp['KV']['Value']
begin
resp['KV']['Value'] = Base64.decode64(resp['KV']['Value'])
rescue # rubocop:disable RescueWithoutErrorClass
rescue StandardError
nil
end
end
Expand Down
2 changes: 1 addition & 1 deletion lib/diplomat/rest_client.rb
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ def decode_values
@raw.each_with_object([]) do |acc, el|
begin
acc['Value'] = Base64.decode64(acc['Value'])
rescue # rubocop:disable RescueWithoutErrorClass
rescue StandardError
nil
end
el << acc
Expand Down
1 change: 0 additions & 1 deletion lib/diplomat/service.rb
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,5 @@ def maintenance(service_id, options = { enable: true })
end
maintenance.status == 200
end
# rubocop:enable AbcSize
end
end
3 changes: 2 additions & 1 deletion spec/agent_spec.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
require 'spec_helper'
require 'json'
require 'base64'

# rubocop:disable
describe Diplomat::Agent do
let(:faraday) { fake }

Expand Down Expand Up @@ -150,3 +150,4 @@
end
end
end
# rubocop:enable

0 comments on commit 9ad9522

Please sign in to comment.