aboutsummaryrefslogtreecommitdiffstats
path: root/lib/bundler
diff options
context:
space:
mode:
authorDavid Rodríguez <deivid.rodriguez@riseup.net>2023-03-06 17:58:13 +0100
committerHiroshi SHIBATA <hsbt@ruby-lang.org>2023-11-13 11:06:10 +0900
commit58b0a67432f5fd69d169ed4919ec0db6e6680279 (patch)
tree7a65841168b1442690efb037efa89fbc16dbd10e /lib/bundler
parentbd6aaa78c3f3590c9b24a6a9fe0d8a930580ab37 (diff)
downloadruby-58b0a67432f5fd69d169ed4919ec0db6e6680279.tar.gz
[rubygems/rubygems] Extract a new small platform helper
https://github.com/rubygems/rubygems/commit/8f7340df8e
Diffstat (limited to 'lib/bundler')
-rw-r--r--lib/bundler/current_ruby.rb2
-rw-r--r--lib/bundler/definition.rb2
-rw-r--r--lib/bundler/gem_helpers.rb5
3 files changed, 7 insertions, 2 deletions
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)