Fix RuboCop offenses

This commit is contained in:
Erik Michaels-Ober 2014-12-28 08:55:42 -06:00
parent 07c7f80079
commit 987239fefe
3 changed files with 5 additions and 2 deletions

View file

@ -1,3 +1,6 @@
Metrics/AbcSize:
Max: 16
Metrics/BlockNesting:
Max: 1

View file

@ -9,7 +9,7 @@ group :test do
gem 'mime-types', '~> 1.25', :platforms => [:jruby, :ruby_18]
gem 'rest-client', '~> 1.6.0', :platforms => [:jruby, :ruby_18]
gem 'rspec', '>= 2.14'
gem 'rubocop', '>= 0.25', :platforms => [:ruby_19, :ruby_20, :ruby_21]
gem 'rubocop', '>= 0.28', :platforms => [:ruby_19, :ruby_20, :ruby_21]
gem 'simplecov', '>= 0.9'
gem 'yardstick'
end

View file

@ -87,7 +87,7 @@ module SimpleOAuth
matching_keys, extra_keys = options.keys.partition { |key| ATTRIBUTE_KEYS.include?(key) }
extra_keys -= IGNORED_KEYS
if options[:ignore_extra_keys] || extra_keys.empty?
Hash[options.select { |key, _value| matching_keys.include?(key) }.collect { |key, value| [:"oauth_#{key}", value] }]
Hash[options.select { |key, _| matching_keys.include?(key) }.collect { |key, value| [:"oauth_#{key}", value] }]
else
fail "SimpleOAuth: Found extra option keys not matching ATTRIBUTE_KEYS:\n [#{extra_keys.collect(&:inspect).join(', ')}]"
end