mirror of
https://github.com/ruby/ruby.git
synced 2026-01-26 12:14:51 +00:00
[ruby/rubygems] Removed deprecated Gem::Platform.match
https://github.com/ruby/rubygems/commit/f4b4f12f91
This commit is contained in:
parent
a242adc3e9
commit
a6fa99fe18
@ -1,7 +1,5 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
require_relative "deprecate"
|
||||
|
||||
##
|
||||
# Available list of platforms for targeting Gem installations.
|
||||
#
|
||||
@ -21,15 +19,6 @@ class Gem::Platform
|
||||
end
|
||||
end
|
||||
|
||||
def self.match(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|
|
||||
|
||||
@ -11,15 +11,6 @@ class TestGemPlatform < Gem::TestCase
|
||||
assert_equal Gem::Platform.new(%w[x86 darwin 8]), Gem::Platform.local
|
||||
end
|
||||
|
||||
def test_self_match
|
||||
Gem::Deprecate.skip_during do
|
||||
assert Gem::Platform.match(nil), "nil == ruby"
|
||||
assert Gem::Platform.match(Gem::Platform.local), "exact match"
|
||||
assert Gem::Platform.match(Gem::Platform.local.to_s), "=~ match"
|
||||
assert Gem::Platform.match(Gem::Platform::RUBY), "ruby"
|
||||
end
|
||||
end
|
||||
|
||||
def test_self_match_gem?
|
||||
assert Gem::Platform.match_gem?(nil, "json"), "nil == ruby"
|
||||
assert Gem::Platform.match_gem?(Gem::Platform.local, "json"), "exact match"
|
||||
@ -502,15 +493,6 @@ class TestGemPlatform < Gem::TestCase
|
||||
assert_equal 1, result.scan(/@version=/).size
|
||||
end
|
||||
|
||||
def test_gem_platform_match_with_string_argument
|
||||
util_set_arch "x86_64-linux-musl"
|
||||
|
||||
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 test_constants
|
||||
assert_equal [nil, "java", nil], Gem::Platform::JAVA.to_a
|
||||
assert_equal ["x86", "mswin32", nil], Gem::Platform::MSWIN.to_a
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user