summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSamuel Giddins <segiddins@segiddins.me>2017-08-30 14:33:01 -0500
committerSamuel Giddins <segiddins@segiddins.me>2017-09-08 10:46:55 -0700
commit9499ae7665469238e5261592cc0bc2a9399de667 (patch)
tree722a9cea76ce90d046fd93afee180d44f57576ed
parent10bc341c6166f281c81c13d33e851a5d138a8a7d (diff)
downloadbundler-9499ae7665469238e5261592cc0bc2a9399de667.tar.gz
Print absolute paths outside of the bundle root as absolute
-rw-r--r--lib/bundler/settings.rb9
1 files changed, 7 insertions, 2 deletions
diff --git a/lib/bundler/settings.rb b/lib/bundler/settings.rb
index 5329721b31..c58eb3d494 100644
--- a/lib/bundler/settings.rb
+++ b/lib/bundler/settings.rb
@@ -251,9 +251,14 @@ module Bundler
end
def base_path_relative_to_pwd
- expanded_base_path = Pathname.new(base_path).expand_path(Bundler.root)
+ base_path = Pathname.new(self.base_path)
+ expanded_base_path = base_path.expand_path(Bundler.root)
relative_path = expanded_base_path.relative_path_from(Pathname.pwd)
- relative_path = Pathname.new(File.join(".", relative_path)) unless relative_path.to_s.start_with?("..")
+ if relative_path.to_s.start_with?("..")
+ relative_path = base_path if base_path.absolute?
+ else
+ relative_path = Pathname.new(File.join(".", relative_path))
+ end
relative_path
rescue ArgumentError
expanded_base_path