зеркало из https://github.com/github/ruby.git
[rubygems/rubygems] Rename `BUNDLE_SPEC_RUN` environment variable
The `BUNDLE_` prefix should be reserved to first class settings that should be listed when running `bundle config`. This one is just a hacky environment variable that has not corresponding documented setting. https://github.com/rubygems/rubygems/commit/7e255c5058
This commit is contained in:
Родитель
a350ed4123
Коммит
01f95ede0e
|
@ -239,7 +239,7 @@ module Bundler
|
||||||
current = File.expand_path(SharedHelpers.pwd).tap{|x| x.untaint if RUBY_VERSION < "2.7" }
|
current = File.expand_path(SharedHelpers.pwd).tap{|x| x.untaint if RUBY_VERSION < "2.7" }
|
||||||
|
|
||||||
until !File.directory?(current) || current == previous
|
until !File.directory?(current) || current == previous
|
||||||
if ENV["BUNDLE_SPEC_RUN"]
|
if ENV["BUNDLER_SPEC_RUN"]
|
||||||
# avoid stepping above the tmp directory when testing
|
# avoid stepping above the tmp directory when testing
|
||||||
gemspec = if ENV["GEM_COMMAND"]
|
gemspec = if ENV["GEM_COMMAND"]
|
||||||
# for Ruby Core
|
# for Ruby Core
|
||||||
|
|
|
@ -425,27 +425,27 @@ E
|
||||||
|
|
||||||
describe "subcommands" do
|
describe "subcommands" do
|
||||||
it "list" do
|
it "list" do
|
||||||
bundle "config list"
|
bundle "config list", :env => { "BUNDLE_FOO" => "bar" }
|
||||||
expect(out).to eq "Settings are listed in order of priority. The top value will be used.\nspec_run\nSet via BUNDLE_SPEC_RUN: \"true\""
|
expect(out).to eq "Settings are listed in order of priority. The top value will be used.\nfoo\nSet via BUNDLE_FOO: \"bar\""
|
||||||
|
|
||||||
bundle "config list", :parseable => true
|
bundle "config list", :env => { "BUNDLE_FOO" => "bar" }, :parseable => true
|
||||||
expect(out).to eq "spec_run=true"
|
expect(out).to eq "foo=bar"
|
||||||
end
|
end
|
||||||
|
|
||||||
it "list with credentials" do
|
it "list with credentials" do
|
||||||
bundle "config list", :env => { "BUNDLE_GEMS__MYSERVER__COM" => "user:password" }
|
bundle "config list", :env => { "BUNDLE_GEMS__MYSERVER__COM" => "user:password" }
|
||||||
expect(out).to eq "Settings are listed in order of priority. The top value will be used.\ngems.myserver.com\nSet via BUNDLE_GEMS__MYSERVER__COM: \"user:[REDACTED]\"\n\nspec_run\nSet via BUNDLE_SPEC_RUN: \"true\""
|
expect(out).to eq "Settings are listed in order of priority. The top value will be used.\ngems.myserver.com\nSet via BUNDLE_GEMS__MYSERVER__COM: \"user:[REDACTED]\""
|
||||||
|
|
||||||
bundle "config list", :parseable => true, :env => { "BUNDLE_GEMS__MYSERVER__COM" => "user:password" }
|
bundle "config list", :parseable => true, :env => { "BUNDLE_GEMS__MYSERVER__COM" => "user:password" }
|
||||||
expect(out).to eq "gems.myserver.com=user:password\nspec_run=true"
|
expect(out).to eq "gems.myserver.com=user:password"
|
||||||
end
|
end
|
||||||
|
|
||||||
it "list with API token credentials" do
|
it "list with API token credentials" do
|
||||||
bundle "config list", :env => { "BUNDLE_GEMS__MYSERVER__COM" => "api_token:x-oauth-basic" }
|
bundle "config list", :env => { "BUNDLE_GEMS__MYSERVER__COM" => "api_token:x-oauth-basic" }
|
||||||
expect(out).to eq "Settings are listed in order of priority. The top value will be used.\ngems.myserver.com\nSet via BUNDLE_GEMS__MYSERVER__COM: \"[REDACTED]:x-oauth-basic\"\n\nspec_run\nSet via BUNDLE_SPEC_RUN: \"true\""
|
expect(out).to eq "Settings are listed in order of priority. The top value will be used.\ngems.myserver.com\nSet via BUNDLE_GEMS__MYSERVER__COM: \"[REDACTED]:x-oauth-basic\""
|
||||||
|
|
||||||
bundle "config list", :parseable => true, :env => { "BUNDLE_GEMS__MYSERVER__COM" => "api_token:x-oauth-basic" }
|
bundle "config list", :parseable => true, :env => { "BUNDLE_GEMS__MYSERVER__COM" => "api_token:x-oauth-basic" }
|
||||||
expect(out).to eq "gems.myserver.com=api_token:x-oauth-basic\nspec_run=true"
|
expect(out).to eq "gems.myserver.com=api_token:x-oauth-basic"
|
||||||
end
|
end
|
||||||
|
|
||||||
it "get" do
|
it "get" do
|
||||||
|
|
|
@ -71,7 +71,7 @@ RSpec.configure do |config|
|
||||||
|
|
||||||
require_relative "support/rubygems_ext"
|
require_relative "support/rubygems_ext"
|
||||||
Spec::Rubygems.test_setup
|
Spec::Rubygems.test_setup
|
||||||
ENV["BUNDLE_SPEC_RUN"] = "true"
|
ENV["BUNDLER_SPEC_RUN"] = "true"
|
||||||
ENV["BUNDLE_USER_CONFIG"] = ENV["BUNDLE_USER_CACHE"] = ENV["BUNDLE_USER_PLUGIN"] = nil
|
ENV["BUNDLE_USER_CONFIG"] = ENV["BUNDLE_USER_CACHE"] = ENV["BUNDLE_USER_PLUGIN"] = nil
|
||||||
ENV["RUBYGEMS_GEMDEPS"] = nil
|
ENV["RUBYGEMS_GEMDEPS"] = nil
|
||||||
ENV["XDG_CONFIG_HOME"] = nil
|
ENV["XDG_CONFIG_HOME"] = nil
|
||||||
|
|
Загрузка…
Ссылка в новой задаче