summaryrefslogtreecommitdiff
path: root/lib/bundler/current_ruby.rb
diff options
context:
space:
mode:
authorshields <shields@tablecheck.com>2022-08-28 22:40:02 +0900
committergit <svn-admin@ruby-lang.org>2022-08-29 00:33:15 +0900
commit8799c912052f8bb957a65edd103e0064cac94598 (patch)
tree6bd697fbc6a44e96d12adfc161196572bd029ab5 /lib/bundler/current_ruby.rb
parent1486ffe03913076889290e38d86a7bdaca4e6fbd (diff)
[rubygems/rubygems] Add platform :windows as a shortcut for all Windows platforms
https://github.com/rubygems/rubygems/commit/f3c49ad3f7
Diffstat (limited to 'lib/bundler/current_ruby.rb')
-rw-r--r--lib/bundler/current_ruby.rb19
1 files changed, 14 insertions, 5 deletions
diff --git a/lib/bundler/current_ruby.rb b/lib/bundler/current_ruby.rb
index 36f26b7ab4..f9987c4da8 100644
--- a/lib/bundler/current_ruby.rb
+++ b/lib/bundler/current_ruby.rb
@@ -36,17 +36,18 @@ module Bundler
rbx
ruby
truffleruby
+ windows
x64_mingw
].freeze
def ruby?
return true if Bundler::GemHelpers.generic_local_platform == Gem::Platform::RUBY
- !mswin? && (RUBY_ENGINE == "ruby" || RUBY_ENGINE == "rbx" || RUBY_ENGINE == "maglev" || RUBY_ENGINE == "truffleruby")
+ !windows? && (RUBY_ENGINE == "ruby" || RUBY_ENGINE == "rbx" || RUBY_ENGINE == "maglev" || RUBY_ENGINE == "truffleruby")
end
def mri?
- !mswin? && RUBY_ENGINE == "ruby"
+ !windows? && RUBY_ENGINE == "ruby"
end
def rbx?
@@ -65,16 +66,24 @@ module Bundler
RUBY_ENGINE == "truffleruby"
end
- def mswin?
+ def windows?
Gem.win_platform?
end
+ def mswin?
+ # For backwards compatibility
+ windows?
+
+ # TODO: This should correctly be:
+ # windows? && Bundler.local_platform != Gem::Platform::RUBY && Bundler.local_platform.os == "mswin32" && Bundler.local_platform.cpu == "x86"
+ end
+
def mswin64?
- Gem.win_platform? && Bundler.local_platform != Gem::Platform::RUBY && Bundler.local_platform.os == "mswin64" && Bundler.local_platform.cpu == "x64"
+ windows? && Bundler.local_platform != Gem::Platform::RUBY && Bundler.local_platform.os == "mswin64" && Bundler.local_platform.cpu == "x64"
end
def mingw?
- Gem.win_platform? && Bundler.local_platform != Gem::Platform::RUBY && Bundler.local_platform.os == "mingw32" && Bundler.local_platform.cpu != "x64"
+ windows? && Bundler.local_platform != Gem::Platform::RUBY && Bundler.local_platform.os == "mingw32" && Bundler.local_platform.cpu != "x64"
end
def x64_mingw?