diff options
author | Alyssa Ross <hi@alyssa.is> | 2019-01-21 12:10:53 +0000 |
---|---|---|
committer | git <svn-admin@ruby-lang.org> | 2022-12-18 19:17:42 +0000 |
commit | d4315284e9382caf264e66ecf890f5a45d85c5e3 (patch) | |
tree | aac7258c7c31b33e04ab2bfa4f37db0d591cbddb /lib | |
parent | ede7c035d58a3384b684051647aa56f258ecc286 (diff) |
[rubygems/rubygems] Add bundle lock --update --bundler
bundle lock --update can do everything that bundle update can do, but
it doesn't actually install gems. This is especially useful for
generating a lockfile on a machine that doesn't have the libraries
available to be able to build native extensions.
But, there was no parallel for bundle update --bundler. So let's add
one.
https://github.com/rubygems/rubygems/commit/7fc00bd2a5
Diffstat (limited to 'lib')
-rw-r--r-- | lib/bundler/cli.rb | 2 | ||||
-rw-r--r-- | lib/bundler/cli/lock.rb | 7 |
2 files changed, 7 insertions, 2 deletions
diff --git a/lib/bundler/cli.rb b/lib/bundler/cli.rb index c5edfadd37..18cef045a2 100644 --- a/lib/bundler/cli.rb +++ b/lib/bundler/cli.rb @@ -672,6 +672,8 @@ module Bundler "If updating, do not allow any gem to be updated past latest --patch | --minor | --major" method_option "conservative", :type => :boolean, :banner => "If updating, use bundle install conservative update behavior and do not allow shared dependencies to be updated" + method_option "bundler", :type => :string, :lazy_default => "> 0.a", :banner => + "Update the locked version of bundler" def lock require_relative "cli/lock" Lock.new(options).run diff --git a/lib/bundler/cli/lock.rb b/lib/bundler/cli/lock.rb index cbd3f5a6fe..cb3ed27138 100644 --- a/lib/bundler/cli/lock.rb +++ b/lib/bundler/cli/lock.rb @@ -22,12 +22,15 @@ module Bundler update = options[:update] conservative = options[:conservative] + bundler = options[:bundler] if update.is_a?(Array) # unlocking specific gems Bundler::CLI::Common.ensure_all_gems_in_lockfile!(update) update = { :gems => update, :conservative => conservative } - elsif update - update = { :conservative => conservative } if conservative + elsif update && conservative + update = { :conservative => conservative } + elsif update && bundler + update = { :bundler => bundler } end definition = Bundler.definition(update) |