summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBundlerbot <bot@bundler.io>2019-02-20 19:43:14 +0000
committerBundlerbot <bot@bundler.io>2019-02-20 19:43:14 +0000
commitd78a4ec4b3b147fab139a494c5761d762529d3e9 (patch)
tree4603d2f3df92d08b2e3d5f872a82adafeeccb303
parent7199b124d4b6d217fc1dff2f1e93dda151ad9664 (diff)
parent9c99a81e62f110c4c401928bff8fc7312fbd2d54 (diff)
downloadbundler-d78a4ec4b3b147fab139a494c5761d762529d3e9.tar.gz
Merge #6974
6974: Use newer list interface r=indirect a=deivid-rodriguez ### What was the end-user problem that led to this PR? The problem was that our specs emit a lot of deprecations about the list command. ### What was your diagnosis of the problem? My diagnosis was that we are using the deprecated interface to the list command everywhere. ### What is your fix for the problem, implemented in this PR? My fix is to start using the new interface. If we don't use it ourselves, how could we be in a position to tell our users to start using it? ### Why did you choose this fix out of the possible options? I chose this fix because we should do this, at same point, and doing it now simplifies enabling deprecations. Co-authored-by: David Rodríguez <deivid.rodriguez@riseup.net>
-rw-r--r--lib/bundler.rb2
-rw-r--r--lib/bundler/cli.rb8
-rw-r--r--lib/bundler/cli/outdated.rb4
-rw-r--r--lib/bundler/definition.rb4
-rw-r--r--lib/bundler/dsl.rb4
-rw-r--r--lib/bundler/fetcher.rb2
-rw-r--r--lib/bundler/lazy_specification.rb2
-rw-r--r--lib/bundler/rubygems_gem_installer.rb2
-rw-r--r--lib/bundler/settings.rb6
-rw-r--r--lib/bundler/source/git.rb11
-rw-r--r--lib/bundler/source_list.rb2
-rw-r--r--man/bundle-config.ronn46
-rw-r--r--spec/bundler/cli_spec.rb6
-rw-r--r--spec/bundler/dsl_spec.rb4
-rw-r--r--spec/bundler/source_list_spec.rb2
-rw-r--r--spec/cache/cache_path_spec.rb2
-rw-r--r--spec/commands/binstubs_spec.rb4
-rw-r--r--spec/commands/clean_spec.rb6
-rw-r--r--spec/commands/config_spec.rb94
-rw-r--r--spec/commands/console_spec.rb6
-rw-r--r--spec/commands/exec_spec.rb4
-rw-r--r--spec/commands/init_spec.rb2
-rw-r--r--spec/commands/licenses_spec.rb2
-rw-r--r--spec/commands/newgem_spec.rb8
-rw-r--r--spec/commands/open_spec.rb2
-rw-r--r--spec/commands/outdated_spec.rb6
-rw-r--r--spec/commands/pristine_spec.rb4
-rw-r--r--spec/commands/show_spec.rb2
-rw-r--r--spec/commands/update_spec.rb4
-rw-r--r--spec/install/allow_offline_install_spec.rb2
-rw-r--r--spec/install/gemfile/git_spec.rb22
-rw-r--r--spec/install/gemfile/platform_spec.rb2
-rw-r--r--spec/install/gemfile/sources_spec.rb8
-rw-r--r--spec/install/gemfile/specific_platform_spec.rb2
-rw-r--r--spec/install/gemfile_spec.rb2
-rw-r--r--spec/install/gems/compact_index_spec.rb14
-rw-r--r--spec/install/gems/dependency_api_spec.rb12
-rw-r--r--spec/install/gems/mirror_spec.rb4
-rw-r--r--spec/install/gems/native_extensions_spec.rb2
-rw-r--r--spec/install/gems/post_install_spec.rb4
-rw-r--r--spec/lock/lockfile_bundler_1_spec.rb2
-rw-r--r--spec/lock/lockfile_spec.rb2
-rw-r--r--spec/other/major_deprecation_spec.rb4
-rw-r--r--spec/realworld/gemfile_source_header_spec.rb2
-rw-r--r--spec/runtime/with_unbundled_env_spec.rb2
-rw-r--r--spec/support/helpers.rb4
-rw-r--r--spec/update/gemfile_spec.rb2
47 files changed, 181 insertions, 162 deletions
diff --git a/lib/bundler.rb b/lib/bundler.rb
index 137d916cc6..0416bb08f6 100644
--- a/lib/bundler.rb
+++ b/lib/bundler.rb
@@ -365,7 +365,7 @@ EOF
# system binaries. If you put '-n foo' in your .gemrc, RubyGems will
# install binstubs there instead. Unfortunately, RubyGems doesn't expose
# that directory at all, so rather than parse .gemrc ourselves, we allow
- # the directory to be set as well, via `bundle config bindir foo`.
+ # the directory to be set as well, via `bundle config set bindir foo`.
Bundler.settings[:system_bindir] || Bundler.rubygems.gem_bindir
end
diff --git a/lib/bundler/cli.rb b/lib/bundler/cli.rb
index c591884263..916ae9bf78 100644
--- a/lib/bundler/cli.rb
+++ b/lib/bundler/cli.rb
@@ -545,14 +545,14 @@ module Bundler
desc "gem NAME [OPTIONS]", "Creates a skeleton for creating a rubygem"
method_option :exe, :type => :boolean, :default => false, :aliases => ["--bin", "-b"], :desc => "Generate a binary executable for your library."
- method_option :coc, :type => :boolean, :desc => "Generate a code of conduct file. Set a default with `bundle config gem.coc true`."
+ method_option :coc, :type => :boolean, :desc => "Generate a code of conduct file. Set a default with `bundle config set gem.coc true`."
method_option :edit, :type => :string, :aliases => "-e", :required => false, :banner => "EDITOR",
:lazy_default => [ENV["BUNDLER_EDITOR"], ENV["VISUAL"], ENV["EDITOR"]].find {|e| !e.nil? && !e.empty? },
:desc => "Open generated gemspec in the specified editor (defaults to $EDITOR or $BUNDLER_EDITOR)"
method_option :ext, :type => :boolean, :default => false, :desc => "Generate the boilerplate for C extension code"
- method_option :mit, :type => :boolean, :desc => "Generate an MIT license file. Set a default with `bundle config gem.mit true`."
+ method_option :mit, :type => :boolean, :desc => "Generate an MIT license file. Set a default with `bundle config set gem.mit true`."
method_option :test, :type => :string, :lazy_default => "rspec", :aliases => "-t", :banner => "rspec",
- :desc => "Generate a test directory for your library, either rspec or minitest. Set a default with `bundle config gem.test rspec`."
+ :desc => "Generate a test directory for your library, either rspec or minitest. Set a default with `bundle config set gem.test rspec`."
def gem(name)
end
@@ -714,7 +714,7 @@ module Bundler
# Automatically invoke `bundle install` and resume if
# Bundler.settings[:auto_install] exists. This is set through config cmd
- # `bundle config auto_install 1`.
+ # `bundle config set auto_install 1`.
#
# Note that this method `nil`s out the global Definition object, so it
# should be called first, before you instantiate anything like an
diff --git a/lib/bundler/cli/outdated.rb b/lib/bundler/cli/outdated.rb
index 6cbb3452cb..3a0521de1e 100644
--- a/lib/bundler/cli/outdated.rb
+++ b/lib/bundler/cli/outdated.rb
@@ -221,9 +221,9 @@ module Bundler
def check_for_deployment_mode
return unless Bundler.frozen_bundle?
suggested_command = if Bundler.settings.locations("frozen")[:global]
- "bundle config --delete frozen"
+ "bundle config unset frozen"
elsif Bundler.settings.locations("deployment").keys.&([:global, :local]).any?
- "bundle config --delete deployment"
+ "bundle config unset deployment"
else
"bundle install --no-deployment"
end
diff --git a/lib/bundler/definition.rb b/lib/bundler/definition.rb
index 9d6fbfff59..aa399c3983 100644
--- a/lib/bundler/definition.rb
+++ b/lib/bundler/definition.rb
@@ -397,9 +397,9 @@ module Bundler
unless explicit_flag
suggested_command = if Bundler.settings.locations("frozen")[:global]
- "bundle config --delete frozen"
+ "bundle config unset frozen"
elsif Bundler.settings.locations("deployment").keys.&([:global, :local]).any?
- "bundle config --delete deployment"
+ "bundle config unset deployment"
else
"bundle install --no-deployment"
end
diff --git a/lib/bundler/dsl.rb b/lib/bundler/dsl.rb
index 6707fc5893..6f0d361160 100644
--- a/lib/bundler/dsl.rb
+++ b/lib/bundler/dsl.rb
@@ -474,7 +474,7 @@ repo_name ||= user_name
"should come from that source"
unless Bundler.feature_flag.bundler_2_mode?
msg += ". To downgrade this error to a warning, run " \
- "`bundle config --delete disable_multisource`"
+ "`bundle config unset disable_multisource`"
end
raise GemfileEvalError, msg
else
@@ -482,7 +482,7 @@ repo_name ||= user_name
"Using `source` more than once without a block is a security risk, and " \
"may result in installing unexpected gems. To resolve this warning, use " \
"a block to indicate which gems should come from the secondary source. " \
- "To upgrade this warning to an error, run `bundle config " \
+ "To upgrade this warning to an error, run `bundle config set " \
"disable_multisource true`."
end
end
diff --git a/lib/bundler/fetcher.rb b/lib/bundler/fetcher.rb
index 4dd42e42ff..7ab71d99a8 100644
--- a/lib/bundler/fetcher.rb
+++ b/lib/bundler/fetcher.rb
@@ -44,7 +44,7 @@ module Bundler
remote_uri = filter_uri(remote_uri)
super "Authentication is required for #{remote_uri}.\n" \
"Please supply credentials for this source. You can do this by running:\n" \
- " bundle config #{remote_uri} username:password"
+ " bundle config set #{remote_uri} username:password"
end
end
# This error is raised if HTTP authentication is provided, but incorrect.
diff --git a/lib/bundler/lazy_specification.rb b/lib/bundler/lazy_specification.rb
index d9cb01f810..69a721c120 100644
--- a/lib/bundler/lazy_specification.rb
+++ b/lib/bundler/lazy_specification.rb
@@ -77,7 +77,7 @@ module Bundler
if search && Gem::Platform.new(search.platform) != Gem::Platform.new(platform) && !search.runtime_dependencies.-(dependencies.reject {|d| d.type == :development }).empty?
Bundler.ui.warn "Unable to use the platform-specific (#{search.platform}) version of #{name} (#{version}) " \
"because it has different dependencies from the #{platform} version. " \
- "To use the platform-specific version of the gem, run `bundle config specific_platform true` and install again."
+ "To use the platform-specific version of the gem, run `bundle config set specific_platform true` and install again."
search = source.specs.search(self).last
end
search.dependencies = dependencies if search && (search.is_a?(RemoteSpecification) || search.is_a?(EndpointSpecification))
diff --git a/lib/bundler/rubygems_gem_installer.rb b/lib/bundler/rubygems_gem_installer.rb
index 2b7fa8e0f6..b1076b4554 100644
--- a/lib/bundler/rubygems_gem_installer.rb
+++ b/lib/bundler/rubygems_gem_installer.rb
@@ -66,7 +66,7 @@ module Bundler
If you wish to continue installing the downloaded gem, and are certain it does not pose a \
security issue despite the mismatching checksum, do the following:
- 1. run `bundle config disable_checksum_validation true` to turn off checksum verification
+ 1. run `bundle config set disable_checksum_validation true` to turn off checksum verification
2. run `bundle install`
(More info: The expected SHA256 checksum was #{checksum.inspect}, but the \
diff --git a/lib/bundler/settings.rb b/lib/bundler/settings.rb
index e0b6facecb..79690d31aa 100644
--- a/lib/bundler/settings.rb
+++ b/lib/bundler/settings.rb
@@ -109,15 +109,15 @@ module Bundler
value
else
command = if value.nil?
- "bundle config --delete #{key}"
+ "bundle config unset #{key}"
else
- "bundle config #{key} #{Array(value).join(":")}"
+ "bundle config set #{key} #{Array(value).join(":")}"
end
Bundler::SharedHelpers.major_deprecation 2,\
"flags passed to commands " \
"will no longer be automatically remembered. Instead please set flags " \
- "you want remembered between commands using `bundle config " \
+ "you want remembered between commands using `bundle config set " \
"<setting name> <setting value>`, i.e. `#{command}`"
set_local(key, value)
diff --git a/lib/bundler/source/git.rb b/lib/bundler/source/git.rb
index 8a31fa307f..a8afb341d8 100644
--- a/lib/bundler/source/git.rb
+++ b/lib/bundler/source/git.rb
@@ -118,18 +118,19 @@ module Bundler
def local_override!(path)
return false if local?
+ original_path = path
path = Pathname.new(path)
path = path.expand_path(Bundler.root) unless path.relative?
unless options["branch"] || Bundler.settings[:disable_local_branch_check]
raise GitError, "Cannot use local override for #{name} at #{path} because " \
- ":branch is not specified in Gemfile. Specify a branch or use " \
- "`bundle config --delete` to remove the local override"
+ ":branch is not specified in Gemfile. Specify a branch or run " \
+ "`bundle config unset local.#{override_for(original_path)}` to remove the local override"
end
unless path.exist?
raise GitError, "Cannot use local override for #{name} because #{path} " \
- "does not exist. Check `bundle config --delete` to remove the local override"
+ "does not exist. Run `bundle config unset local.#{override_for(original_path)}` to remove the local override"
end
set_local!(path)
@@ -328,6 +329,10 @@ module Bundler
def extension_cache_slug(_)
extension_dir_name
end
+
+ def override_for(path)
+ Bundler.settings.local_overrides.key(path)
+ end
end
end
end
diff --git a/lib/bundler/source_list.rb b/lib/bundler/source_list.rb
index ac2adacb3d..61b7a4e1aa 100644
--- a/lib/bundler/source_list.rb
+++ b/lib/bundler/source_list.rb
@@ -150,7 +150,7 @@ module Bundler
if source.uri =~ /^git\:/
Bundler.ui.warn "The git source `#{source.uri}` uses the `git` protocol, " \
"which transmits data without encryption. Disable this warning with " \
- "`bundle config git.allow_insecure true`, or switch to the `https` " \
+ "`bundle config set git.allow_insecure true`, or switch to the `https` " \
"protocol to keep your data secure."
end
end
diff --git a/man/bundle-config.ronn b/man/bundle-config.ronn
index 81e0aa303c..64f0fea743 100644
--- a/man/bundle-config.ronn
+++ b/man/bundle-config.ronn
@@ -3,7 +3,7 @@ bundle-config(1) -- Set bundler configuration options
## SYNOPSIS
-`bundle config` [<name> [<value>]]
+`bundle config` [list|get|set|unset] [<name> [<value>]]
## DESCRIPTION
@@ -16,39 +16,39 @@ Bundler loads configuration settings in this order:
3. Global config (`~/.bundle/config`)
4. Bundler default config
-Executing `bundle config` with no parameters will print a list of all
-bundler configuration for the current bundle, and where that configuration
+Executing `bundle config list` with will print a list of all bundler
+configuration for the current bundle, and where that configuration
was set.
-Executing `bundle config <name>` will print the value of that configuration
+Executing `bundle config get <name>` will print the value of that configuration
setting, and where it was set.
-Executing `bundle config <name> <value>` will set that configuration to the
+Executing `bundle config set <name> <value>` will set that configuration to the
value specified for all bundles executed as the current user. The configuration
will be stored in `~/.bundle/config`. If <name> already is set, <name> will be
overridden and user will be warned.
-Executing `bundle config --global <name> <value>` works the same as above.
+Executing `bundle config set --global <name> <value>` works the same as above.
-Executing `bundle config --local <name> <value>` will set that configuration to
+Executing `bundle config set --local <name> <value>` will set that configuration to
the local application. The configuration will be stored in `app/.bundle/config`.
-Executing `bundle config --delete <name>` will delete the configuration in both
+Executing `bundle config unset <name>` will delete the configuration in both
local and global sources. Not compatible with --global or --local flag.
Executing bundle with the `BUNDLE_IGNORE_CONFIG` environment variable set will
cause it to ignore all configuration.
-Executing `bundle config disable_multisource true` upgrades the warning about
+Executing `bundle config set disable_multisource true` upgrades the warning about
the Gemfile containing multiple primary sources to an error. Executing `bundle
-config --delete disable_multisource` downgrades this error to a warning.
+config unset disable_multisource` downgrades this error to a warning.
## REMEMBERING OPTIONS
Flags passed to `bundle install` or the Bundler runtime,
such as `--path foo` or `--without production`, are not remembered between commands.
-If these options must be remembered,they must be set using `bundle config`
-(e.g., `bundle config path foo`).
+If these options must be remembered, they must be set using `bundle config`
+(e.g., `bundle config set path foo`).
The options that can be configured are:
@@ -92,7 +92,7 @@ pass configuration flags to `gem install` to specify where to find the
Since the specific location of that executable can change from machine
to machine, you can specify these flags on a per-machine basis.
- bundle config build.mysql --with-mysql-config=/usr/local/mysql/bin/mysql_config
+ bundle config set build.mysql --with-mysql-config=/usr/local/mysql/bin/mysql_config
After running this command, every time bundler needs to install the
`mysql` gem, it will pass along the flags you specified.
@@ -169,7 +169,7 @@ learn more about their operation in [bundle install(1)](bundle-install.1.html).
* `disable_multisource` (`BUNDLE_DISABLE_MULTISOURCE`):
When set, Gemfiles containing multiple sources will produce errors
instead of warnings.
- Use `bundle config --delete disable_multisource` to unset.
+ Use `bundle config unset disable_multisource` to unset.
* `disable_platform_warnings` (`BUNDLE_DISABLE_PLATFORM_WARNINGS`):
Disable warnings during bundle install when a dependency is unused on the current platform.
* `disable_shared_gems` (`BUNDLE_DISABLE_SHARED_GEMS`):
@@ -302,11 +302,11 @@ Bundler also allows you to work against a git repository locally
instead of using the remote version. This can be achieved by setting
up a local override:
- bundle config local.GEM_NAME /path/to/local/git/repository
+ bundle config set local.GEM_NAME /path/to/local/git/repository
For example, in order to use a local Rack repository, a developer could call:
- bundle config local.rack ~/Work/git/rack
+ bundle config set local.rack ~/Work/git/rack
Now instead of checking out the remote git repository, the local
override will be used. Similar to a path source, every time the local
@@ -336,21 +336,21 @@ Bundler supports overriding gem sources with mirrors. This allows you to
configure rubygems.org as the gem source in your Gemfile while still using your
mirror to fetch gems.
- bundle config mirror.SOURCE_URL MIRROR_URL
+ bundle config set mirror.SOURCE_URL MIRROR_URL
For example, to use a mirror of rubygems.org hosted at rubygems-mirror.org:
- bundle config mirror.http://rubygems.org http://rubygems-mirror.org
+ bundle config set mirror.http://rubygems.org http://rubygems-mirror.org
Each mirror also provides a fallback timeout setting. If the mirror does not
respond within the fallback timeout, Bundler will try to use the original
server instead of the mirror.
- bundle config mirror.SOURCE_URL.fallback_timeout TIMEOUT
+ bundle config set mirror.SOURCE_URL.fallback_timeout TIMEOUT
For example, to fall back to rubygems.org after 3 seconds:
- bundle config mirror.https://rubygems.org.fallback_timeout 3
+ bundle config set mirror.https://rubygems.org.fallback_timeout 3
The default fallback timeout is 0.1 seconds, but the setting can currently
only accept whole seconds (for example, 1, 15, or 30).
@@ -360,12 +360,12 @@ only accept whole seconds (for example, 1, 15, or 30).
Bundler allows you to configure credentials for any gem source, which allows
you to avoid putting secrets into your Gemfile.
- bundle config SOURCE_HOSTNAME USERNAME:PASSWORD
+ bundle config set SOURCE_HOSTNAME USERNAME:PASSWORD
For example, to save the credentials of user `claudette` for the gem source at
`gems.longerous.com`, you would run:
- bundle config gems.longerous.com claudette:s00pers3krit
+ bundle config set gems.longerous.com claudette:s00pers3krit
Or you can set the credentials as an environment variable like this:
@@ -373,7 +373,7 @@ Or you can set the credentials as an environment variable like this:
For gems with a git source with HTTP(S) URL you can specify credentials like so:
- bundle config https://github.com/bundler/bundler.git username:password
+ bundle config set https://github.com/bundler/bundler.git username:password
Or you can set the credentials as an environment variable like so:
diff --git a/spec/bundler/cli_spec.rb b/spec/bundler/cli_spec.rb
index 03755257d5..e14442b25a 100644
--- a/spec/bundler/cli_spec.rb
+++ b/spec/bundler/cli_spec.rb
@@ -97,7 +97,7 @@ RSpec.describe "bundle executable" do
let(:bundler_version) { "1.1" }
let(:latest_version) { nil }
before do
- bundle! "config --global disable_version_check false"
+ bundle! "config set --global disable_version_check false"
simulate_bundler_version(bundler_version)
if latest_version
@@ -132,13 +132,13 @@ To install the latest version, run `gem install bundler`
end
context "and disable_version_check is set" do
- before { bundle! "config disable_version_check true" }
+ before { bundle! "config set disable_version_check true" }
include_examples "no warning"
end
context "running a parseable command" do
it "prints no warning" do
- bundle! "config --parseable foo"
+ bundle! "config get --parseable foo"
expect(last_command.stdboth).to eq ""
bundle "platform --ruby"
diff --git a/spec/bundler/dsl_spec.rb b/spec/bundler/dsl_spec.rb
index 89528eb745..ce0544a573 100644
--- a/spec/bundler/dsl_spec.rb
+++ b/spec/bundler/dsl_spec.rb
@@ -27,14 +27,14 @@ RSpec.describe Bundler::Dsl do
context "github_https feature flag" do
it "is true when github.https is true" do
- bundle "config github.https true"
+ bundle "config set github.https true"
expect(Bundler.feature_flag.github_https?).to eq "true"
end
end
context "default hosts (git, gist)", :bundler => "< 2" do
context "when github.https config is true" do
- before { bundle "config github.https true" }
+ before { bundle "config set github.https true" }
it "converts :github to :git using https" do
subject.gem("sparks", :github => "indirect/sparks")
github_uri = "https://github.com/indirect/sparks.git"
diff --git a/spec/bundler/source_list_spec.rb b/spec/bundler/source_list_spec.rb
index ce3353012c..729311421a 100644
--- a/spec/bundler/source_list_spec.rb
+++ b/spec/bundler/source_list_spec.rb
@@ -75,7 +75,7 @@ RSpec.describe Bundler::SourceList do
let(:msg) do
"The git source `git://existing-git.org/path.git` " \
"uses the `git` protocol, which transmits data without encryption. " \
- "Disable this warning with `bundle config git.allow_insecure true`, " \
+ "Disable this warning with `bundle config set git.allow_insecure true`, " \
"or switch to the `https` protocol to keep your data secure."
end
diff --git a/spec/cache/cache_path_spec.rb b/spec/cache/cache_path_spec.rb
index 69d3809964..a4572af11e 100644
--- a/spec/cache/cache_path_spec.rb
+++ b/spec/cache/cache_path_spec.rb
@@ -17,7 +17,7 @@ RSpec.describe "bundle package" do
context "with config cache_path" do
it "caches gems at given path" do
- bundle "config cache_path vendor/cache-foo"
+ bundle "config set cache_path vendor/cache-foo"
bundle :package
expect(bundled_app("vendor/cache-foo/rack-1.0.0.gem")).to exist
end
diff --git a/spec/commands/binstubs_spec.rb b/spec/commands/binstubs_spec.rb
index 9874a4d138..b958677876 100644
--- a/spec/commands/binstubs_spec.rb
+++ b/spec/commands/binstubs_spec.rb
@@ -414,7 +414,7 @@ RSpec.describe "bundle binstubs <gem>" do
gem "rack"
G
- bundle "config auto_install 1"
+ bundle "config set auto_install 1"
bundle "binstubs rack"
expect(out).to include("Installing rack 1.0.0")
expect(the_bundle).to include_gems "rack 1.0.0"
@@ -426,7 +426,7 @@ RSpec.describe "bundle binstubs <gem>" do
gem "rack"
G
- bundle "config auto_install 1"
+ bundle "config set auto_install 1"
bundle "binstubs rack", :env => { "BUNDLE_INSTALL" => 1 }
expect(out).not_to include("Installing rack 1.0.0")
end
diff --git a/spec/commands/clean_spec.rb b/spec/commands/clean_spec.rb
index f9c76fdfd0..5c4f1462ef 100644
--- a/spec/commands/clean_spec.rb
+++ b/spec/commands/clean_spec.rb
@@ -322,7 +322,7 @@ RSpec.describe "bundle clean" do
it "does not call clean automatically when using system gems" do
bundle! "config path.system true"
- bundle! :config
+ bundle! "config list"
install_gemfile! <<-G
source "file://#{gem_repo1}"
@@ -650,8 +650,6 @@ RSpec.describe "bundle clean" do
bundle :install
- bundle "configuration --delete path"
-
bundle "clean --dry-run"
expect(out).not_to include("Removing foo (1.0)")
@@ -671,7 +669,7 @@ RSpec.describe "bundle clean" do
G
bundle "install", forgotten_command_line_options(:path => "vendor/bundle", :clean => false)
- bundle "config dry_run false"
+ bundle "config set dry_run false"
gemfile <<-G
source "file://#{gem_repo1}"
diff --git a/spec/commands/config_spec.rb b/spec/commands/config_spec.rb
index 61734ef005..8b353a7427 100644
--- a/spec/commands/config_spec.rb
+++ b/spec/commands/config_spec.rb
@@ -2,10 +2,10 @@
RSpec.describe ".bundle/config" do
describe "config" do
- before { bundle "config foo bar" }
+ before { bundle "config set foo bar" }
it "prints a detailed report of local and user configuration" do
- bundle "config"
+ bundle "config list"
expect(out).to include("Settings are listed in order of priority. The top value will be used")
expect(out).to include("foo\nSet for the current user")
@@ -14,21 +14,21 @@ RSpec.describe ".bundle/config" do
context "given --parseable flag" do
it "prints a minimal report of local and user configuration" do
- bundle "config --parseable"
+ bundle "config list --parseable"
expect(out).to include("foo=bar")
end
context "with global config" do
it "prints config assigned to local scope" do
- bundle "config --local foo bar2"
- bundle "config --parseable"
+ bundle "config set --local foo bar2"
+ bundle "config list --parseable"
expect(out).to include("foo=bar2")
end
end
context "with env overwrite" do
it "prints config with env" do
- bundle "config --parseable", :env => { "BUNDLE_FOO" => "bar3" }
+ bundle "config list --parseable", :env => { "BUNDLE_FOO" => "bar3" }
expect(out).to include("foo=bar3")
end
end
@@ -74,21 +74,21 @@ RSpec.describe ".bundle/config" do
end
it "is the default" do
- bundle "config foo global"
+ bundle "config set foo global"
run "puts Bundler.settings[:foo]"
expect(out).to eq("global")
end
it "can also be set explicitly" do
- bundle! "config --global foo global"
+ bundle! "config set --global foo global"
run! "puts Bundler.settings[:foo]"
expect(out).to eq("global")
end
it "has lower precedence than local" do
- bundle "config --local foo local"
+ bundle "config set --local foo local"
- bundle "config --global foo global"
+ bundle "config set --global foo global"
expect(out).to match(/Your application has set foo to "local"/)
run "puts Bundler.settings[:foo]"
@@ -99,7 +99,7 @@ RSpec.describe ".bundle/config" do
begin
ENV["BUNDLE_FOO"] = "env"
- bundle "config --global foo global"
+ bundle "config set --global foo global"
expect(out).to match(/You have a bundler environment variable for foo set to "env"/)
run "puts Bundler.settings[:foo]"
@@ -110,16 +110,16 @@ RSpec.describe ".bundle/config" do
end
it "can be deleted" do
- bundle "config --global foo global"
- bundle "config --delete foo"
+ bundle "config set --global foo global"
+ bundle "config unset foo"
run "puts Bundler.settings[:foo] == nil"
expect(out).to eq("true")
end
it "warns when overriding" do
- bundle "config --global foo previous"
- bundle "config --global foo global"
+ bundle "config set --global foo previous"
+ bundle "config set --global foo global"
expect(out).to match(/You are replacing the current global value of foo/)
run "puts Bundler.settings[:foo]"
@@ -127,8 +127,8 @@ RSpec.describe ".bundle/config" do
end
it "does not warn when using the same value twice" do
- bundle "config --global foo value"
- bundle "config --global foo value"
+ bundle "config set --global foo value"
+ bundle "config set --global foo value"
expect(out).not_to match(/You are replacing the current global value of foo/)
run "puts Bundler.settings[:foo]"
@@ -136,22 +136,22 @@ RSpec.describe ".bundle/config" do
end
it "expands the path at time of setting" do
- bundle "config --global local.foo .."
+ bundle "config set --global local.foo .."
run "puts Bundler.settings['local.foo']"
expect(out).to eq(File.expand_path(Dir.pwd + "/.."))
end
it "saves with parseable option" do
- bundle "config --global --parseable foo value"
+ bundle "config set --global --parseable foo value"
expect(out).to eq("foo=value")
run "puts Bundler.settings['foo']"
expect(out).to eq("value")
end
context "when replacing a current value with the parseable flag" do
- before { bundle "config --global foo value" }
+ before { bundle "config set --global foo value" }
it "prints the current value in a parseable format" do
- bundle "config --global --parseable foo value2"
+ bundle "config set --global --parseable foo value2"
expect(out).to eq "foo=value2"
run "puts Bundler.settings['foo']"
expect(out).to eq("value2")
@@ -168,7 +168,7 @@ RSpec.describe ".bundle/config" do
end
it "can also be set explicitly" do
- bundle "config --local foo local"
+ bundle "config set --local foo local"
run "puts Bundler.settings[:foo]"
expect(out).to eq("local")
end
@@ -176,7 +176,7 @@ RSpec.describe ".bundle/config" do
it "has higher precedence than env" do
begin
ENV["BUNDLE_FOO"] = "env"
- bundle "config --local foo local"
+ bundle "config set --local foo local"
run "puts Bundler.settings[:foo]"
expect(out).to eq("local")
@@ -186,16 +186,16 @@ RSpec.describe ".bundle/config" do
end
it "can be deleted" do
- bundle "config --local foo local"
- bundle "config --delete foo"
+ bundle "config set --local foo local"
+ bundle "config unset foo"
run "puts Bundler.settings[:foo] == nil"
expect(out).to eq("true")
end
it "warns when overriding" do
- bundle "config --local foo previous"
- bundle "config --local foo local"
+ bundle "config set --local foo previous"
+ bundle "config set --local foo local"
expect(out).to match(/You are replacing the current local value of foo/)
run "puts Bundler.settings[:foo]"
@@ -203,14 +203,14 @@ RSpec.describe ".bundle/config" do
end
it "expands the path at time of setting" do
- bundle "config --local local.foo .."
+ bundle "config set --local local.foo .."
run "puts Bundler.settings['local.foo']"
expect(out).to eq(File.expand_path(Dir.pwd + "/.."))
end
it "can be deleted with parseable option" do
- bundle "config --local foo value"
- bundle "config --delete --parseable foo"
+ bundle "config set --local foo value"
+ bundle "config unset --parseable foo"
expect(out).to eq ""
run "puts Bundler.settings['foo'] == nil"
expect(out).to eq("true")
@@ -262,29 +262,29 @@ RSpec.describe ".bundle/config" do
describe "parseable option" do
it "prints an empty string" do
- bundle "config foo --parseable"
+ bundle "config get foo --parseable"
expect(out).to eq ""
end
it "only prints the value of the config" do
- bundle "config foo local"
- bundle "config foo --parseable"
+ bundle "config set foo local"
+ bundle "config get foo --parseable"
expect(out).to eq "foo=local"
end
it "can print global config" do
- bundle "config --global bar value"
- bundle "config bar --parseable"
+ bundle "config set --global bar value"
+ bundle "config get bar --parseable"
expect(out).to eq "bar=value"
end
it "prefers local config over global" do
- bundle "config --local bar value2"
- bundle "config --global bar value"
- bundle "config bar --parseable"
+ bundle "config set --local bar value2"
+ bundle "config set --global bar value"
+ bundle "config get bar --parseable"
expect(out).to eq "bar=value2"
end
@@ -299,7 +299,7 @@ RSpec.describe ".bundle/config" do
end
it "configures mirrors using keys with `mirror.`" do
- bundle "config --local mirror.http://gems.example.org http://gem-mirror.example.org"
+ bundle "config set --local mirror.http://gems.example.org http://gem-mirror.example.org"
run(<<-E)
Bundler.settings.gem_mirrors.each do |k, v|
puts "\#{k} => \#{v}"
@@ -317,13 +317,13 @@ E
end
it "saves quotes" do
- bundle "config foo something\\'"
+ bundle "config set foo something\\'"
run "puts Bundler.settings[:foo]"
expect(out).to eq("something'")
end
it "doesn't return quotes around values", :ruby => "1.9" do
- bundle "config foo '1'"
+ bundle "config set foo '1'"
run "puts Bundler.settings.send(:global_config_file).read"
expect(out).to include('"1"')
run "puts Bundler.settings[:foo]"
@@ -336,7 +336,7 @@ E
f.write 'BUNDLE_FOO: "$BUILD_DIR"'
end
- bundle "config bar baz"
+ bundle "config set bar baz"
run "puts Bundler.settings.send(:local_config_file).read"
# Starting in Ruby 2.1, YAML automatically adds double quotes
@@ -345,12 +345,12 @@ E
end
it "doesn't duplicate quotes around long wrapped values" do
- bundle "config foo #{long_string}"
+ bundle "config set foo #{long_string}"
run "puts Bundler.settings[:foo]"
expect(out).to eq(long_string)
- bundle "config bar baz"
+ bundle "config set bar baz"
run "puts Bundler.settings[:foo]"
expect(out).to eq(long_string)
@@ -376,13 +376,13 @@ E
end
it "doesn't wrap values" do
- bundle "config foo #{long_string}"
+ bundle "config set foo #{long_string}"
run "puts Bundler.settings[:foo]"
expect(out).to match(long_string)
end
it "can read wrapped unquoted values" do
- bundle "config foo #{long_string_without_special_characters}"
+ bundle "config set foo #{long_string_without_special_characters}"
run "puts Bundler.settings[:foo]"
expect(out).to match(long_string_without_special_characters)
end
@@ -485,7 +485,7 @@ RSpec.describe "setting gemfile via config" do
G
end
- bundle "config --local gemfile #{bundled_app("NotGemfile")}"
+ bundle "config set --local gemfile #{bundled_app("NotGemfile")}"
expect(File.exist?(".bundle/config")).to eq(true)
bundle "config"
diff --git a/spec/commands/console_spec.rb b/spec/commands/console_spec.rb
index 9bf66e8f5b..41fc56c919 100644
--- a/spec/commands/console_spec.rb
+++ b/spec/commands/console_spec.rb
@@ -31,7 +31,7 @@ RSpec.describe "bundle console", :bundler => "< 2" do
source "file://#{gem_repo1}"
gem "pry"
G
- bundle "config console pry"
+ bundle "config set console pry"
bundle "console" do |input, _, _|
input.puts("__method__")
@@ -41,7 +41,7 @@ RSpec.describe "bundle console", :bundler => "< 2" do
end
it "falls back to IRB if the other REPL isn't available" do
- bundle "config console pry"
+ bundle "config set console pry"
# make sure pry isn't there
bundle "console" do |input, _, _|
@@ -94,7 +94,7 @@ RSpec.describe "bundle console", :bundler => "< 2" do
gem "foo"
G
- bundle "config auto_install 1"
+ bundle "config set auto_install 1"
bundle :console do |input, _, _|
input.puts("puts 'hello'")
input.puts("exit")
diff --git a/spec/commands/exec_spec.rb b/spec/commands/exec_spec.rb
index aaba8f2777..9e5b840d9b 100644
--- a/spec/commands/exec_spec.rb
+++ b/spec/commands/exec_spec.rb
@@ -438,7 +438,7 @@ RSpec.describe "bundle exec" do
gem "foo"
G
- bundle "config auto_install 1"
+ bundle "config set auto_install 1"
bundle "exec rackup"
expect(out).to include("Installing foo 1.0")
end
@@ -684,7 +684,7 @@ The source contains 'rack' at: 1.0.0\e[0m
let(:process) { "PROCESS: ruby #{path} arg1 arg2" }
before do
- bundle "config disable_exec_load true"
+ bundle "config set disable_exec_load true"
end
it_behaves_like "it runs"
diff --git a/spec/commands/init_spec.rb b/spec/commands/init_spec.rb
index 9af911ba3f..3685cd9c36 100644
--- a/spec/commands/init_spec.rb
+++ b/spec/commands/init_spec.rb
@@ -144,7 +144,7 @@ RSpec.describe "bundle init" do
end
context "when init_gems_rb setting is enabled" do
- before { bundle "config init_gems_rb true" }
+ before { bundle "config set init_gems_rb true" }
context "given --gemspec option", :bundler => "< 2" do
let(:spec_file) { tmp.join("test.gemspec") }
diff --git a/spec/commands/licenses_spec.rb b/spec/commands/licenses_spec.rb
index 4b96c6c7e2..21fd8eaf2f 100644
--- a/spec/commands/licenses_spec.rb
+++ b/spec/commands/licenses_spec.rb
@@ -24,7 +24,7 @@ RSpec.describe "bundle licenses" do
gem "foo"
G
- bundle "config auto_install 1"
+ bundle "config set auto_install 1"
bundle :licenses
expect(out).to include("Installing foo 1.0")
end
diff --git a/spec/commands/newgem_spec.rb b/spec/commands/newgem_spec.rb
index b95cdd528e..08dca15185 100644
--- a/spec/commands/newgem_spec.rb
+++ b/spec/commands/newgem_spec.rb
@@ -399,7 +399,7 @@ RSpec.describe "bundle gem" do
before do
reset!
in_app_root
- bundle "config gem.test rspec"
+ bundle "config set gem.test rspec"
bundle "gem #{gem_name}"
end
@@ -414,7 +414,7 @@ RSpec.describe "bundle gem" do
before do
reset!
in_app_root
- bundle "config gem.test rspec"
+ bundle "config set gem.test rspec"
bundle "gem #{gem_name} --test=minitest"
end
@@ -458,7 +458,7 @@ RSpec.describe "bundle gem" do
before do
reset!
in_app_root
- bundle "config gem.test minitest"
+ bundle "config set gem.test minitest"
bundle "gem #{gem_name}"
end
@@ -850,7 +850,7 @@ Usage: "bundle gem NAME [OPTIONS]"
it "asks about MIT license" do
global_config "BUNDLE_GEM__TEST" => "false", "BUNDLE_GEM__COC" => "false"
- bundle :config
+ bundle "config list"
bundle "gem foobar" do |input, _, _|
input.puts "yes"
diff --git a/spec/commands/open_spec.rb b/spec/commands/open_spec.rb
index ae288b4b9c..659445da33 100644
--- a/spec/commands/open_spec.rb
+++ b/spec/commands/open_spec.rb
@@ -80,7 +80,7 @@ RSpec.describe "bundle open" do
gem "foo"
G
- bundle "config auto_install 1"
+ bundle "config set auto_install 1"
bundle "open rails", :env => { "EDITOR" => "echo editor", "VISUAL" => "", "BUNDLER_EDITOR" => "" }
expect(out).to include("Installing foo 1.0")
end
diff --git a/spec/commands/outdated_spec.rb b/spec/commands/outdated_spec.rb
index ce4cbe3a1d..25ac263f12 100644
--- a/spec/commands/outdated_spec.rb
+++ b/spec/commands/outdated_spec.rb
@@ -441,7 +441,7 @@ RSpec.describe "bundle outdated" do
end
end
- context "after bundle config deployment true" do
+ context "after bundle config set deployment true" do
before do
install_gemfile <<-G
source "file://#{gem_repo2}"
@@ -449,7 +449,7 @@ RSpec.describe "bundle outdated" do
gem "rack"
gem "foo"
G
- bundle! "config deployment true"
+ bundle! "config set deployment true"
end
it "outputs a helpful message about being in deployment mode" do
@@ -460,7 +460,7 @@ RSpec.describe "bundle outdated" do
expect(err).to include("You are trying to check outdated gems in deployment mode.")
expect(err).to include("Run `bundle outdated` elsewhere.")
expect(err).to include("If this is a development machine, remove the ")
- expect(err).to include("Gemfile freeze\nby running `bundle config --delete deployment`.")
+ expect(err).to include("Gemfile freeze\nby running `bundle config unset deployment`.")
end
end
diff --git a/spec/commands/pristine_spec.rb b/spec/commands/pristine_spec.rb
index f622797586..d747fb9844 100644
--- a/spec/commands/pristine_spec.rb
+++ b/spec/commands/pristine_spec.rb
@@ -153,7 +153,7 @@ RSpec.describe "bundle pristine", :ruby_repo do
let(:very_simple_binary) { Bundler.definition.specs["very_simple_binary"].first }
let(:c_ext_dir) { Pathname.new(very_simple_binary.full_gem_path).join("ext") }
let(:build_opt) { "--with-ext-lib=#{c_ext_dir}" }
- before { bundle "config build.very_simple_binary -- #{build_opt}" }
+ before { bundle "config set build.very_simple_binary -- #{build_opt}" }
# This just verifies that the generated Makefile from the c_ext gem makes
# use of the build_args from the bundle config
@@ -170,7 +170,7 @@ RSpec.describe "bundle pristine", :ruby_repo do
let(:git_with_ext) { Bundler.definition.specs["git_with_ext"].first }
let(:c_ext_dir) { Pathname.new(git_with_ext.full_gem_path).join("ext") }
let(:build_opt) { "--with-ext-lib=#{c_ext_dir}" }
- before { bundle "config build.git_with_ext -- #{build_opt}" }
+ before { bundle "config set build.git_with_ext -- #{build_opt}" }
# This just verifies that the generated Makefile from the c_ext gem makes
# use of the build_args from the bundle config
diff --git a/spec/commands/show_spec.rb b/spec/commands/show_spec.rb
index 8f027c5739..08b106d0a0 100644
--- a/spec/commands/show_spec.rb
+++ b/spec/commands/show_spec.rb
@@ -167,7 +167,7 @@ RSpec.describe "bundle show" do
gem "foo"
G
- bundle "config auto_install 1"
+ bundle "config set auto_install 1"
bundle :show
expect(out).to include("Installing foo 1.0")
end
diff --git a/spec/commands/update_spec.rb b/spec/commands/update_spec.rb
index 7b8cc9f396..25e4401e7b 100644
--- a/spec/commands/update_spec.rb
+++ b/spec/commands/update_spec.rb
@@ -293,14 +293,14 @@ RSpec.describe "bundle update" do
bundle! "config --global frozen 1"
bundle "update", :all => bundle_update_requires_all?
expect(out).to match(/You are trying to install in deployment mode after changing.your Gemfile/m).
- and match(/freeze \nby running `bundle config --delete frozen`./m)
+ and match(/freeze \nby running `bundle config unset frozen`./m)
end
it "should suggest different command when frozen is set globally", :bundler => "2" do
bundle! "config --global deployment true"
bundle "update", :all => bundle_update_requires_all?
expect(err).to match(/You are trying to install in deployment mode after changing.your Gemfile/m).
- and match(/freeze \nby running `bundle config --delete deployment`./m)
+ and match(/freeze \nby running `bundle config unset deployment`./m)
end
end
diff --git a/spec/install/allow_offline_install_spec.rb b/spec/install/allow_offline_install_spec.rb
index 89c641911b..4c6d77d6f3 100644
--- a/spec/install/allow_offline_install_spec.rb
+++ b/spec/install/allow_offline_install_spec.rb
@@ -2,7 +2,7 @@
RSpec.describe "bundle install with :allow_offline_install" do
before do
- bundle "config allow_offline_install true"
+ bundle "config set allow_offline_install true"
end
context "with no cached data locally" do
diff --git a/spec/install/gemfile/git_spec.rb b/spec/install/gemfile/git_spec.rb
index cd8e0f906e..cf98f1c2c3 100644
--- a/spec/install/gemfile/git_spec.rb
+++ b/spec/install/gemfile/git_spec.rb
@@ -497,7 +497,7 @@ RSpec.describe "bundle install with git sources" do
expect(lockfile1).not_to eq(lockfile0)
end
- it "explodes if given path does not exist on install" do
+ it "explodes and gives correct solution if given path does not exist on install" do
build_git "rack", "0.8"
install_gemfile <<-G
@@ -508,9 +508,17 @@ RSpec.describe "bundle install with git sources" do
bundle %(config local.rack #{lib_path("local-rack")})
bundle :install
expect(err).to match(/Cannot use local override for rack-0.8 because #{Regexp.escape(lib_path('local-rack').to_s)} does not exist/)
+
+ solution = "config unset local.rack"
+ expect(err).to match(/Run `bundle #{solution}` to remove the local override/)
+
+ bundle solution
+ bundle :install
+
+ expect(last_command.stderr).to be_empty
end
- it "explodes if branch is not given on install" do
+ it "explodes and gives correct solution if branch is not given on install" do
build_git "rack", "0.8"
FileUtils.cp_r("#{lib_path("rack-0.8")}/.", lib_path("local-rack"))
@@ -521,7 +529,15 @@ RSpec.describe "bundle install with git sources" do
bundle %(config local.rack #{lib_path("local-rack")})
bundle :install
- expect(err).to match(/cannot use local override/i)
+ expect(err).to match(/Cannot use local override for rack-0.8 at #{Regexp.escape(lib_path('local-rack').to_s)} because :branch is not specified in Gemfile/)
+
+ solution = "config unset local.rack"
+ expect(err).to match(/Specify a branch or run `bundle #{solution}` to remove the local override/)
+
+ bundle solution
+ bundle :install
+
+ expect(last_command.stderr).to be_empty
end
it "does not explode if disable_local_branch_check is given" do
diff --git a/spec/install/gemfile/platform_spec.rb b/spec/install/gemfile/platform_spec.rb
index 1ea60992fe..f157e9b263 100644
--- a/spec/install/gemfile/platform_spec.rb
+++ b/spec/install/gemfile/platform_spec.rb
@@ -250,7 +250,7 @@ RSpec.describe "bundle install across platforms" do
expect(out).to include "Unable to use the platform-specific (universal-darwin) version of facter (2.4.6) " \
"because it has different dependencies from the ruby version. " \
- "To use the platform-specific version of the gem, run `bundle config specific_platform true` and install again."
+ "To use the platform-specific version of the gem, run `bundle config set specific_platform true` and install again."
expect(the_bundle).to include_gem "facter 2.4.6"
expect(the_bundle).not_to include_gem "CFPropertyList"
diff --git a/spec/install/gemfile/sources_spec.rb b/spec/install/gemfile/sources_spec.rb
index f659f1afe5..0af77cf862 100644
--- a/spec/install/gemfile/sources_spec.rb
+++ b/spec/install/gemfile/sources_spec.rb
@@ -25,7 +25,7 @@ RSpec.describe "bundle install with gems on multiple sources" do
gem "rack-obama"
gem "rack"
G
- bundle "config major_deprecations true"
+ bundle "config set major_deprecations true"
end
it "warns about ambiguous gems, but installs anyway, prioritizing sources last to first", :bundler => "< 2" do
@@ -38,7 +38,7 @@ RSpec.describe "bundle install with gems on multiple sources" do
end
it "errors when disable_multisource is set" do
- bundle "config disable_multisource true"
+ bundle "config set disable_multisource true"
bundle :install
expect(err).to include("Each source after the first must include a block")
expect(exitstatus).to eq(4) if exitstatus
@@ -55,7 +55,7 @@ RSpec.describe "bundle install with gems on multiple sources" do
gem "rack-obama"
gem "rack", "1.0.0" # force it to install the working version in repo1
G
- bundle "config major_deprecations true"
+ bundle "config set major_deprecations true"
end
it "warns about ambiguous gems, but installs anyway", :bundler => "< 2" do
@@ -249,7 +249,7 @@ RSpec.describe "bundle install with gems on multiple sources" do
end
it "installs from the other source and warns about ambiguous gems", :bundler => "< 2" do
- bundle "config major_deprecations true"
+ bundle "config set major_deprecations true"
bundle :install
expect(out).to have_major_deprecation a_string_including("Your Gemfile contains multiple primary sources.")
expect(out).to include("Warning: the gem 'rack' was found in multiple sources.")
diff --git a/spec/install/gemfile/specific_platform_spec.rb b/spec/install/gemfile/specific_platform_spec.rb
index 9c725416d5..2c482b7ad4 100644
--- a/spec/install/gemfile/specific_platform_spec.rb
+++ b/spec/install/gemfile/specific_platform_spec.rb
@@ -2,7 +2,7 @@
RSpec.describe "bundle install with specific_platform enabled" do
before do
- bundle "config specific_platform true"
+ bundle "config set specific_platform true"
build_repo2 do
build_gem("google-protobuf", "3.0.0.alpha.5.0.5.1")
diff --git a/spec/install/gemfile_spec.rb b/spec/install/gemfile_spec.rb
index 63dddc490b..9306b625db 100644
--- a/spec/install/gemfile_spec.rb
+++ b/spec/install/gemfile_spec.rb
@@ -35,7 +35,7 @@ RSpec.describe "bundle install" do
gem 'rack'
G
- bundle "config --local gemfile #{bundled_app("NotGemfile")}"
+ bundle "config set --local gemfile #{bundled_app("NotGemfile")}"
end
it "uses the gemfile to install" do
bundle "install"
diff --git a/spec/install/gems/compact_index_spec.rb b/spec/install/gems/compact_index_spec.rb
index 99e5ed086d..9d6ba770be 100644
--- a/spec/install/gems/compact_index_spec.rb
+++ b/spec/install/gems/compact_index_spec.rb
@@ -652,7 +652,7 @@ The checksum of /versions does not match the checksum provided by the server! So
end
it "reads authentication details by host name from bundle config" do
- bundle "config #{source_hostname} #{user}:#{password}"
+ bundle "config set #{source_hostname} #{user}:#{password}"
bundle! :install, :artifice => "compact_index_strict_basic_authentication"
@@ -662,7 +662,7 @@ The checksum of /versions does not match the checksum provided by the server! So
it "reads authentication details by full url from bundle config" do
# The trailing slash is necessary here; Fetcher canonicalizes the URI.
- bundle "config #{source_uri}/ #{user}:#{password}"
+ bundle "config set #{source_uri}/ #{user}:#{password}"
bundle! :install, :artifice => "compact_index_strict_basic_authentication"
@@ -671,7 +671,7 @@ The checksum of /versions does not match the checksum provided by the server! So
end
it "should use the API" do
- bundle "config #{source_hostname} #{user}:#{password}"
+ bundle "config set #{source_hostname} #{user}:#{password}"
bundle! :install, :artifice => "compact_index_strict_basic_authentication"
expect(out).to include("Fetching gem metadata from #{source_uri}")
expect(the_bundle).to include_gems "rack 1.0.0"
@@ -683,7 +683,7 @@ The checksum of /versions does not match the checksum provided by the server! So
gem "rack"
G
- bundle "config #{source_hostname} otheruser:wrong"
+ bundle "config set #{source_hostname} otheruser:wrong"
bundle! :install, :artifice => "compact_index_strict_basic_authentication"
expect(the_bundle).to include_gems "rack 1.0.0"
@@ -691,11 +691,11 @@ The checksum of /versions does not match the checksum provided by the server! So
it "shows instructions if auth is not provided for the source" do
bundle :install, :artifice => "compact_index_strict_basic_authentication"
- expect(err).to include("bundle config #{source_hostname} username:password")
+ expect(err).to include("bundle config set #{source_hostname} username:password")
end
it "fails if authentication has already been provided, but failed" do
- bundle "config #{source_hostname} #{user}:wrong"
+ bundle "config set #{source_hostname} #{user}:wrong"
bundle :install, :artifice => "compact_index_strict_basic_authentication"
expect(err).to include("Bad username or password")
@@ -879,7 +879,7 @@ The checksum of /versions does not match the checksum provided by the server! So
and include("1. delete the downloaded gem located at: `#{default_bundle_path}/gems/rack-1.0.0/rack-1.0.0.gem`").
and include("2. run `bundle install`").
and include("If you wish to continue installing the downloaded gem, and are certain it does not pose a security issue despite the mismatching checksum, do the following:").
- and include("1. run `bundle config disable_checksum_validation true` to turn off checksum verification").
+ and include("1. run `bundle config set disable_checksum_validation true` to turn off checksum verification").
and include("2. run `bundle install`").
and match(/\(More info: The expected SHA256 checksum was "#{"ab" * 22}", but the checksum for the downloaded gem was ".+?"\.\)/)
end
diff --git a/spec/install/gems/dependency_api_spec.rb b/spec/install/gems/dependency_api_spec.rb
index 1511f90626..f4b218849c 100644
--- a/spec/install/gems/dependency_api_spec.rb
+++ b/spec/install/gems/dependency_api_spec.rb
@@ -626,7 +626,7 @@ RSpec.describe "gemcutter's dependency API" do
end
it "reads authentication details by host name from bundle config" do
- bundle "config #{source_hostname} #{user}:#{password}"
+ bundle "config set #{source_hostname} #{user}:#{password}"
bundle :install, :artifice => "endpoint_strict_basic_authentication"
@@ -636,7 +636,7 @@ RSpec.describe "gemcutter's dependency API" do
it "reads authentication details by full url from bundle config" do
# The trailing slash is necessary here; Fetcher canonicalizes the URI.
- bundle "config #{source_uri}/ #{user}:#{password}"
+ bundle "config set #{source_uri}/ #{user}:#{password}"
bundle :install, :artifice => "endpoint_strict_basic_authentication"
@@ -645,7 +645,7 @@ RSpec.describe "gemcutter's dependency API" do
end
it "should use the API" do
- bundle "config #{source_hostname} #{user}:#{password}"
+ bundle "config set #{source_hostname} #{user}:#{password}"
bundle :install, :artifice => "endpoint_strict_basic_authentication"
expect(out).to include("Fetching gem metadata from #{source_uri}")
expect(the_bundle).to include_gems "rack 1.0.0"
@@ -657,7 +657,7 @@ RSpec.describe "gemcutter's dependency API" do
gem "rack"
G
- bundle "config #{source_hostname} otheruser:wrong"
+ bundle "config set #{source_hostname} otheruser:wrong"
bundle :install, :artifice => "endpoint_strict_basic_authentication"
expect(the_bundle).to include_gems "rack 1.0.0"
@@ -665,11 +665,11 @@ RSpec.describe "gemcutter's dependency API" do
it "shows instructions if auth is not provided for the source" do
bundle :install, :artifice => "endpoint_strict_basic_authentication"
- expect(err).to include("bundle config #{source_hostname} username:password")
+ expect(err).to include("bundle config set #{source_hostname} username:password")
end
it "fails if authentication has already been provided, but failed" do
- bundle "config #{source_hostname} #{user}:wrong"
+ bundle "config set #{source_hostname} #{user}:wrong"
bundle :install, :artifice => "endpoint_strict_basic_authentication"
expect(err).to include("Bad username or password")
diff --git a/spec/install/gems/mirror_spec.rb b/spec/install/gems/mirror_spec.rb
index 4c35b8f206..ffa6116127 100644
--- a/spec/install/gems/mirror_spec.rb
+++ b/spec/install/gems/mirror_spec.rb
@@ -8,7 +8,7 @@ RSpec.describe "bundle install with a mirror configured" do
gem "rack"
G
- bundle "config --local mirror.http://gems.example.org http://gem-mirror.example.org"
+ bundle "config set --local mirror.http://gems.example.org http://gem-mirror.example.org"
end
it "installs from the normal location" do
@@ -26,7 +26,7 @@ RSpec.describe "bundle install with a mirror configured" do
gem "rack"
G
- bundle "config --local mirror.file://localhost#{gem_repo2} file://localhost#{gem_repo1}"
+ bundle "config set --local mirror.file://localhost#{gem_repo2} file://localhost#{gem_repo1}"
end
it "installs the gem from the mirror" do
diff --git a/spec/install/gems/native_extensions_spec.rb b/spec/install/gems/native_extensions_spec.rb
index ea616f60d3..7a43252f84 100644
--- a/spec/install/gems/native_extensions_spec.rb
+++ b/spec/install/gems/native_extensions_spec.rb
@@ -37,7 +37,7 @@ RSpec.describe "installing a gem with native extensions", :ruby_repo do
gem "c_extension"
G
- bundle "config build.c_extension --with-c_extension=hello"
+ bundle "config set build.c_extension --with-c_extension=hello"
bundle "install"
expect(out).not_to include("extconf.rb failed")
diff --git a/spec/install/gems/post_install_spec.rb b/spec/install/gems/post_install_spec.rb
index c6e348fb65..a6894fbc14 100644
--- a/spec/install/gems/post_install_spec.rb
+++ b/spec/install/gems/post_install_spec.rb
@@ -127,7 +127,7 @@ RSpec.describe "bundle install" do
gem "rack"
G
- bundle "config ignore_messages.rack true"
+ bundle "config set ignore_messages.rack true"
bundle :install
expect(out).not_to include("Post-install message")
@@ -141,7 +141,7 @@ RSpec.describe "bundle install" do
gem "rack"
G
- bundle "config ignore_messages true"
+ bundle "config set ignore_messages true"
bundle :install
expect(out).not_to include("Post-install message")
diff --git a/spec/lock/lockfile_bundler_1_spec.rb b/spec/lock/lockfile_bundler_1_spec.rb
index 0e89645503..36cdb6d557 100644
--- a/spec/lock/lockfile_bundler_1_spec.rb
+++ b/spec/lock/lockfile_bundler_1_spec.rb
@@ -365,7 +365,7 @@ RSpec.describe "the lockfile format", :bundler => "< 2" do
end
it "generates a lockfile wihout credentials for a configured source" do
- bundle "config http://localgemserver.test/ user:pass"
+ bundle "config set http://localgemserver.test/ user:pass"
install_gemfile(<<-G, :artifice => "endpoint_strict_basic_authentication", :quiet => true)
source "http://localgemserver.test/"
diff --git a/spec/lock/lockfile_spec.rb b/spec/lock/lockfile_spec.rb
index a77ce83f9f..28ea54dc45 100644
--- a/spec/lock/lockfile_spec.rb
+++ b/spec/lock/lockfile_spec.rb
@@ -363,7 +363,7 @@ RSpec.describe "the lockfile format", :bundler => "2" do
end
it "generates a lockfile without credentials for a configured source" do
- bundle "config http://localgemserver.test/ user:pass"
+ bundle "config set http://localgemserver.test/ user:pass"
install_gemfile(<<-G, :artifice => "endpoint_strict_basic_authentication", :quiet => true)
source "http://localgemserver.test/" do
diff --git a/spec/other/major_deprecation_spec.rb b/spec/other/major_deprecation_spec.rb
index e8de574c79..800c7b4b88 100644
--- a/spec/other/major_deprecation_spec.rb
+++ b/spec/other/major_deprecation_spec.rb
@@ -7,7 +7,7 @@ RSpec.describe "major deprecations", :bundler => "< 2" do
context "in a .99 version" do
before do
simulate_bundler_version "1.99.1"
- bundle "config --delete major_deprecations"
+ bundle "config unset major_deprecations"
end
it "prints major deprecations without being configured" do
@@ -21,7 +21,7 @@ RSpec.describe "major deprecations", :bundler => "< 2" do
end
before do
- bundle "config major_deprecations true"
+ bundle "config set major_deprecations true"
create_file "gems.rb", <<-G
source "file:#{gem_repo1}"
diff --git a/spec/realworld/gemfile_source_header_spec.rb b/spec/realworld/gemfile_source_header_spec.rb
index 59c1916874..4ef7aef07b 100644
--- a/spec/realworld/gemfile_source_header_spec.rb
+++ b/spec/realworld/gemfile_source_header_spec.rb
@@ -8,7 +8,7 @@ RSpec.describe "fetching dependencies with a mirrored source", :realworld => tru
before do
setup_server
- bundle "config --local mirror.#{mirror} #{original}"
+ bundle "config set --local mirror.#{mirror} #{original}"
end
after do
diff --git a/spec/runtime/with_unbundled_env_spec.rb b/spec/runtime/with_unbundled_env_spec.rb
index af608e007c..5ddcc24ed4 100644
--- a/spec/runtime/with_unbundled_env_spec.rb
+++ b/spec/runtime/with_unbundled_env_spec.rb
@@ -7,7 +7,7 @@ RSpec.describe "Bundler.with_env helpers" do
end
def build_bundler_context
- bundle "config path vendor/bundle"
+ bundle "config set path vendor/bundle"
gemfile ""
bundle "install"
end
diff --git a/spec/support/helpers.rb b/spec/support/helpers.rb
index e9138728fc..9be5955ac3 100644
--- a/spec/support/helpers.rb
+++ b/spec/support/helpers.rb
@@ -161,9 +161,9 @@ module Spec
return Hash[options] if remembered
options.each do |k, v|
if v.nil?
- bundle! "config --delete #{k}"
+ bundle! "config unset #{k}"
else
- bundle! "config --local #{k} #{v}"
+ bundle! "config set --local #{k} #{v}"
end
end
{}
diff --git a/spec/update/gemfile_spec.rb b/spec/update/gemfile_spec.rb
index f59f3a2d32..6bab457a76 100644
--- a/spec/update/gemfile_spec.rb
+++ b/spec/update/gemfile_spec.rb
@@ -25,7 +25,7 @@ RSpec.describe "bundle update" do
gem 'rack'
G
- bundle "config --local gemfile #{bundled_app("NotGemfile")}"
+ bundle "config set --local gemfile #{bundled_app("NotGemfile")}"
bundle! :install
end