diff options
author | Samuel Giddins <segiddins@segiddins.me> | 2017-01-21 16:40:02 -0600 |
---|---|---|
committer | Samuel Giddins <segiddins@segiddins.me> | 2017-01-21 16:40:02 -0600 |
commit | a4ea98ecd89189b00c6231878663241ecadaa592 (patch) | |
tree | b3e100a4768b7b5fd805ec4ab7a098f1c8d62127 | |
parent | 915806bb762a7f1ebf0d55caa2d7833c940608c5 (diff) | |
download | bundler-a4ea98ecd89189b00c6231878663241ecadaa592.tar.gz |
[CurrentRuby] Ensure the local platform isnt ruby before checking os/cpu
-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 145518ba..cca40100 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 be1005e8..4df934e7 100644 --- a/spec/runtime/platform_spec.rb +++ b/spec/runtime/platform_spec.rb @@ -104,4 +104,20 @@ RSpec.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 |