aboutsummaryrefslogtreecommitdiffstats
path: root/lib/bundler/cli/lock.rb
diff options
context:
space:
mode:
authorchrismo <chrismo@clabs.org>2016-09-13 19:09:53 -0500
committerchrismo <chrismo@clabs.org>2016-10-21 00:26:27 -0500
commitad80a9238f4e98e73a9978ca747c4d24fddc7767 (patch)
tree1ee90f46a5a76424206bb63790479dbf711994cf /lib/bundler/cli/lock.rb
parent7327dc59476c79547170d3ef8162f24b3aea385f (diff)
downloadbundler-ad80a9238f4e98e73a9978ca747c4d24fddc7767.tar.gz
Add bundle install conservative updating to update
In the discussion on new 1.13 Conservative Bundle Updates (see https://github.com/bundler/bundler-features/issues/122), some users would like to have the same Conservative Updating (see http://bundler.io/v1.12/man/bundle-install.1.html#CONSERVATIVE-UPDATING) behavior available in `bundle install` when a declared dependency is altered in the Gemfile, also available in the `bundle update` command. This adds a new option called `--conservative` to both `bundle update` and `bundle lock`. The option only applies on `bundle lock` if the `--update` option is in use. The internal flag is more descriptive as to what actually takes place: It locks any shared dependencies from the gem(s) being updated. This also promotes the previously added patch level options to being shown in command-line help, anticipating a 1.14 release, to make these public and documented.
Diffstat (limited to 'lib/bundler/cli/lock.rb')
-rw-r--r--lib/bundler/cli/lock.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/bundler/cli/lock.rb b/lib/bundler/cli/lock.rb
index eb47c9ef..225a07aa 100644
--- a/lib/bundler/cli/lock.rb
+++ b/lib/bundler/cli/lock.rb
@@ -22,7 +22,7 @@ module Bundler
Bundler::Fetcher.disable_endpoint = options["full-index"]
update = options[:update]
- update = { :gems => update } if update.is_a?(Array)
+ update = { :gems => update, :lock_shared_dependencies => options[:conservative] } if update.is_a?(Array)
definition = Bundler.definition(update)
Bundler::CLI::Common.config_gem_version_promoter(Bundler.definition, options) if options[:update]