Skip to content

Commit 2af41b1

Browse files
committed
🚨 rubocop-gradual first linting + lockfile
1 parent efb01b4 commit 2af41b1

File tree

128 files changed

+7685
-5960
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

128 files changed

+7685
-5960
lines changed

‎.rubocop_gradual.lock

+2,222
Large diffs are not rendered by default.

‎Gemfile

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,5 @@ source 'https://rubygems.org'
33
# Specify your gem's dependencies in ruby-openid.gemspec
44
gemspec
55

6-
gem 'rake'
76
gem 'byebug'
7+
gem 'rake'

‎Rakefile

100644100755
+12-3
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,21 @@ require 'bundler/gem_tasks'
33

44
require 'rake/testtask'
55

6-
desc "Run tests"
6+
desc 'Run tests'
77
Rake::TestTask.new('test') do |t|
88
t.libs << 'lib'
99
t.libs << 'test'
10-
t.test_files = FileList["test/**/test_*.rb"]
10+
t.test_files = FileList['test/**/test_*.rb']
1111
t.verbose = false
1212
end
1313

14-
task :default => :test
14+
begin
15+
require 'rubocop/lts'
16+
Rubocop::Lts.install_tasks
17+
rescue LoadError
18+
task(:rubocop_gradual) do
19+
warn('RuboCop (Gradual) is disabled')
20+
end
21+
end
22+
23+
task default: %i[test rubocop_gradual]

‎admin/mkassoc

100644100755
+3-3
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
#!/usr/bin/env ruby
22

3-
require "openid/consumer/associationmanager"
4-
require "openid/store/memory"
3+
require 'openid/consumer/associationmanager'
4+
require 'openid/store/memory'
55

66
store = OpenID::Store::Memory.new
77
ARGV.each do |server_url|
8-
unless URI::regexp =~ server_url
8+
unless URI::DEFAULT_PARSER.make_regexp =~ server_url
99
puts "`#{server_url}` will be skipped for invalid URI format."
1010
next
1111
end

‎bin/bundle

+21-17
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
# this file is here to facilitate running it.
99
#
1010

11-
require "rubygems"
11+
require 'rubygems'
1212

1313
m = Module.new do
1414
module_function
@@ -18,45 +18,47 @@ m = Module.new do
1818
end
1919

2020
def env_var_version
21-
ENV["BUNDLER_VERSION"]
21+
ENV['BUNDLER_VERSION']
2222
end
2323

