From 58b0a67432f5fd69d169ed4919ec0db6e6680279 Mon Sep 17 00:00:00 2001 From: David Rodríguez Date: Mon, 6 Mar 2023 17:58:13 +0100 Subject: [rubygems/rubygems] Extract a new small platform helper https://github.com/rubygems/rubygems/commit/8f7340df8e --- lib/bundler/current_ruby.rb | 2 +- lib/bundler/definition.rb | 2 +- lib/bundler/gem_helpers.rb | 5 +++++ 3 files changed, 7 insertions(+), 2 deletions(-) (limited to 'lib/bundler') diff --git a/lib/bundler/current_ruby.rb b/lib/bundler/current_ruby.rb index 1d2d8ff2fb..93e0c401c0 100644 --- a/lib/bundler/current_ruby.rb +++ b/lib/bundler/current_ruby.rb @@ -43,7 +43,7 @@ module Bundler ].freeze def ruby? - return true if Bundler::GemHelpers.generic_local_platform == Gem::Platform::RUBY + return true if Bundler::GemHelpers.generic_local_platform_is_ruby? !windows? && (RUBY_ENGINE == "ruby" || RUBY_ENGINE == "rbx" || RUBY_ENGINE == "maglev" || RUBY_ENGINE == "truffleruby") end diff --git a/lib/bundler/definition.rb b/lib/bundler/definition.rb index 761185ff21..72fbae1984 100644 --- a/lib/bundler/definition.rb +++ b/lib/bundler/definition.rb @@ -592,7 +592,7 @@ module Bundler end def current_ruby_platform_locked? - return false unless generic_local_platform == Gem::Platform::RUBY + return false unless generic_local_platform_is_ruby? return false if Bundler.settings[:force_ruby_platform] && !@platforms.include?(Gem::Platform::RUBY) current_platform_locked? diff --git a/lib/bundler/gem_helpers.rb b/lib/bundler/gem_helpers.rb index e85a93c64a..de007523ec 100644 --- a/lib/bundler/gem_helpers.rb +++ b/lib/bundler/gem_helpers.rb @@ -34,6 +34,11 @@ module Bundler end module_function :local_platform + def generic_local_platform_is_ruby? + generic_local_platform == Gem::Platform::RUBY + end + module_function :generic_local_platform_is_ruby? + def platform_specificity_match(spec_platform, user_platform) spec_platform = Gem::Platform.new(spec_platform) -- cgit v1.2.3