summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCarlhuda <carlhuda@engineyard.com>2010-07-07 18:10:42 -0700
committerCarlhuda <carlhuda@engineyard.com>2010-07-07 18:10:42 -0700
commit2199c87a0d5261a2665ec543a74cc8fd8650b961 (patch)
treebc137a51ddff82f31aba44cf20bc53f31d45a044
parent5b2d02fb6a78bf8b07f7b6d3f9407a961e3a7489 (diff)
downloadbundler-2199c87a0d5261a2665ec543a74cc8fd8650b961.tar.gz
Fixed a bug where our multiplatform logic is not identical to Rubygems
-rw-r--r--lib/bundler/settings.rb3
-rw-r--r--spec/install/gems/platform_spec.rb19
-rw-r--r--spec/support/path.rb5
3 files changed, 20 insertions, 7 deletions
diff --git a/lib/bundler/settings.rb b/lib/bundler/settings.rb
index 836df391ad..da6e475e3f 100644
--- a/lib/bundler/settings.rb
+++ b/lib/bundler/settings.rb
@@ -38,8 +38,7 @@ module Bundler
return path if path
if path = self[:path]
- engine = defined?(RUBY_ENGINE) ? RUBY_ENGINE : "ruby"
- "#{path}/#{engine}/#{RUBY_VERSION}"
+ "#{path}/#{Gem.ruby_engine}/#{Gem::ConfigMap[:ruby_version]}"
else
Gem.dir
end
diff --git a/spec/install/gems/platform_spec.rb b/spec/install/gems/platform_spec.rb
index dbc80c91ea..f6e560e4fa 100644
--- a/spec/install/gems/platform_spec.rb
+++ b/spec/install/gems/platform_spec.rb
@@ -82,8 +82,23 @@ describe "bundle install across platforms" do
bundle "install ./vendor"
- engine = defined?(RUBY_ENGINE) ? RUBY_ENGINE : "ruby"
- bundled_app("vendor/#{engine}/#{RUBY_VERSION}/gems/rack-1.0.0").should exist
+ vendored_gems("gems/rack-1.0.0").should exist
+ end
+
+ it "works after switching Rubies" do
+ gemfile <<-G
+ source "file://#{gem_repo1}"
+
+ gem "rack", "1.0.0"
+ G
+
+ bundle "install ./vendor"
+
+ new_version = Gem::ConfigMap[:ruby_version] == "1.8" ? "1.9.1" : "1.8"
+ FileUtils.mv(vendored_gems, bundled_app("vendor/#{Gem.ruby_engine}/#{new_version}"))
+
+ bundle "install ./vendor"
+ vendored_gems("gems/rack-1.0.0").should exist
end
end
diff --git a/spec/support/path.rb b/spec/support/path.rb
index 81ab6b23b2..d72a1866ec 100644
--- a/spec/support/path.rb
+++ b/spec/support/path.rb
@@ -30,9 +30,8 @@ module Spec
root.join(*path)
end
- def vendored_gems(path)
- engine = defined?(RUBY_ENGINE) ? RUBY_ENGINE : "ruby"
- bundled_app("vendor/#{engine}/#{RUBY_VERSION}/#{path}")
+ def vendored_gems(path = nil)
+ bundled_app("vendor/#{Gem.ruby_engine}/#{Gem::ConfigMap[:ruby_version]}/#{path}")
end
def cached_gem(path)