summaryrefslogtreecommitdiff
path: root/lib/bundler/env.rb
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/env.rb
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/env.rb')
-rw-r--r--lib/bundler/env.rb4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/bundler/env.rb b/lib/bundler/env.rb
index 4f8b6f605d..f6cb198e38 100644
--- a/lib/bundler/env.rb
+++ b/lib/bundler/env.rb
@@ -40,11 +40,11 @@ module Bundler
out << "\n## Gemfile\n"
gemfiles.each do |gemfile|
- out << "\n### #{Pathname.new(gemfile).relative_path_from(SharedHelpers.pwd)}\n\n"
+ out << "\n### #{SharedHelpers.relative_path_to(gemfile)}\n\n"
out << "```ruby\n" << read_file(gemfile).chomp << "\n```\n"
end
- out << "\n### #{Bundler.default_lockfile.relative_path_from(SharedHelpers.pwd)}\n\n"
+ out << "\n### #{SharedHelpers.relative_path_to(Bundler.default_lockfile)}\n\n"
out << "```\n" << read_file(Bundler.default_lockfile).chomp << "\n```\n"
end