2424
def cli_arg_version
2525
return unless invoked_as_script? # don't want to hijack other binstubs
26-
return unless "update".start_with?(ARGV.first || " ") # must be running `bundle update`
26+
return unless 'update'.start_with?(ARGV.first || ' ') # must be running `bundle update`
27+
2728
bundler_version = nil
2829
update_index = nil
2930
ARGV.each_with_index do |a, i|
30-
if update_index && update_index.succ == i && a =~ Gem::Version::ANCHORED_VERSION_PATTERN
31-
bundler_version = a
32-
end
31+
bundler_version = a if update_index && update_index.succ == i && a =~ Gem::Version::ANCHORED_VERSION_PATTERN
3332
next unless a =~ /\A--bundler(?:[= ](#{Gem::Version::VERSION_PATTERN}))?\z/
34-
bundler_version = $1
33+
34+
bundler_version = Regexp.last_match(1)
3535
update_index = i
3636
end
3737
bundler_version
3838
end
3939

4040
def gemfile
41-
gemfile = ENV["BUNDLE_GEMFILE"]
41+
gemfile = ENV['BUNDLE_GEMFILE']
4242
return gemfile if gemfile && !gemfile.empty?
4343

44-
File.expand_path("../Gemfile", __dir__)
44+
File.expand_path('../Gemfile', __dir__)
4545
end
4646

4747
def lockfile
4848
lockfile =
4949
case File.basename(gemfile)
50-
when "gems.rb" then gemfile.sub(/\.rb$/, ".locked")
50+
when 'gems.rb' then gemfile.sub(/\.rb$/, '.locked')
5151
else "#{gemfile}.lock"
5252
end
5353
File.expand_path(lockfile)
5454
end
5555

5656
def lockfile_version
5757
return unless File.file?(lockfile)
58+
5859
lockfile_contents = File.read(lockfile)
5960
return unless lockfile_contents =~ /\n\nBUNDLED WITH\n\s{2,}(#{Gem::Version::VERSION_PATTERN})\n/
61+
6062
Regexp.last_match(1)
6163
end
6264

@@ -76,20 +78,24 @@ m = Module.new do
7678
end
7779

7880
def load_bundler!
79-
ENV["BUNDLE_GEMFILE"] ||= gemfile
81+
ENV['BUNDLE_GEMFILE'] ||= gemfile
8082

8183
activate_bundler
8284
end
8385

8486
def activate_bundler
8587
gem_error = activation_error_handling do
86-
gem "bundler", bundler_requirement
88+
gem 'bundler', bundler_requirement
8789
end
8890
return if gem_error.nil?
91+
8992
require_error = activation_error_handling do
90-
require "bundler/version"
93+
require 'bundler/version'
94+
end
95+
if require_error.nil? && Gem::Requirement.new(bundler_requirement).satisfied_by?(Gem::Version.new(Bundler::VERSION))
96+
return
9197
end
92-
return if require_error.nil? && Gem::Requirement.new(bundler_requirement).satisfied_by?(Gem::Version.new(Bundler::VERSION))
98+
9399
warn "Activating bundler (#{bundler_requirement}) failed:\n#{gem_error.message}\n\nTo install the version of bundler this project requires, run `gem install bundler -v '#{bundler_requirement}'`"
94100
exit 42
95101
end
@@ -104,6 +110,4 @@ end
104110

105111
m.load_bundler!
106112

107-
if m.invoked_as_script?
108-
load Gem.bin_path("bundler", "bundle")
109-
end
113+
load Gem.bin_path('bundler', 'bundle') if m.invoked_as_script?

‎bin/byebug

+6-6
Original file line numberDiff line numberDiff line change
@@ -8,20 +8,20 @@
88
# this file is here to facilitate running it.
99
#
1010

11-
ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../Gemfile", __dir__)
11+
ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../Gemfile', __dir__)
1212

13-
bundle_binstub = File.expand_path("bundle", __dir__)
13+
bundle_binstub = File.expand_path('bundle', __dir__)
1414

1515
if File.file?(bundle_binstub)
16-
if File.read(bundle_binstub, 300).include?("This file was generated by Bundler")
16+
if File.read(bundle_binstub, 300).include?('This file was generated by Bundler')
1717
load(bundle_binstub)
1818
else
1919
abort("Your `bin/bundle` was not generated by Bundler, so this binstub cannot run.
2020
Replace `bin/bundle` by running `bundle binstubs bundler --force`, then run this command again.")
2121
end
2222
end
2323

24-
require "rubygems"
25-
require "bundler/setup"
24+
require 'rubygems'
25+
require 'bundler/setup'
2626

27-
load Gem.bin_path("byebug", "byebug")
27+
load Gem.bin_path('byebug', 'byebug')

‎bin/console

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
#!/usr/bin/env ruby
22
# frozen_string_literal: true
33

4-
require "bundler/setup"
5-
require "ruby-openid"
4+
require 'bundler/setup'
5+
require 'ruby-openid'
66

77
# You can add fixtures and/or initialization code here to make experimenting
88
# with your gem easier. You can also use a different console, if you like.
99

10-
require "irb"
10+
require 'irb'
1111
IRB.start(__FILE__)

‎bin/htmldiff

+6-6
Original file line numberDiff line numberDiff line change
@@ -8,20 +8,20 @@
88
# this file is here to facilitate running it.
99
#
1010

11-
ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../Gemfile", __dir__)
11+
ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../Gemfile', __dir__)
1212

13-
bundle_binstub = File.expand_path("bundle", __dir__)
13+
bundle_binstub = File.expand_path('bundle', __dir__)
1414

1515
if File.file?(bundle_binstub)
16-
if File.read(bundle_binstub, 300).include?("This file was generated by Bundler")
16+
if File.read(bundle_binstub, 300).include?('This file was generated by Bundler')
1717
load(bundle_binstub)
1818
else
1919
abort("Your `bin/bundle` was not generated by Bundler, so this binstub cannot run.
2020
Replace `bin/bundle` by running `bundle binstubs bundler --force`, then run this command again.")
2121
end
2222
end
2323

24-
require "rubygems"
25-
require "bundler/setup"
24+
require 'rubygems'
25+
require 'bundler/setup'
2626

27-
load Gem.bin_path("diff-lcs", "htmldiff")
27+
load Gem.bin_path('diff-lcs', 'htmldiff')

‎bin/ldiff

+6-6
Original file line numberDiff line numberDiff line change
@@ -8,20 +8,20 @@
88
# this file is here to facilitate running it.
99
#
1010

11-
ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../Gemfile", __dir__)
11+
ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../Gemfile', __dir__)
1212

13-
bundle_binstub = File.expand_path("bundle", __dir__)
13+
bundle_binstub = File.expand_path('bundle', __dir__)
1414

1515
if File.file?(bundle_binstub)
16-
if File.read(bundle_binstub, 300).include?("This file was generated by Bundler")
16+
if File.read(bundle_binstub, 300).include?('This file was generated by Bundler')
1717
load(bundle_binstub)
1818
else
1919
abort("Your `bin/bundle` was not generated by Bundler, so this binstub cannot run.
2020
Replace `bin/bundle` by running `bundle binstubs bundler --force`, then run this command again.")
2121
end
2222
end
2323

24-
require "rubygems"
25-
require "bundler/setup"
24+
require 'rubygems'
25+
require 'bundler/setup'
2626

27-
load Gem.bin_path("diff-lcs", "ldiff")
27+
load Gem.bin_path('diff-lcs', 'ldiff')

‎bin/racc

+6-6
Original file line numberDiff line numberDiff line change
@@ -8,20 +8,20 @@
88
# this file is here to facilitate running it.
99
#
1010

11-
ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../Gemfile", __dir__)
11+
ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../Gemfile', __dir__)
1212

13-
bundle_binstub = File.expand_path("bundle", __dir__)
13+
bundle_binstub = File.expand_path('bundle', __dir__)
1414

1515
if File.file?(bundle_binstub)
16-
if File.read(bundle_binstub, 300).include?("This file was generated by Bundler")
16+
if File.read(bundle_binstub, 300).include?('This file was generated by Bundler')
1717
load(bundle_binstub)
1818
else
1919
abort("Your `bin/bundle` was not generated by Bundler, so this binstub cannot run.
2020
Replace `bin/bundle` by running `bundle binstubs bundler --force`, then run this command again.")
2121
end
2222
end
2323

24-
require "rubygems"
25-
require "bundler/setup"
24+
require 'rubygems'
25+
require 'bundler/setup'
2626

27-
load Gem.bin_path("racc", "racc")
27+
load Gem.bin_path('racc', 'racc')

‎bin/rake

+6-6
Original file line numberDiff line numberDiff line change
@@ -8,20 +8,20 @@
88
# this file is here to facilitate running it.
99
#
1010

11-
ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../Gemfile", __dir__)
11+
ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../Gemfile', __dir__)
1212

13-
bundle_binstub = File.expand_path("bundle", __dir__)
13+
bundle_binstub = File.expand_path('bundle', __dir__)
1414

1515
if File.file?(bundle_binstub)
16-
if File.read(bundle_binstub, 300).include?("This file was generated by Bundler")
16+
if File.read(bundle_binstub, 300).include?('This file was generated by Bundler')
1717
load(bundle_binstub)
1818
else
1919
abort("Your `bin/bundle` was not generated by Bundler, so this binstub cannot run.
2020
Replace `bin/bundle` by running `bundle binstubs bundler --force`, then run this command again.")
2121
end
2222
end
2323

24-
require "rubygems"
25-
require "bundler/setup"
24+
require 'rubygems'
25+
require 'bundler/setup'
2626

27-
load Gem.bin_path("rake", "rake")
27+
load Gem.bin_path('rake', 'rake')

‎bin/rubocop

+6-6
Original file line numberDiff line numberDiff line change
@@ -8,20 +8,20 @@
88
# this file is here to facilitate running it.
99
#
1010

11-
ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../Gemfile", __dir__)
11+
ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../Gemfile', __dir__)
1212

13-
bundle_binstub = File.expand_path("bundle", __dir__)
13+
bundle_binstub = File.expand_path('bundle', __dir__)
1414

1515
if File.file?(bundle_binstub)
16-
if File.read(bundle_binstub, 300).include?("This file was generated by Bundler")
16+
if File.read(bundle_binstub, 300).include?('This file was generated by Bundler')
1717
load(bundle_binstub)
1818
else
1919
abort("Your `bin/bundle` was not generated by Bundler, so this binstub cannot run.
2020
Replace `bin/bundle` by running `bundle binstubs bundler --force`, then run this command again.")
2121
end
2222
end
2323

24-
require "rubygems"
25-
require "bundler/setup"
24+
require 'rubygems'
25+
require 'bundler/setup'
2626

27-
load Gem.bin_path("rubocop", "rubocop")
27+
load Gem.bin_path('rubocop', 'rubocop')

‎bin/rubocop-gradual

+6-6
Original file line numberDiff line numberDiff line change
@@ -8,20 +8,20 @@
88
# this file is here to facilitate running it.
99
#
1010

11-
ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../Gemfile", __dir__)
11+
ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../Gemfile', __dir__)
1212

13-
bundle_binstub = File.expand_path("bundle", __dir__)
13+
bundle_binstub = File.expand_path('bundle', __dir__)
1414

1515
if File.file?(bundle_binstub)
16-
if File.read(bundle_binstub, 300).include?("This file was generated by Bundler")
16+
if File.read(bundle_binstub, 300).include?('This file was generated by Bundler')
1717
load(bundle_binstub)
1818
else
1919
abort("Your `bin/bundle` was not generated by Bundler, so this binstub cannot run.
2020
Replace `bin/bundle` by running `bundle binstubs bundler --force`, then run this command again.")
2121
end
2222
end
2323

24-
require "rubygems"
25-
require "bundler/setup"
24+
require 'rubygems'
25+
require 'bundler/setup'
2626

27-
load Gem.bin_path("rubocop-gradual", "rubocop-gradual")
27+
load Gem.bin_path('rubocop-gradual', 'rubocop-gradual')

‎bin/ruby-parse

+6-6
Original file line numberDiff line numberDiff line change
@@ -8,20 +8,20 @@
88
# this file is here to facilitate running it.
99
#
1010

11-
ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../Gemfile", __dir__)
11+
ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../Gemfile', __dir__)
1212

13-
bundle_binstub = File.expand_path("bundle", __dir__)
13+
bundle_binstub = File.expand_path('bundle', __dir__)
1414

1515
if File.file?(bundle_binstub)
16-
if File.read(bundle_binstub, 300).include?("This file was generated by Bundler")
16+
if File.read(bundle_binstub, 300).include?('This file was generated by Bundler')
1717
load(bundle_binstub)
1818
else
1919
abort("Your `bin/bundle` was not generated by Bundler, so this binstub cannot run.
2020
Replace `bin/bundle` by running `bundle binstubs bundler --force`, then run this command again.")
2121
end
2222
end
2323

24-
require "rubygems"
25-
require "bundler/setup"
24+
require 'rubygems'
25+
require 'bundler/setup'
2626

27-
load Gem.bin_path("parser", "ruby-parse")
27+
load Gem.bin_path('parser', 'ruby-parse')

0 commit comments

Comments
 (0)