diff options
author | The Bundler Bot <bot@bundler.io> | 2017-01-23 00:36:13 +0000 |
---|---|---|
committer | Samuel Giddins <segiddins@segiddins.me> | 2017-01-22 20:20:29 -0600 |
commit | 8f60c5fd3e4afbea8117d02fbf59f8f40a755a53 (patch) | |
tree | 318115ec2da35b202cb9edc386ba4ddd9ec36685 | |
parent | 571cdc4fa20b7730e7bd7f0548bee34be4b58e1a (diff) | |
download | bundler-8f60c5fd3e4afbea8117d02fbf59f8f40a755a53.tar.gz |
Auto merge of #5345 - bundler:seg-windows-force-ruby, r=indirect
[CurrentRuby] Ensure the local platform isnt ruby before checking os/cpu
Closes #5344
fixes the problem since `Bundler.local_platform` can now be `"ruby"` on Windows, instead of a full-blown `Gem::Platform` object, when `force_ruby_platform` is set
(cherry picked from commit 8eb8a5d76b92fc285e4161d7fc6896f639e2d373)
-rw-r--r-- | lib/bundler/current_ruby.rb | 6 | ||||
-rw-r--r-- | spec/runtime/platform_spec.rb | 16 |
2 files changed, 19 insertions, 3 deletions
diff --git a/lib/bundler/current_ruby.rb b/lib/bundler/current_ruby.rb index 145518bacc..cca40100ad 100644 --- a/lib/bundler/current_ruby.rb +++ b/lib/bundler/current_ruby.rb @@ -58,15 +58,15 @@ module Bundler end def mswin64? - Bundler::WINDOWS && Bundler.local_platform.os == "mswin64" && Bundler.local_platform.cpu == "x64" + Bundler::WINDOWS && Bundler.local_platform != Gem::Platform::RUBY && Bundler.local_platform.os == "mswin64" && Bundler.local_platform.cpu == "x64" end def mingw? - Bundler::WINDOWS && Bundler.local_platform.os == "mingw32" && Bundler.local_platform.cpu != "x64" + Bundler::WINDOWS && Bundler.local_platform != Gem::Platform::RUBY && Bundler.local_platform.os == "mingw32" && Bundler.local_platform.cpu != "x64" end def x64_mingw? - Bundler::WINDOWS && Bundler.local_platform.os == "mingw32" && Bundler.local_platform.cpu == "x64" + Bundler::WINDOWS && Bundler.local_platform != Gem::Platform::RUBY && Bundler.local_platform.os == "mingw32" && Bundler.local_platform.cpu == "x64" end (KNOWN_MINOR_VERSIONS + KNOWN_MAJOR_VERSIONS).each do |version| diff --git a/spec/runtime/platform_spec.rb b/spec/runtime/platform_spec.rb index 4fd09cf4b7..bb2af27e38 100644 --- a/spec/runtime/platform_spec.rb +++ b/spec/runtime/platform_spec.rb @@ -104,4 +104,20 @@ describe "Bundler.setup with multi platform stuff" do expect(the_bundle).to include_gems "nokogiri 1.4.2", "platform_specific 1.0 RUBY" end + + it "allows specifying only-ruby-platform on windows with dependency platforms" do + simulate_windows do + install_gemfile! <<-G + source "file://#{gem_repo1}" + gem "nokogiri", :platforms => [:mingw, :mswin, :x64_mingw, :jruby] + gem "platform_specific" + G + + bundle! "config force_ruby_platform true" + + bundle! "install" + + expect(the_bundle).to include_gems "platform_specific 1.0 RUBY" + end + end end |