Skip to content

Commit 43beb17

Browse files
committed
Fix Rubocop Offenses
1 parent cf569e4 commit 43beb17

File tree

7 files changed

+23
-21
lines changed

7 files changed

+23
-21
lines changed

.rubocop.yml

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
Layout/AccessModifierIndentation:
2+
EnforcedStyle: outdent
3+
4+
Layout/SpaceInsideHashLiteralBraces:
5+
EnforcedStyle: no_space
6+
17
Metrics/BlockNesting:
28
Max: 2
39

@@ -13,9 +19,6 @@ Metrics/ParameterLists:
1319
Max: 4
1420
CountKeywordArgs: true
1521

16-
Style/AccessModifierIndentation:
17-
EnforcedStyle: outdent
18-
1922
Style/CollectionMethods:
2023
PreferredMethods:
2124
map: 'collect'
@@ -32,11 +35,10 @@ Style/DoubleNegation:
3235
Style/HashSyntax:
3336
EnforcedStyle: hash_rockets
3437

35-
Style/SpaceInsideHashLiteralBraces:
36-
EnforcedStyle: no_space
38+
3739

3840
Style/StringLiterals:
3941
EnforcedStyle: double_quotes
4042

41-
Style/TrailingComma:
43+
Style/TrailingCommaInLiteral:
4244
EnforcedStyleForMultiline: 'comma'

Gemfile

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,12 @@ gem "rake"
44

55
group :test do
66
gem "coveralls"
7-
gem "json", :platforms => [:jruby, :ruby_18, :ruby_19]
8-
gem "mime-types", "~> 1.25", :platforms => [:jruby, :ruby_18]
7+
gem "json", :platforms => %i[jruby ruby_18 ruby_19]
8+
gem "mime-types", "~> 1.25", :platforms => %i[jruby ruby_18]
99
gem "rack-test"
10-
gem "rest-client", "~> 1.7.3", :platforms => [:jruby, :ruby_18]
10+
gem "rest-client", "~> 1.7.3", :platforms => %i[jruby ruby_18]
1111
gem "rspec", "~> 3.2"
12-
gem "rubocop", ">= 0.30", :platforms => [:ruby_19, :ruby_20, :ruby_21, :ruby_22]
12+
gem "rubocop", ">= 0.30", :platforms => %i[ruby_19 ruby_20 ruby_21 ruby_22]
1313
gem "simplecov", ">= 0.9"
1414
gem "webmock"
1515
end

Rakefile

100644100755
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,4 +15,4 @@ rescue LoadError
1515
end
1616
end
1717

18-
task :default => [:spec, :rubocop]
18+
task :default => %i[spec rubocop]

lib/omniauth-oauth2/version.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
module OmniAuth
22
module OAuth2
3-
VERSION = "1.4.0"
3+
VERSION = "1.4.0".freeze
44
end
55
end

lib/omniauth/strategies/oauth2.rb

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ def self.inherited(subclass)
1818
OmniAuth::Strategy.included(subclass)
1919
end
2020

21-
args [:client_id, :client_secret]
21+
args %i[client_id client_secret]
2222

2323
option :client_id, nil
2424
option :client_secret, nil
@@ -38,9 +38,9 @@ def client
3838

3939
credentials do
4040
hash = {"token" => access_token.token}
41-
hash.merge!("refresh_token" => access_token.refresh_token) if access_token.expires? && access_token.refresh_token
42-
hash.merge!("expires_at" => access_token.expires_at) if access_token.expires?
43-
hash.merge!("expires" => access_token.expires?)
41+
hash["refresh_token"] = access_token.refresh_token if access_token.expires? && access_token.refresh_token
42+
hash["expires_at"] = access_token.expires_at if access_token.expires?
43+
hash["expires"] = access_token.expires?
4444
hash
4545
end
4646

omniauth-oauth2.gemspec

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,12 @@ Gem::Specification.new do |gem|
1313
gem.description = "An abstract OAuth2 strategy for OmniAuth."
1414
gem.summary = gem.description
1515
gem.homepage = "https://github.com/intridea/omniauth-oauth2"
16-
gem.licenses = %w(MIT)
16+
gem.licenses = %w[MIT]
1717

1818
gem.executables = `git ls-files -- bin/*`.split("\n").collect { |f| File.basename(f) }
1919
gem.files = `git ls-files`.split("\n")
2020
gem.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
2121
gem.name = "omniauth-oauth2"
22-
gem.require_paths = %w(lib)
22+
gem.require_paths = %w[lib]
2323
gem.version = OmniAuth::OAuth2::VERSION
2424
end

spec/omniauth/strategies/oauth2_spec.rb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
require "helper"
22

3-
describe OmniAuth::Strategies::OAuth2 do
3+
describe OmniAuth::Strategies::OAuth2 do # rubocop:disable Metrics/BlockLength
44
def app
55
lambda do |_env|
66
[200, {}, ["Hello."]]
@@ -49,7 +49,7 @@ def app
4949
end
5050

5151
it "includes top-level options that are marked as :authorize_options" do
52-
instance = subject.new("abc", "def", :authorize_options => [:scope, :foo, :state], :scope => "bar", :foo => "baz")
52+
instance = subject.new("abc", "def", :authorize_options => %i[scope foo state], :scope => "bar", :foo => "baz")
5353
expect(instance.authorize_params["scope"]).to eq("bar")
5454
expect(instance.authorize_params["foo"]).to eq("baz")
5555
end
@@ -70,7 +70,7 @@ def app
7070
end
7171

7272
it "includes top-level options that are marked as :authorize_options" do
73-
instance = subject.new("abc", "def", :token_options => [:scope, :foo], :scope => "bar", :foo => "baz")
73+
instance = subject.new("abc", "def", :token_options => %i[scope foo], :scope => "bar", :foo => "baz")
7474
expect(instance.token_params).to eq("scope" => "bar", "foo" => "baz")
7575
end
7676
end

0 commit comments

Comments
 (0)