Skip to content
This repository was archived by the owner on Apr 14, 2021. It is now read-only.

Don't incorrectly relativize sibling --path with the same prefix #4715

Merged
merged 1 commit into from
Jun 25, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion lib/bundler/cli/install.rb
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ def run

if Bundler.settings[:path]
absolute_path = File.expand_path(Bundler.settings[:path])
relative_path = absolute_path.sub(File.expand_path("."), ".")
relative_path = absolute_path.sub(File.expand_path(".") + File::SEPARATOR, "." + File::SEPARATOR)
Bundler.ui.confirm "Bundled gems are installed into #{relative_path}."
else
Bundler.ui.confirm "Use `bundle show [gemname]` to see where a bundled gem is installed."
Expand Down
14 changes: 14 additions & 0 deletions spec/install/post_bundle_message_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,20 @@
expect(out).to include("Gems in the groups emo, obama and test were not installed")
expect(out).to include(bundle_complete_message)
end

it "with an absolute --path inside the cwd" do
bundle "install --path #{bundled_app}/cache"
expect(out).to include("Bundled gems are installed into ./cache")
expect(out).to_not include("Gems in the group")
expect(out).to include(bundle_complete_message)
end

it "with an absolute --path outside the cwd" do
bundle "install --path #{bundled_app}_cache"
expect(out).to include("Bundled gems are installed into #{bundled_app}_cache")
expect(out).to_not include("Gems in the group")
expect(out).to include(bundle_complete_message)
end
end

describe "with misspelled or non-existent gem name" do
Expand Down