diff options
author | Samuel Giddins <[email protected]> | 2025-05-14 13:31:43 -0700 |
---|---|---|
committer | Hiroshi SHIBATA <[email protected]> | 2025-05-26 11:46:12 +0900 |
commit | d8d0da571340e40bc6dbabab7a421a94d55e5b72 (patch) | |
tree | a74268840cc0a3f92a6dbca11113e20400fdd257 | |
parent | af27688697f708b4fe15e4211d61d2765acc80f6 (diff) |
[rubygems/rubygems] Remove platform backports from bundler
Signed-off-by: Samuel Giddins <[email protected]>
https://github.com/rubygems/rubygems/commit/9336d3811c
-rw-r--r-- | lib/bundler/rubygems_ext.rb | 55 |
1 files changed, 0 insertions, 55 deletions
diff --git a/lib/bundler/rubygems_ext.rb b/lib/bundler/rubygems_ext.rb index 5789973b6b..361d0d3002 100644 --- a/lib/bundler/rubygems_ext.rb +++ b/lib/bundler/rubygems_ext.rb @@ -62,61 +62,6 @@ module Gem WINDOWS = [MSWIN, MSWIN64, UNIVERSAL_MINGW].flatten.freeze X64_LINUX = Gem::Platform.new("x86_64-linux") X64_LINUX_MUSL = Gem::Platform.new("x86_64-linux-musl") - - if X64_LINUX === X64_LINUX_MUSL - remove_method :=== - - def ===(other) - return nil unless Gem::Platform === other - - # universal-mingw32 matches x64-mingw-ucrt - return true if (@cpu == "universal" || other.cpu == "universal") && - @os.start_with?("mingw") && other.os.start_with?("mingw") - - # cpu - ([nil,"universal"].include?(@cpu) || [nil, "universal"].include?(other.cpu) || @cpu == other.cpu || - (@cpu == "arm" && other.cpu.start_with?("armv"))) && - - # os - @os == other.os && - - # version - ( - (@os != "linux" && (@version.nil? || other.version.nil?)) || - (@os == "linux" && (normalized_linux_version == other.normalized_linux_version || ["musl#{@version}", "musleabi#{@version}", "musleabihf#{@version}"].include?(other.version))) || - @version == other.version - ) - end - end - end - - Platform.singleton_class.module_eval do - unless Platform.singleton_methods.include?(:match_spec?) - def match_spec?(spec) - match_gem?(spec.platform, spec.name) - end - - def match_gem?(platform, gem_name) - match_platforms?(platform, Gem.platforms) - end - end - - match_platforms_defined = Gem::Platform.respond_to?(:match_platforms?, true) - - if !match_platforms_defined || Gem::Platform.send(:match_platforms?, Gem::Platform::X64_LINUX_MUSL, [Gem::Platform::X64_LINUX]) - - private - - remove_method :match_platforms? if match_platforms_defined - - def match_platforms?(platform, platforms) - platforms.any? do |local_platform| - platform.nil? || - local_platform == platform || - (local_platform != Gem::Platform::RUBY && platform =~ local_platform) - end - end - end end require "rubygems/specification" |