summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHomu <homu@barosl.com>2016-02-25 15:10:15 +0900
committerHomu <homu@barosl.com>2016-02-25 15:10:15 +0900
commit64e8b55515ac3e090f9a2a39091e398f5b750672 (patch)
tree4a1b4614d1f83c43d6d31fdf84c0593bea55c73e
parent5eab4722511d53bd53d1e9a55cb7a4535c0365ee (diff)
parent13e4cc6c8e498ae5daae4862e604e1ca9966544e (diff)
downloadbundler-64e8b55515ac3e090f9a2a39091e398f5b750672.tar.gz
Auto merge of #4308 - bundler:seg-bundle-no-install, r=indirect
[CLI] Ensure `bundle install` will always install Closes #3966.
-rw-r--r--lib/bundler/cli.rb4
-rw-r--r--lib/bundler/settings.rb2
-rw-r--r--spec/commands/package_spec.rb12
3 files changed, 17 insertions, 1 deletions
diff --git a/lib/bundler/cli.rb b/lib/bundler/cli.rb
index 015892ea29..0bd82fd128 100644
--- a/lib/bundler/cli.rb
+++ b/lib/bundler/cli.rb
@@ -170,7 +170,11 @@ module Bundler
map "i" => "install"
def install
require "bundler/cli/install"
+ no_install = Bundler.settings[:no_install]
+ Bundler.settings[:no_install] = false
Install.new(options.dup).run
+ ensure
+ Bundler.settings[:no_install] = no_install
end
desc "update [OPTIONS]", "update the current environment"
diff --git a/lib/bundler/settings.rb b/lib/bundler/settings.rb
index 634d9dc14a..175c9a76db 100644
--- a/lib/bundler/settings.rb
+++ b/lib/bundler/settings.rb
@@ -3,7 +3,7 @@ require "uri"
module Bundler
class Settings
- BOOL_KEYS = %w(frozen cache_all no_prune disable_local_branch_check disable_shared_gems ignore_messages gem.mit gem.coc silence_root_warning).freeze
+ BOOL_KEYS = %w(frozen cache_all no_prune disable_local_branch_check disable_shared_gems ignore_messages gem.mit gem.coc silence_root_warning no_install).freeze
NUMBER_KEYS = %w(retry timeout redirect ssl_verify_mode).freeze
DEFAULT_CONFIG = { :retry => 3, :timeout => 10, :redirect => 5 }.freeze
diff --git a/spec/commands/package_spec.rb b/spec/commands/package_spec.rb
index 9d88e4467c..08b36b1e9d 100644
--- a/spec/commands/package_spec.rb
+++ b/spec/commands/package_spec.rb
@@ -88,6 +88,18 @@ describe "bundle package" do
should_not_be_installed "rack 1.0.0", :expect_err => true
expect(bundled_app("vendor/cache/rack-1.0.0.gem")).to exist
end
+
+ it "does not prevent installing gems with bundle install" do
+ gemfile <<-D
+ source "file://#{gem_repo1}"
+ gem 'rack'
+ D
+
+ bundle "package --no-install"
+ bundle "install"
+
+ should_be_installed "rack 1.0.0"
+ end
end
context "with --all-platforms" do