diff options
author | Ry Biesemeyer <ry.biesemeyer@elastic.co> | 2021-12-02 16:09:36 +0000 |
---|---|---|
committer | git <svn-admin@ruby-lang.org> | 2023-09-27 05:20:58 +0000 |
commit | bece8808744ee178a4c55c6954edd30fb93b9ad3 (patch) | |
tree | 32cc1edd33a6f08a7ffb27a1559a5348e022359f /lib/bundler/lockfile_parser.rb | |
parent | a812f1fed0e6e184447ca00b713d54b25be05911 (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/lockfile_parser.rb')
-rw-r--r-- | lib/bundler/lockfile_parser.rb | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/bundler/lockfile_parser.rb b/lib/bundler/lockfile_parser.rb index 146e728989..31f57f14e8 100644 --- a/lib/bundler/lockfile_parser.rb +++ b/lib/bundler/lockfile_parser.rb @@ -68,7 +68,7 @@ module Bundler if lockfile.match?(/<<<<<<<|=======|>>>>>>>|\|\|\|\|\|\|\|/) raise LockfileError, "Your lockfile contains merge conflicts.\n" \ - "Run `git checkout HEAD -- #{Bundler.default_lockfile.relative_path_from(SharedHelpers.pwd)}` first to get a clean lock." + "Run `git checkout HEAD -- #{SharedHelpers.relative_lockfile_path}` first to get a clean lock." end lockfile.split(/(?:\r?\n)+/) do |line| @@ -92,7 +92,7 @@ module Bundler @specs = @specs.values.sort_by!(&:full_name) rescue ArgumentError => e Bundler.ui.debug(e) - raise LockfileError, "Your lockfile is unreadable. Run `rm #{Bundler.default_lockfile.relative_path_from(SharedHelpers.pwd)}` " \ + raise LockfileError, "Your lockfile is unreadable. Run `rm #{SharedHelpers.relative_lockfile_path}` " \ "and then `bundle install` to generate a new lockfile." end |