Fix Rubocop; Min Ruby version 2.2; Update Travis platforms
This commit is contained in:
parent
8179ba796a
commit
ace4ba366a
|
@ -1,6 +1,12 @@
|
||||||
|
AllCops:
|
||||||
|
TargetRubyVersion: 2.2
|
||||||
|
|
||||||
Layout/AccessModifierIndentation:
|
Layout/AccessModifierIndentation:
|
||||||
EnforcedStyle: outdent
|
EnforcedStyle: outdent
|
||||||
|
|
||||||
|
Layout/AlignHash:
|
||||||
|
Enabled: false
|
||||||
|
|
||||||
Layout/DotPosition:
|
Layout/DotPosition:
|
||||||
EnforcedStyle: trailing
|
EnforcedStyle: trailing
|
||||||
|
|
||||||
|
@ -50,6 +56,9 @@ Style/EachWithObject:
|
||||||
Style/Encoding:
|
Style/Encoding:
|
||||||
Enabled: false
|
Enabled: false
|
||||||
|
|
||||||
|
Style/ExpandPathArguments:
|
||||||
|
Enabled: false
|
||||||
|
|
||||||
Style/HashSyntax:
|
Style/HashSyntax:
|
||||||
EnforcedStyle: hash_rockets
|
EnforcedStyle: hash_rockets
|
||||||
|
|
||||||
|
|
|
@ -9,11 +9,10 @@ env:
|
||||||
language: ruby
|
language: ruby
|
||||||
rvm:
|
rvm:
|
||||||
- jruby-9000
|
- jruby-9000
|
||||||
- 2.1.10 # EOL Soon
|
- 2.2.9
|
||||||
- 2.2.6
|
- 2.3.5
|
||||||
- 2.3.3
|
- 2.4.4
|
||||||
- 2.4.0
|
- 2.5.3
|
||||||
- 2.5.0
|
|
||||||
- jruby-head
|
- jruby-head
|
||||||
- ruby-head
|
- ruby-head
|
||||||
matrix:
|
matrix:
|
||||||
|
|
2
Gemfile
2
Gemfile
|
@ -20,7 +20,7 @@ group :test do
|
||||||
gem 'rack-test'
|
gem 'rack-test'
|
||||||
gem 'rest-client', '~> 2.0.0', :platforms => [:jruby_18]
|
gem 'rest-client', '~> 2.0.0', :platforms => [:jruby_18]
|
||||||
gem 'rspec', '~> 3.5.0'
|
gem 'rspec', '~> 3.5.0'
|
||||||
gem 'rubocop', '>= 0.47', :platforms => %i[ruby_20 ruby_21 ruby_22 ruby_23 ruby_24]
|
gem 'rubocop', '>= 0.58.2', :platforms => %i[ruby_20 ruby_21 ruby_22 ruby_23 ruby_24]
|
||||||
gem 'tins', '~> 1.13.0', :platforms => %i[jruby_18 jruby_19 ruby_19]
|
gem 'tins', '~> 1.13.0', :platforms => %i[jruby_18 jruby_19 ruby_19]
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
1
Rakefile
1
Rakefile
|
@ -30,6 +30,7 @@ namespace :perf do
|
||||||
def call_app(path = ENV['GET_PATH'] || '/')
|
def call_app(path = ENV['GET_PATH'] || '/')
|
||||||
result = @app.get(path)
|
result = @app.get(path)
|
||||||
raise "Did not succeed #{result.body}" unless result.status == 200
|
raise "Did not succeed #{result.body}" unless result.status == 200
|
||||||
|
|
||||||
result
|
result
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -20,9 +20,7 @@ module OmniAuth
|
||||||
end
|
end
|
||||||
|
|
||||||
def regular_writer(key, value)
|
def regular_writer(key, value)
|
||||||
if key.to_s == 'info' && value.is_a?(::Hash) && !value.is_a?(InfoHash)
|
value = InfoHash.new(value) if key.to_s == 'info' && value.is_a?(::Hash) && !value.is_a?(InfoHash)
|
||||||
value = InfoHash.new(value)
|
|
||||||
end
|
|
||||||
super
|
super
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -36,6 +34,7 @@ module OmniAuth
|
||||||
return "#{first_name} #{last_name}".strip if first_name? || last_name?
|
return "#{first_name} #{last_name}".strip if first_name? || last_name?
|
||||||
return nickname if nickname?
|
return nickname if nickname?
|
||||||
return email if email?
|
return email if email?
|
||||||
|
|
||||||
nil
|
nil
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
@ -41,6 +41,7 @@ module OmniAuth
|
||||||
|
|
||||||
def options(options = false)
|
def options(options = false)
|
||||||
return @options || {} if options == false
|
return @options || {} if options == false
|
||||||
|
|
||||||
@options = options
|
@options = options
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
@ -33,11 +33,13 @@ module OmniAuth
|
||||||
|
|
||||||
def strategy_name_query_param
|
def strategy_name_query_param
|
||||||
return '' unless env['omniauth.error.strategy']
|
return '' unless env['omniauth.error.strategy']
|
||||||
|
|
||||||
"&strategy=#{env['omniauth.error.strategy'].name}"
|
"&strategy=#{env['omniauth.error.strategy'].name}"
|
||||||
end
|
end
|
||||||
|
|
||||||
def origin_query_param
|
def origin_query_param
|
||||||
return '' unless env['omniauth.origin']
|
return '' unless env['omniauth.origin']
|
||||||
|
|
||||||
"&origin=#{Rack::Utils.escape(env['omniauth.origin'])}"
|
"&origin=#{Rack::Utils.escape(env['omniauth.origin'])}"
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -82,6 +82,7 @@ module OmniAuth
|
||||||
|
|
||||||
def footer
|
def footer
|
||||||
return self if @footer
|
return self if @footer
|
||||||
|
|
||||||
@html << "\n<button type='submit'>Connect</button>" unless @with_custom_button
|
@html << "\n<button type='submit'>Connect</button>" unless @with_custom_button
|
||||||
@html << <<-HTML
|
@html << <<-HTML
|
||||||
</form>
|
</form>
|
||||||
|
|
|
@ -140,6 +140,7 @@ module OmniAuth
|
||||||
|
|
||||||
self.class.args.each do |arg|
|
self.class.args.each do |arg|
|
||||||
break if args.empty?
|
break if args.empty?
|
||||||
|
|
||||||
options[arg] = args.shift
|
options[arg] = args.shift
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -187,6 +188,7 @@ module OmniAuth
|
||||||
return request_call if on_request_path? && OmniAuth.config.allowed_request_methods.include?(request.request_method.downcase.to_sym)
|
return request_call if on_request_path? && OmniAuth.config.allowed_request_methods.include?(request.request_method.downcase.to_sym)
|
||||||
return callback_call if on_callback_path?
|
return callback_call if on_callback_path?
|
||||||
return other_phase if respond_to?(:other_phase)
|
return other_phase if respond_to?(:other_phase)
|
||||||
|
|
||||||
@app.call(env)
|
@app.call(env)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -268,6 +270,7 @@ module OmniAuth
|
||||||
def mock_call!(*)
|
def mock_call!(*)
|
||||||
return mock_request_call if on_request_path? && OmniAuth.config.allowed_request_methods.include?(request.request_method.downcase.to_sym)
|
return mock_request_call if on_request_path? && OmniAuth.config.allowed_request_methods.include?(request.request_method.downcase.to_sym)
|
||||||
return mock_callback_call if on_callback_path?
|
return mock_callback_call if on_callback_path?
|
||||||
|
|
||||||
call_app!
|
call_app!
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -361,6 +364,7 @@ module OmniAuth
|
||||||
def skip_info?
|
def skip_info?
|
||||||
return false unless options.skip_info?
|
return false unless options.skip_info?
|
||||||
return true unless options.skip_info.respond_to?(:call)
|
return true unless options.skip_info.respond_to?(:call)
|
||||||
|
|
||||||
options.skip_info.call(uid)
|
options.skip_info.call(uid)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -377,6 +381,7 @@ module OmniAuth
|
||||||
if options[kind].respond_to?(:call)
|
if options[kind].respond_to?(:call)
|
||||||
result = options[kind].call(env)
|
result = options[kind].call(env)
|
||||||
return nil unless result.is_a?(String)
|
return nil unless result.is_a?(String)
|
||||||
|
|
||||||
result
|
result
|
||||||
else
|
else
|
||||||
options[kind]
|
options[kind]
|
||||||
|
@ -401,7 +406,7 @@ module OmniAuth
|
||||||
options[:setup_path] || "#{path_prefix}/#{name}/setup"
|
options[:setup_path] || "#{path_prefix}/#{name}/setup"
|
||||||
end
|
end
|
||||||
|
|
||||||
CURRENT_PATH_REGEX = %r{/$}
|
CURRENT_PATH_REGEX = %r{/$}.freeze
|
||||||
EMPTY_STRING = ''.freeze
|
EMPTY_STRING = ''.freeze
|
||||||
def current_path
|
def current_path
|
||||||
@current_path ||= request.path_info.downcase.sub(CURRENT_PATH_REGEX, EMPTY_STRING)
|
@current_path ||= request.path_info.downcase.sub(CURRENT_PATH_REGEX, EMPTY_STRING)
|
||||||
|
|
|
@ -18,7 +18,7 @@ Gem::Specification.new do |spec|
|
||||||
spec.name = 'omniauth'
|
spec.name = 'omniauth'
|
||||||
spec.require_paths = %w[lib]
|
spec.require_paths = %w[lib]
|
||||||
spec.required_rubygems_version = '>= 1.3.5'
|
spec.required_rubygems_version = '>= 1.3.5'
|
||||||
spec.required_ruby_version = '>= 2.1.9'
|
spec.required_ruby_version = '>= 2.2'
|
||||||
spec.summary = spec.description
|
spec.summary = spec.description
|
||||||
spec.version = OmniAuth::VERSION
|
spec.version = OmniAuth::VERSION
|
||||||
end
|
end
|
||||||
|
|
|
@ -48,6 +48,7 @@ class ExampleStrategy
|
||||||
@fail = fail!(options[:failure]) if options[:failure]
|
@fail = fail!(options[:failure]) if options[:failure]
|
||||||
@last_env = env
|
@last_env = env
|
||||||
return @fail if @fail
|
return @fail if @fail
|
||||||
|
|
||||||
raise('Request Phase')
|
raise('Request Phase')
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -56,6 +57,7 @@ class ExampleStrategy
|
||||||
@fail = fail!(options[:failure]) if options[:failure]
|
@fail = fail!(options[:failure]) if options[:failure]
|
||||||
@last_env = env
|
@last_env = env
|
||||||
return @fail if @fail
|
return @fail if @fail
|
||||||
|
|
||||||
raise('Callback Phase')
|
raise('Callback Phase')
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in New Issue