mirror of
https://github.com/Homebrew/brew.git
synced 2025-07-14 16:09:03 +08:00
Avoid reinstalling bundler
in integration tests.
This commit is contained in:
parent
0716d0bf28
commit
f438fa98be
@ -42,7 +42,6 @@ module Homebrew
|
|||||||
args = tests_args.parse
|
args = tests_args.parse
|
||||||
|
|
||||||
Homebrew.install_bundler_gems!
|
Homebrew.install_bundler_gems!
|
||||||
gem_user_dir = Gem.user_dir
|
|
||||||
|
|
||||||
require "byebug" if args.byebug?
|
require "byebug" if args.byebug?
|
||||||
|
|
||||||
@ -138,6 +137,9 @@ module Homebrew
|
|||||||
|
|
||||||
puts "Randomized with seed #{seed}"
|
puts "Randomized with seed #{seed}"
|
||||||
|
|
||||||
|
# Let tests find `bundle` in the actual location.
|
||||||
|
ENV["HOMEBREW_TESTS_GEM_USER_DIR"] = gem_user_dir
|
||||||
|
|
||||||
# Let `bundle` in PATH find its gem.
|
# Let `bundle` in PATH find its gem.
|
||||||
ENV["GEM_PATH"] = "#{ENV["GEM_PATH"]}:#{gem_user_dir}"
|
ENV["GEM_PATH"] = "#{ENV["GEM_PATH"]}:#{gem_user_dir}"
|
||||||
|
|
||||||
|
@ -17,9 +17,13 @@ module Homebrew
|
|||||||
"#{RbConfig::CONFIG["prefix"]}/bin"
|
"#{RbConfig::CONFIG["prefix"]}/bin"
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def gem_user_dir
|
||||||
|
ENV["HOMEBREW_TESTS_GEM_USER_DIR"] || Gem.user_dir
|
||||||
|
end
|
||||||
|
|
||||||
def gem_user_bindir
|
def gem_user_bindir
|
||||||
require "rubygems"
|
require "rubygems"
|
||||||
"#{Gem.user_dir}/bin"
|
"#{gem_user_dir}/bin"
|
||||||
end
|
end
|
||||||
|
|
||||||
def ohai_if_defined(message)
|
def ohai_if_defined(message)
|
||||||
@ -55,7 +59,7 @@ module Homebrew
|
|||||||
Gem.clear_paths
|
Gem.clear_paths
|
||||||
Gem::Specification.reset
|
Gem::Specification.reset
|
||||||
|
|
||||||
# Add necessary Ruby and Gem binary directories to PATH.
|
# Add necessary Ruby and Gem binary directories to `PATH`.
|
||||||
gem_bindir ||= Gem.bindir
|
gem_bindir ||= Gem.bindir
|
||||||
paths = ENV.fetch("PATH").split(":")
|
paths = ENV.fetch("PATH").split(":")
|
||||||
paths.unshift(gem_bindir) unless paths.include?(gem_bindir)
|
paths.unshift(gem_bindir) unless paths.include?(gem_bindir)
|
||||||
@ -92,7 +96,7 @@ module Homebrew
|
|||||||
|
|
||||||
def install_bundler!
|
def install_bundler!
|
||||||
require "rubygems"
|
require "rubygems"
|
||||||
setup_gem_environment!(gem_home: Gem.user_dir, gem_bindir: gem_user_bindir)
|
setup_gem_environment!(gem_home: gem_user_dir, gem_bindir: gem_user_bindir)
|
||||||
install_gem_setup_path!(
|
install_gem_setup_path!(
|
||||||
"bundler",
|
"bundler",
|
||||||
version: HOMEBREW_BUNDLER_VERSION,
|
version: HOMEBREW_BUNDLER_VERSION,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user