summaryrefslogtreecommitdiff
path: root/lib/bundler/cli/lock.rb
diff options
context:
space:
mode:
authorDavid Rodríguez <deivid.rodriguez@riseup.net>2023-03-02 20:18:35 +0100
committerHiroshi SHIBATA <hsbt@ruby-lang.org>2024-02-08 14:43:56 +0900
commit24d5e7176e80cecfc38daf80020fb85f1144083b (patch)
treeba0a8e927ba62f509044e6ac0b478f3d3ee5528b /lib/bundler/cli/lock.rb
parentdebc5aaee57a25745259fd02a54701e6c184fa7c (diff)
[rubygems/rubygems] Refactor lockfile generation
https://github.com/rubygems/rubygems/commit/6a0c03c77f
Diffstat (limited to 'lib/bundler/cli/lock.rb')
-rw-r--r--lib/bundler/cli/lock.rb9
1 files changed, 5 insertions, 4 deletions
diff --git a/lib/bundler/cli/lock.rb b/lib/bundler/cli/lock.rb
index 7247121df5..dac3d2a09a 100644
--- a/lib/bundler/cli/lock.rb
+++ b/lib/bundler/cli/lock.rb
@@ -33,8 +33,11 @@ module Bundler
update = { bundler: bundler }
end
+ file = options[:lockfile]
+ file = file ? Pathname.new(file).expand_path : Bundler.default_lockfile
+
Bundler.settings.temporary(frozen: false) do
- definition = Bundler.definition(update)
+ definition = Bundler.definition(update, file)
Bundler::CLI::Common.configure_gem_version_promoter(definition, options) if options[:update]
@@ -60,10 +63,8 @@ module Bundler
if print
puts definition.to_lock
else
- file = options[:lockfile]
- file = file ? File.expand_path(file) : Bundler.default_lockfile
puts "Writing lockfile to #{file}"
- definition.lock(file)
+ definition.lock
end
end