summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBundlerbot <bot@bundler.io>2019-03-29 04:02:39 +0000
committerBundlerbot <bot@bundler.io>2019-03-29 04:02:39 +0000
commit91912a1da92a5c1d0c6c29b03f35ed4fc024021f (patch)
tree459536e32f594e1980dacbc70c188669da7ee344
parent148f038b781eaf4695b86d760852b23d515b44cb (diff)
parent46a4ee77f555d9d12b76eecc82f5c53305a4e798 (diff)
downloadbundler-91912a1da92a5c1d0c6c29b03f35ed4fc024021f.tar.gz
Merge #7078
7078: Allow `update` to install when `--no-install` used r=colby-swandale a=deivid-rodriguez Fixes #7077. ### What was the end-user problem that led to this PR? The problem was #7077. When the `no_install` configuration is activated, this prevents `bundle update` from installing gems, but `no_install` is only meant to affect `bundle package`. ### What was your diagnosis of the problem? My diagnosis was that `bundle update` needs to ignore this setting. ### What is your fix for the problem, implemented in this PR? My fix is to the same `bundle install` does to fix this problem. ### Why did you choose this fix out of the possible options? I chose this fix because it's the most straightforward solution, although the handling of this flag could probably use some refactoring. Co-authored-by: David Rodríguez <deivid.rodriguez@riseup.net>
-rw-r--r--lib/bundler/cli.rb4
-rw-r--r--spec/commands/package_spec.rb12
2 files changed, 15 insertions, 1 deletions
diff --git a/lib/bundler/cli.rb b/lib/bundler/cli.rb
index 3276fac681..00ee591731 100644
--- a/lib/bundler/cli.rb
+++ b/lib/bundler/cli.rb
@@ -277,7 +277,9 @@ module Bundler
def update(*gems)
SharedHelpers.major_deprecation(2, "The `--force` option has been renamed to `--redownload`") if ARGV.include?("--force")
require "bundler/cli/update"
- Update.new(options, gems).run
+ Bundler.settings.temporary(:no_install => false) do
+ Update.new(options, gems).run
+ end
end
desc "show GEM [OPTIONS]", "Shows all gems that are part of the bundle, or the path to a given gem"
diff --git a/spec/commands/package_spec.rb b/spec/commands/package_spec.rb
index db8a96005c..7c0c6a86bd 100644
--- a/spec/commands/package_spec.rb
+++ b/spec/commands/package_spec.rb
@@ -179,6 +179,18 @@ RSpec.describe "bundle package" do
expect(the_bundle).to include_gems "rack 1.0.0"
end
+
+ it "does not prevent installing gems with bundle update" do
+ gemfile <<-D
+ source "file://#{gem_repo1}"
+ gem "rack", "1.0.0"
+ D
+
+ bundle! "package --no-install"
+ bundle! "update"
+
+ expect(the_bundle).to include_gems "rack 1.0.0"
+ end
end
context "with --all-platforms" do