зеркало из https://github.com/github/ruby.git
[rubygems/rubygems] Respect `BUNDLE_USER_CONFIG` if set
https://github.com/rubygems/rubygems/commit/f28ab141af
This commit is contained in:
Родитель
d37c2441cc
Коммит
0ab160e2e0
|
@ -428,6 +428,8 @@ module Bundler
|
|||
def global_config_file
|
||||
if ENV["BUNDLE_CONFIG"] && !ENV["BUNDLE_CONFIG"].empty?
|
||||
Pathname.new(ENV["BUNDLE_CONFIG"])
|
||||
elsif ENV["BUNDLE_USER_CONFIG"] && !ENV["BUNDLE_USER_CONFIG"].empty?
|
||||
Pathname.new(ENV["BUNDLE_USER_CONFIG"])
|
||||
elsif Bundler.rubygems.user_home && !Bundler.rubygems.user_home.empty?
|
||||
Pathname.new(Bundler.rubygems.user_home).join(".bundle/config")
|
||||
end
|
||||
|
|
|
@ -76,6 +76,20 @@ RSpec.describe ".bundle/config" do
|
|||
end
|
||||
end
|
||||
|
||||
describe "config location" do
|
||||
let(:bundle_user_config) { File.join(Dir.home, ".config/bundler") }
|
||||
|
||||
before do
|
||||
Dir.mkdir File.dirname(bundle_user_config)
|
||||
end
|
||||
|
||||
it "can be configured through BUNDLE_USER_CONFIG" do
|
||||
bundle "config set path vendor", :env => { "BUNDLE_USER_CONFIG" => bundle_user_config }
|
||||
bundle "config get path", :env => { "BUNDLE_USER_CONFIG" => bundle_user_config }
|
||||
expect(out).to include("Set for the current user (#{bundle_user_config}): \"vendor\"")
|
||||
end
|
||||
end
|
||||
|
||||
describe "global" do
|
||||
before(:each) do
|
||||
install_gemfile <<-G
|
||||
|
|
Загрузка…
Ссылка в новой задаче