summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSamuel Giddins <segiddins@segiddins.me>2018-04-08 12:00:46 -0700
committerSamuel Giddins <segiddins@segiddins.me>2018-04-08 12:00:46 -0700
commit8bf9c1f8f4bcebd67967f4ae5e3985b5880fed6d (patch)
tree907a8ba32f96465e9bc2f8abc89955d8baa540d5
parentcecdfdb5b2a76133b0a83093ff6d80d1ffd97b46 (diff)
downloadbundler-segiddins/6475-install-path-dot.tar.gz
[Source::RubyGems] Allow installing when the path is `.`segiddins/6475-install-path-dot
-rw-r--r--lib/bundler/source/rubygems.rb5
-rw-r--r--spec/install/path_spec.rb12
2 files changed, 15 insertions, 2 deletions
diff --git a/lib/bundler/source/rubygems.rb b/lib/bundler/source/rubygems.rb
index 72dbc0c588..1759838b57 100644
--- a/lib/bundler/source/rubygems.rb
+++ b/lib/bundler/source/rubygems.rb
@@ -485,7 +485,10 @@ module Bundler
else
uri = spec.remote.uri
Bundler.ui.confirm("Fetching #{version_message(spec)}")
- Bundler.rubygems.download_gem(spec, uri, download_path)
+ rubygems_local_path = Bundler.rubygems.download_gem(spec, uri, download_path)
+ if rubygems_local_path != local_path
+ FileUtils.mv(rubygems_local_path, local_path)
+ end
cache_globally(spec, local_path)
end
end
diff --git a/spec/install/path_spec.rb b/spec/install/path_spec.rb
index 467e95ec57..3ed2b30cce 100644
--- a/spec/install/path_spec.rb
+++ b/spec/install/path_spec.rb
@@ -98,7 +98,7 @@ RSpec.describe "bundle install" do
if type == :env
ENV["BUNDLE_PATH"] = location
elsif type == :global
- bundle "config path #{location}", "no-color" => nil
+ bundle! "config path #{location}", "no-color" => nil
end
end
@@ -112,6 +112,16 @@ RSpec.describe "bundle install" do
expect(the_bundle).to include_gems "rack 1.0.0"
end
+ it "installs gems to ." do
+ set_bundle_path(type, ".")
+ bundle! "config --global disable_shared_gems true"
+
+ bundle! :install
+
+ expect([bundled_app("cache/rack-1.0.0.gem"), bundled_app("gems/rack-1.0.0"), bundled_app("specifications/rack-1.0.0.gemspec")]).to all exist
+ expect(the_bundle).to include_gems "rack 1.0.0"
+ end
+
it "installs gems to BUNDLE_PATH with #{type}" do
set_bundle_path(type, bundled_app("vendor").to_s)