Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Fixed a bug where our multiplatform logic is not identical to Rubygems

  • Loading branch information...
commit 2199c87a0d5261a2665ec543a74cc8fd8650b961 1 parent 5b2d02f
Carlhuda authored
View
3  lib/bundler/settings.rb
@@ -38,8 +38,7 @@ def path
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
View
19 spec/install/gems/platform_spec.rb
@@ -82,8 +82,23 @@
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
View
5 spec/support/path.rb
@@ -30,9 +30,8 @@ def bundled_app2(*path)
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)
Please sign in to comment.
Something went wrong with that request. Please try again.