From 7e1e60b0445bc2329e60642e2cc2c14c1668352a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?David=20Rodr=C3=ADguez?= Date: Thu, 26 Mar 2020 18:42:48 +0100 Subject: [PATCH] [rubygems/rubygems] Remove ruby 1.8 leftovers https://github.com/rubygems/rubygems/commit/84c89275b8 --- lib/rubygems/security/policy.rb | 2 +- lib/rubygems/test_case.rb | 9 ++------- 2 files changed, 3 insertions(+), 8 deletions(-) diff --git a/lib/rubygems/security/policy.rb b/lib/rubygems/security/policy.rb index 1aa6eab18c..90e40b8289 100644 --- a/lib/rubygems/security/policy.rb +++ b/lib/rubygems/security/policy.rb @@ -139,7 +139,7 @@ class Gem::Security::Policy raise Gem::Security::Exception, "root certificate #{root.subject} is not self-signed " + "(issuer #{root.issuer})" if - root.issuer.to_s != root.subject.to_s # HACK to_s is for ruby 1.8 + root.issuer != root.subject check_cert root, root, time end diff --git a/lib/rubygems/test_case.rb b/lib/rubygems/test_case.rb index ba9b6435f4..3c00a491c1 100644 --- a/lib/rubygems/test_case.rb +++ b/lib/rubygems/test_case.rb @@ -844,9 +844,7 @@ class Gem::TestCase < (defined?(Minitest::Test) ? Minitest::Test : MiniTest::Uni end if deps - # Since Hash#each is unordered in 1.8, sort the keys and iterate that - # way so the tests are deterministic on all implementations. - deps.keys.sort.each do |n| + deps.keys.each do |n| spec.add_dependency n, (deps[n] || '>= 0') end end @@ -873,10 +871,7 @@ class Gem::TestCase < (defined?(Minitest::Test) ? Minitest::Test : MiniTest::Uni def util_gem(name, version, deps = nil, &block) if deps block = proc do |s| - # Since Hash#each is unordered in 1.8, sort - # the keys and iterate that way so the tests are - # deterministic on all implementations. - deps.keys.sort.each do |n| + deps.keys.each do |n| s.add_dependency n, (deps[n] || '>= 0') end end