Skip to content

Commit d8d0da5

Browse files
segiddinshsbt
authored andcommitted
[rubygems/rubygems] Remove platform backports from bundler
Signed-off-by: Samuel Giddins <[email protected]> ruby/rubygems@9336d3811c
1 parent af27688 commit d8d0da5

File tree

1 file changed

+0
-55
lines changed

1 file changed

+0
-55
lines changed

lib/bundler/rubygems_ext.rb

Lines changed: 0 additions & 55 deletions
Original file line numberDiff line numberDiff line change
@@ -62,61 +62,6 @@ class Platform
6262
WINDOWS = [MSWIN, MSWIN64, UNIVERSAL_MINGW].flatten.freeze
6363
X64_LINUX = Gem::Platform.new("x86_64-linux")
6464
X64_LINUX_MUSL = Gem::Platform.new("x86_64-linux-musl")
65-
66-
if X64_LINUX === X64_LINUX_MUSL
67-
remove_method :===
68-
69-
def ===(other)
70-
return nil unless Gem::Platform === other
71-
72-
# universal-mingw32 matches x64-mingw-ucrt
73-
return true if (@cpu == "universal" || other.cpu == "universal") &&
74-
@os.start_with?("mingw") && other.os.start_with?("mingw")
75-
76-
# cpu
77-
([nil,"universal"].include?(@cpu) || [nil, "universal"].include?(other.cpu) || @cpu == other.cpu ||
78-
(@cpu == "arm" && other.cpu.start_with?("armv"))) &&
79-
80-
# os
81-
@os == other.os &&
82-
83-
# version
84-
(
85-
(@os != "linux" && (@version.nil? || other.version.nil?)) ||
86-
(@os == "linux" && (normalized_linux_version == other.normalized_linux_version || ["musl#{@version}", "musleabi#{@version}", "musleabihf#{@version}"].include?(other.version))) ||
87-
@version == other.version
88-
)
89-
end
90-
end
91-
end
92-
93-
Platform.singleton_class.module_eval do
94-
unless Platform.singleton_methods.include?(:match_spec?)
95-
def match_spec?(spec)
96-
match_gem?(spec.platform, spec.name)
97-
end
98-
99-
def match_gem?(platform, gem_name)
100-
match_platforms?(platform, Gem.platforms)
101-
end
102-
end
103-
104-
match_platforms_defined = Gem::Platform.respond_to?(:match_platforms?, true)
105-
106-
if !match_platforms_defined || Gem::Platform.send(:match_platforms?, Gem::Platform::X64_LINUX_MUSL, [Gem::Platform::X64_LINUX])
107-
108-
private
109-
110-
remove_method :match_platforms? if match_platforms_defined
111-
112-
def match_platforms?(platform, platforms)
113-
platforms.any? do |local_platform|
114-
platform.nil? ||
115-
local_platform == platform ||
116-
(local_platform != Gem::Platform::RUBY && platform =~ local_platform)
117-
end
118-
end
119-
end
12065
end
12166

12267
require "rubygems/specification"

0 commit comments

Comments
 (0)