Call Homebrew.install_bundler_gems! more consistently.

- Call `Homebrew.install_bundler_gems!` as early as possible
- Always call `Homebrew.install_bundler_gems!` in `dev-cmd` rather than
  in `Library/Homebrew` helpers method (to ensure we don't accidentally
  call this for non-dev-cmd commands)
This commit is contained in:
Mike McQuaid 2024-04-30 10:39:35 +01:00
parent d474060eab
commit aa6ea4be83
No known key found for this signature in database
7 changed files with 12 additions and 10 deletions

View File

@ -121,6 +121,10 @@ module Homebrew
skip_style = args.skip_style? || args.no_named? || tap_audit
no_named_args = T.let(false, T::Boolean)
gem_groups = ["audit"]
gem_groups << "style" unless skip_style
Homebrew.install_bundler_gems!(groups: gem_groups)
ENV.activate_extensions!
ENV.setup_build_environment
@ -164,10 +168,6 @@ module Homebrew
return
end
gem_groups = ["audit"]
gem_groups << "style" unless skip_style
Homebrew.install_bundler_gems!(groups: gem_groups)
style_files = args.named.to_paths unless skip_style
only_cops = args.only_cops

View File

@ -32,6 +32,8 @@ module Homebrew
# user path, too.
ENV["PATH"] = PATH.new(ORIGINAL_PATHS).to_s
Homebrew.install_bundler_gems!(groups: ["ast"]) unless args.dry_run?
args.named.to_formulae.each do |formula|
current_revision = formula.revision
new_revision = current_revision + 1
@ -47,7 +49,6 @@ module Homebrew
end
end
else
Homebrew.install_bundler_gems!(groups: ["ast"])
require "utils/ast"
formula_ast = Utils::AST::FormulaAST.new(formula.path.read)

View File

@ -21,6 +21,8 @@ module Homebrew
sig { override.void }
def run
Homebrew.install_bundler_gems!(groups: ["man"])
Commands.rebuild_internal_commands_completion_list
Manpages.regenerate_man_pages(quiet: args.quiet?)
Completions.update_shell_completions!

View File

@ -44,10 +44,11 @@ module Homebrew
def run
json_files = Dir["*.bottle.json"]
odie "No bottle JSON files found in the current working directory" if json_files.blank?
bottles_hash = bottles_hash_from_json_files(json_files, args)
Homebrew.install_bundler_gems!(groups: ["pr_upload"])
bottles_hash = bottles_hash_from_json_files(json_files, args)
unless args.upload_only?
bottle_args = ["bottle", "--merge", "--write"]
bottle_args << "--verbose" if args.verbose?

View File

@ -43,6 +43,8 @@ module Homebrew
sig { override.void }
def run
Homebrew.install_bundler_gems!(groups: ["style"])
target = if args.no_named?
nil
else

View File

@ -26,8 +26,6 @@ module Homebrew
)
def self.regenerate_man_pages(quiet:)
Homebrew.install_bundler_gems!(groups: ["man"])
require "kramdown"
require "manpages/parser/ronn"
require "manpages/converter/kramdown"

View File

@ -83,8 +83,6 @@ module Homebrew
def self.run_rubocop(files, output_type,
fix: false, except_cops: nil, only_cops: nil, display_cop_names: false, reset_cache: false,
debug: false, verbose: false)
Homebrew.install_bundler_gems!(groups: ["style"])
require "warnings"
Warnings.ignore :parser_syntax do