summaryrefslogtreecommitdiff
path: root/lib/bundler/current_ruby.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/bundler/current_ruby.rb')
-rw-r--r--lib/bundler/current_ruby.rb28
1 files changed, 12 insertions, 16 deletions
diff --git a/lib/bundler/current_ruby.rb b/lib/bundler/current_ruby.rb
index f84d68e262..93e0c401c0 100644
--- a/lib/bundler/current_ruby.rb
+++ b/lib/bundler/current_ruby.rb
@@ -21,6 +21,9 @@ module Bundler
2.6
2.7
3.0
+ 3.1
+ 3.2
+ 3.3
].freeze
KNOWN_MAJOR_VERSIONS = KNOWN_MINOR_VERSIONS.map {|v| v.split(".", 2).first }.uniq.freeze
@@ -35,17 +38,18 @@ module Bundler
rbx
ruby
truffleruby
+ windows
x64_mingw
].freeze
def ruby?
- return true if Bundler::GemHelpers.generic_local_platform == Gem::Platform::RUBY
+ return true if Bundler::GemHelpers.generic_local_platform_is_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?
@@ -64,21 +68,13 @@ module Bundler
RUBY_ENGINE == "truffleruby"
end
- def mswin?
+ def windows?
Gem.win_platform?
end
-
- def mswin64?
- Gem.win_platform? && 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"
- end
-
- def x64_mingw?
- Gem.win_platform? && Bundler.local_platform != Gem::Platform::RUBY && Bundler.local_platform.os == "mingw32" && Bundler.local_platform.cpu == "x64"
- end
+ alias_method :mswin?, :windows?
+ alias_method :mswin64?, :windows?
+ alias_method :mingw?, :windows?
+ alias_method :x64_mingw?, :windows?
(KNOWN_MINOR_VERSIONS + KNOWN_MAJOR_VERSIONS).each do |version|
trimmed_version = version.tr(".", "")