Update and binstub erb_lint (#18889)

This commit is contained in:
Mac Siri 2023-01-04 12:11:41 -05:00 committed by GitHub
parent 0e25b1413e
commit 3a87a2e60f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
11 changed files with 150 additions and 13 deletions

View file

@ -118,7 +118,7 @@ group :development do
gem "bundler-audit", "~> 0.9" # bundler-audit provides patch-level verification for Bundled apps
gem "derailed_benchmarks", "~> 2.1", require: false # A series of things you can use to benchmark a Rails or Ruby app
gem "easy_translate", "~> 0.5.1" # Google translate tie-in to be used with i18n tasks
gem "erb_lint", "~> 0.0.37", require: false # ERB Linter tool
gem "erb_lint", "~> 0.3", require: false # ERB Linter tool
gem "guard", "~> 2.18", require: false # Guard is a command line tool to easily handle events on file system modifications
gem "guard-rspec", "~> 4.7", require: false # Guard::Rspec includes a DSL for running tests on change
gem "i18n-tasks", "~> 1.0.11" # Helpers to find and manage missing and unused translations

View file

@ -107,12 +107,11 @@ GEM
coderay (>= 1.0.0)
erubi (>= 1.0.0)
rack (>= 0.9.0)
better_html (1.0.16)
actionview (>= 4.0)
activesupport (>= 4.0)
better_html (2.0.1)
actionview (>= 6.0)
activesupport (>= 6.0)
ast (~> 2.0)
erubi (~> 1.4)
html_tokenizer (~> 0.0.6)
parser (>= 2.4)
smart_properties
bindex (0.8.1)
@ -234,10 +233,9 @@ GEM
activemodel
emoji_regex (3.2.3)
equalizer (0.0.11)
erb_lint (0.0.37)
erb_lint (0.3.1)
activesupport
better_html (~> 1.0.7)
html_tokenizer
better_html (>= 2.0.1)
parser (>= 2.7.1.4)
rainbow
rubocop
@ -366,7 +364,6 @@ GEM
honeybadger (4.12.2)
honeycomb-beeline (2.11.0)
libhoney (>= 1.14.2)
html_tokenizer (0.0.7)
html_truncator (0.4.2)
nokogiri (~> 1.5)
http-2 (0.11.0)
@ -742,7 +739,7 @@ GEM
activesupport (>= 3.1, < 7.1)
json-schema (~> 2.2)
railties (>= 3.1, < 7.1)
rubocop (1.40.0)
rubocop (1.41.0)
json (~> 2.3)
parallel (~> 1.10)
parser (>= 3.1.2.1)
@ -987,7 +984,7 @@ DEPENDENCIES
easy_translate (~> 0.5.1)
email_validator (~> 2.2)
emoji_regex (~> 3.2)
erb_lint (~> 0.0.37)
erb_lint (~> 0.3)
exifr (>= 1.3.6)
factory_bot_rails (~> 6.2)
faker (~> 2.22)

View file

@ -1,3 +1,114 @@
#!/usr/bin/env ruby
ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../Gemfile', __dir__)
load Gem.bin_path('bundler', 'bundle')
# frozen_string_literal: true
#
# This file was generated by Bundler.
#
# The application 'bundle' is installed as part of a gem, and
# this file is here to facilitate running it.
#
require "rubygems"
m = Module.new do
module_function
def invoked_as_script?
File.expand_path($0) == File.expand_path(__FILE__)
end
def env_var_version
ENV["BUNDLER_VERSION"]
end
def cli_arg_version
return unless invoked_as_script? # don't want to hijack other binstubs
return unless "update".start_with?(ARGV.first || " ") # must be running `bundle update`
bundler_version = nil
update_index = nil
ARGV.each_with_index do |a, i|
if update_index && update_index.succ == i && a =~ Gem::Version::ANCHORED_VERSION_PATTERN
bundler_version = a
end
next unless a =~ /\A--bundler(?:[= ](#{Gem::Version::VERSION_PATTERN}))?\z/
bundler_version = $1
update_index = i
end
bundler_version
end
def gemfile
gemfile = ENV["BUNDLE_GEMFILE"]
return gemfile if gemfile && !gemfile.empty?
File.expand_path("../../Gemfile", __FILE__)
end
def lockfile
lockfile =
case File.basename(gemfile)
when "gems.rb" then gemfile.sub(/\.rb$/, gemfile)
else "#{gemfile}.lock"
end
File.expand_path(lockfile)
end
def lockfile_version
return unless File.file?(lockfile)
lockfile_contents = File.read(lockfile)
return unless lockfile_contents =~ /\n\nBUNDLED WITH\n\s{2,}(#{Gem::Version::VERSION_PATTERN})\n/
Regexp.last_match(1)
end
def bundler_version
@bundler_version ||=
env_var_version || cli_arg_version ||
lockfile_version
end
def bundler_requirement
return "#{Gem::Requirement.default}.a" unless bundler_version
bundler_gem_version = Gem::Version.new(bundler_version)
requirement = bundler_gem_version.approximate_recommendation
return requirement unless Gem::Version.new(Gem::VERSION) < Gem::Version.new("2.7.0")
requirement += ".a" if bundler_gem_version.prerelease?
requirement
end
def load_bundler!
ENV["BUNDLE_GEMFILE"] ||= gemfile
activate_bundler
end
def activate_bundler
gem_error = activation_error_handling do
gem "bundler", bundler_requirement
end
return if gem_error.nil?
require_error = activation_error_handling do
require "bundler/version"
end
return if require_error.nil? && Gem::Requirement.new(bundler_requirement).satisfied_by?(Gem::Version.new(Bundler::VERSION))
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}'`"
exit 42
end
def activation_error_handling
yield
nil
rescue StandardError, LoadError => e
e
end
end
m.load_bundler!
if m.invoked_as_script?
load Gem.bin_path("bundler", "bundle")
end

29
bin/erblint Executable file
View file

@ -0,0 +1,29 @@
#!/usr/bin/env ruby
# frozen_string_literal: true
#
# This file was generated by Bundler.
#
# The application 'erblint' is installed as part of a gem, and
# this file is here to facilitate running it.
#
require "pathname"
ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../../Gemfile",
Pathname.new(__FILE__).realpath)
bundle_binstub = File.expand_path("../bundle", __FILE__)
if File.file?(bundle_binstub)
if File.read(bundle_binstub, 300) =~ /This file was generated by Bundler/
load(bundle_binstub)
else
abort("Your `bin/bundle` was not generated by Bundler, so this binstub cannot run.
Replace `bin/bundle` by running `bundle binstubs bundler --force`, then run this command again.")
end
end
require "rubygems"
require "bundler/setup"
load Gem.bin_path("erb_lint", "erblint")

Binary file not shown.

BIN
vendor/cache/better_html-2.0.1.gem vendored Normal file

Binary file not shown.

Binary file not shown.

BIN
vendor/cache/erb_lint-0.3.1.gem vendored Normal file

Binary file not shown.

Binary file not shown.

Binary file not shown.

BIN
vendor/cache/rubocop-1.41.0.gem vendored Normal file

Binary file not shown.