[rubygems/rubygems] Deprecate Gem::Platform.match

https://github.com/rubygems/rubygems/commit/e3ba3e2225
This commit is contained in:
Hiroshi SHIBATA 2023-04-04 11:53:11 +09:00 коммит произвёл git
Родитель f602cb55d7
Коммит 7fdf98ef39
2 изменённых файлов: 9 добавлений и 2 удалений

Просмотреть файл

@ -22,6 +22,11 @@ class Gem::Platform
match_platforms?(platform, Gem.platforms)
end
class << self
extend Gem::Deprecate
rubygems_deprecate :match, "Gem::Platform.match_spec? or match_gem?"
end
def self.match_platforms?(platform, platforms)
platform = Gem::Platform.new(platform) unless platform.is_a?(Gem::Platform)
platforms.any? do |local_platform|

Просмотреть файл

@ -483,8 +483,10 @@ class TestGemPlatform < Gem::TestCase
def test_gem_platform_match_with_string_argument
util_set_arch "x86_64-linux-musl"
assert(Gem::Platform.match(Gem::Platform.new("x86_64-linux")), "should match Gem::Platform")
assert(Gem::Platform.match("x86_64-linux"), "should match String platform")
Gem::Deprecate.skip_during do
assert(Gem::Platform.match(Gem::Platform.new("x86_64-linux")), "should match Gem::Platform")
assert(Gem::Platform.match("x86_64-linux"), "should match String platform")
end
end
def assert_local_match(name)