summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThe Bundler Bot <bot@bundler.io>2017-01-23 00:36:13 +0000
committerThe Bundler Bot <bot@bundler.io>2017-01-23 00:36:13 +0000
commit8eb8a5d76b92fc285e4161d7fc6896f639e2d373 (patch)
tree4de5a3f458f84335a11003b32c299a86001e2b92
parent3e5d59aeaa8d2ec828b485ac4ec3b43cc35de63a (diff)
parenta4ea98ecd89189b00c6231878663241ecadaa592 (diff)
downloadbundler-8eb8a5d76b92fc285e4161d7fc6896f639e2d373.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
-rw-r--r--lib/bundler/current_ruby.rb6
-rw-r--r--spec/runtime/platform_spec.rb16
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 be1005e88e..4df934e71f 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