Skip to content

Commit f4b4f12

Browse files
committed
Removed deprecated Gem::Platform.match
1 parent 96cef34 commit f4b4f12

File tree

2 files changed

+0
-29
lines changed

2 files changed

+0
-29
lines changed

lib/rubygems/platform.rb

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
# frozen_string_literal: true
22

3-
require_relative "deprecate"
4-
53
##
64
# Available list of platforms for targeting Gem installations.
75
#
@@ -21,15 +19,6 @@ def self.local(refresh: false)
2119
end
2220
end
2321

24-
def self.match(platform)
25-
match_platforms?(platform, Gem.platforms)
26-
end
27-
28-
class << self
29-
extend Gem::Deprecate
30-
rubygems_deprecate :match, "Gem::Platform.match_spec? or match_gem?"
31-
end
32-
3322
def self.match_platforms?(platform, platforms)
3423
platform = Gem::Platform.new(platform) unless platform.is_a?(Gem::Platform)
3524
platforms.any? do |local_platform|

test/rubygems/test_gem_platform.rb

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -11,15 +11,6 @@ def test_self_local
1111
assert_equal Gem::Platform.new(%w[x86 darwin 8]), Gem::Platform.local
1212
end
1313

14-
def test_self_match
15-
Gem::Deprecate.skip_during do
16-
assert Gem::Platform.match(nil), "nil == ruby"
17-
assert Gem::Platform.match(Gem::Platform.local), "exact match"
18-
assert Gem::Platform.match(Gem::Platform.local.to_s), "=~ match"
19-
assert Gem::Platform.match(Gem::Platform::RUBY), "ruby"
20-
end
21-
end
22-
2314
def test_self_match_gem?
2415
assert Gem::Platform.match_gem?(nil, "json"), "nil == ruby"
2516
assert Gem::Platform.match_gem?(Gem::Platform.local, "json"), "exact match"
@@ -502,15 +493,6 @@ def test_inspect
502493
assert_equal 1, result.scan(/@version=/).size
503494
end
504495

505-
def test_gem_platform_match_with_string_argument
506-
util_set_arch "x86_64-linux-musl"
507-
508-
Gem::Deprecate.skip_during do
509-
assert(Gem::Platform.match(Gem::Platform.new("x86_64-linux")), "should match Gem::Platform")
510-
assert(Gem::Platform.match("x86_64-linux"), "should match String platform")
511-
end
512-
end
513-
514496
def test_constants
515497
assert_equal [nil, "java", nil], Gem::Platform::JAVA.to_a
516498
assert_equal ["x86", "mswin32", nil], Gem::Platform::MSWIN.to_a

0 commit comments

Comments
 (0)