summaryrefslogtreecommitdiff
path: root/lib/bundler/cli
diff options
context:
space:
mode:
authorRy Biesemeyer <ry.biesemeyer@elastic.co>2021-12-02 16:09:36 +0000
committergit <svn-admin@ruby-lang.org>2023-09-27 05:20:58 +0000
commitbece8808744ee178a4c55c6954edd30fb93b9ad3 (patch)
tree32cc1edd33a6f08a7ffb27a1559a5348e022359f /lib/bundler/cli
parenta812f1fed0e6e184447ca00b713d54b25be05911 (diff)
[rubygems/rubygems] Centralize logic using `Pathname#relative_path_from`
To avoid potential crashes when trying to jump from a drive to another on Windows, and take the change refactor things a bit. https://github.com/rubygems/rubygems/commit/7c9a9a431a
Diffstat (limited to 'lib/bundler/cli')
-rw-r--r--lib/bundler/cli/check.rb2
-rw-r--r--lib/bundler/cli/install.rb2
2 files changed, 2 insertions, 2 deletions
diff --git a/lib/bundler/cli/check.rb b/lib/bundler/cli/check.rb
index cc1f37f0c3..85c49f510a 100644
--- a/lib/bundler/cli/check.rb
+++ b/lib/bundler/cli/check.rb
@@ -29,7 +29,7 @@ module Bundler
Bundler.ui.warn "Install missing gems with `bundle install`"
exit 1
elsif !Bundler.default_lockfile.file? && Bundler.frozen_bundle?
- Bundler.ui.error "This bundle has been frozen, but there is no #{Bundler.default_lockfile.relative_path_from(SharedHelpers.pwd)} present"
+ Bundler.ui.error "This bundle has been frozen, but there is no #{SharedHelpers.relative_lockfile_path} present"
exit 1
else
Bundler.load.lock(:preserve_unknown_sections => true) unless options[:"dry-run"]
diff --git a/lib/bundler/cli/install.rb b/lib/bundler/cli/install.rb
index 3422b19645..f7228db623 100644
--- a/lib/bundler/cli/install.rb
+++ b/lib/bundler/cli/install.rb
@@ -29,7 +29,7 @@ module Bundler
flag ||= "--frozen flag" if options[:frozen]
flag ||= "deployment setting"
raise ProductionError, "The #{flag} requires a lockfile. Please make " \
- "sure you have checked your #{Bundler.default_lockfile.relative_path_from(SharedHelpers.pwd)} into version control " \
+ "sure you have checked your #{SharedHelpers.relative_lockfile_path} into version control " \
"before deploying."
end