[前][次][番号順一覧][スレッド一覧]

ruby-changes:66226

From: Hiroshi <ko1@a...>
Date: Mon, 17 May 2021 12:00:25 +0900 (JST)
Subject: [ruby-changes:66226] 8e91b969df (master): Workaround with fbb4e3f96c10de2240f2d87eac19cf6f62f65fea

https://git.ruby-lang.org/ruby.git/commit/?id=8e91b969df

From 8e91b969df08b7a2eb27a5d6d38733eea42dc7ad Mon Sep 17 00:00:00 2001
From: Hiroshi SHIBATA <hsbt@r...>
Date: Mon, 17 May 2021 11:59:59 +0900
Subject: Workaround with fbb4e3f96c10de2240f2d87eac19cf6f62f65fea

---
 test/rubygems/test_gem_commands_signin_command.rb        | 12 ++++++------
 test/rubygems/test_gem_commands_specification_command.rb |  6 +++---
 test/rubygems/test_gem_config_file.rb                    |  4 ++--
 test/rubygems/test_gem_gemcutter_utilities.rb            | 10 +++++-----
 test/rubygems/test_gem_package.rb                        |  2 +-
 test/rubygems/test_gem_specification.rb                  |  2 +-
 6 files changed, 18 insertions(+), 18 deletions(-)

diff --git a/test/rubygems/test_gem_commands_signin_command.rb b/test/rubygems/test_gem_commands_signin_command.rb
index f826246..a36744e 100644
--- a/test/rubygems/test_gem_commands_signin_command.rb
+++ b/test/rubygems/test_gem_commands_signin_command.rb
@@ -30,10 +30,10 @@ class TestGemCommandsSigninCommand < Gem::TestCase https://github.com/ruby/ruby/blob/trunk/test/rubygems/test_gem_commands_signin_command.rb#L30
     host = 'http://some-gemcutter-compatible-host.org'
 
     util_capture(nil, host) { @cmd.execute }
-    old_credentials = YAML.load_file Gem.configuration.credentials_path
+    old_credentials = YAML.unsafe_load_file Gem.configuration.credentials_path
 
     util_capture(nil, host) { @cmd.execute }
-    new_credentials = YAML.load_file Gem.configuration.credentials_path
+    new_credentials = YAML.unsafe_load_file Gem.configuration.credentials_path
 
     assert_equal old_credentials[host], new_credentials[host]
   end
@@ -45,7 +45,7 @@ class TestGemCommandsSigninCommand < Gem::TestCase https://github.com/ruby/ruby/blob/trunk/test/rubygems/test_gem_commands_signin_command.rb#L45
     host = 'http://some-gemcutter-compatible-host.org'
 
     util_capture(nil, host, api_key) { @cmd.execute }
-    credentials = YAML.load_file Gem.configuration.credentials_path
+    credentials = YAML.unsafe_load_file Gem.configuration.credentials_path
 
     assert_equal credentials[:rubygems_api_key], api_key
 
@@ -60,7 +60,7 @@ class TestGemCommandsSigninCommand < Gem::TestCase https://github.com/ruby/ruby/blob/trunk/test/rubygems/test_gem_commands_signin_command.rb#L60
     assert_match %r{Signed in.}, sign_in_ui.output
 
     api_key     = 'a5fdbb6ba150cbb83aad2bb2fede64cf040453903'
-    credentials = YAML.load_file Gem.configuration.credentials_path
+    credentials = YAML.unsafe_load_file Gem.configuration.credentials_path
     assert_equal api_key, credentials[host]
   end
 
@@ -68,7 +68,7 @@ class TestGemCommandsSigninCommand < Gem::TestCase https://github.com/ruby/ruby/blob/trunk/test/rubygems/test_gem_commands_signin_command.rb#L68
     util_capture { @cmd.execute }
 
     api_key     = 'a5fdbb6ba150cbb83aad2bb2fede64cf040453903'
-    credentials = YAML.load_file Gem.configuration.credentials_path
+    credentials = YAML.unsafe_load_file Gem.configuration.credentials_path
 
     assert_equal api_key, credentials[:rubygems_api_key]
   end
@@ -94,7 +94,7 @@ class TestGemCommandsSigninCommand < Gem::TestCase https://github.com/ruby/ruby/blob/trunk/test/rubygems/test_gem_commands_signin_command.rb#L94
     assert_match "show_dashboard [y/N]", key_name_ui.output
     assert_equal "name=test-key&push_rubygem=true", fetcher.last_request.body
 
-    credentials = YAML.load_file Gem.configuration.credentials_path
+    credentials = YAML.unsafe_load_file Gem.configuration.credentials_path
     assert_equal api_key, credentials[:rubygems_api_key]
   end
 
diff --git a/test/rubygems/test_gem_commands_specification_command.rb b/test/rubygems/test_gem_commands_specification_command.rb
index 74a85e9..4dac3eb 100644
--- a/test/rubygems/test_gem_commands_specification_command.rb
+++ b/test/rubygems/test_gem_commands_specification_command.rb
@@ -114,7 +114,7 @@ class TestGemCommandsSpecificationCommand < Gem::TestCase https://github.com/ruby/ruby/blob/trunk/test/rubygems/test_gem_commands_specification_command.rb#L114
       @cmd.execute
     end
 
-    assert_equal "foo", YAML.load(@ui.output)
+    assert_equal "foo", YAML.unsafe_load(@ui.output)
   end
 
   def test_execute_file
@@ -230,7 +230,7 @@ class TestGemCommandsSpecificationCommand < Gem::TestCase https://github.com/ruby/ruby/blob/trunk/test/rubygems/test_gem_commands_specification_command.rb#L230
     assert_match %r{\A--- !ruby/object:Gem::Specification}, @ui.output
     assert_match %r{name: foo}, @ui.output
 
-    spec = YAML.load @ui.output
+    spec = YAML.unsafe_load @ui.output
 
     assert_equal Gem::Version.new("2.0.0"), spec.version
   end
@@ -252,7 +252,7 @@ class TestGemCommandsSpecificationCommand < Gem::TestCase https://github.com/ruby/ruby/blob/trunk/test/rubygems/test_gem_commands_specification_command.rb#L252
     assert_match %r{\A--- !ruby/object:Gem::Specification}, @ui.output
     assert_match %r{name: foo}, @ui.output
 
-    spec = YAML.load @ui.output
+    spec = YAML.unsafe_load @ui.output
 
     assert_equal Gem::Version.new("2.0.1.pre"), spec.version
   end
diff --git a/test/rubygems/test_gem_config_file.rb b/test/rubygems/test_gem_config_file.rb
index 92375c5..e155810 100644
--- a/test/rubygems/test_gem_config_file.rb
+++ b/test/rubygems/test_gem_config_file.rb
@@ -354,7 +354,7 @@ if you believe they were disclosed to a third party. https://github.com/ruby/ruby/blob/trunk/test/rubygems/test_gem_config_file.rb#L354
       :rubygems_api_key => 'x',
     }
 
-    assert_equal expected, YAML.load_file(@cfg.credentials_path)
+    assert_equal expected, YAML.unsafe_load_file(@cfg.credentials_path)
 
     unless win_platform?
       stat = File.stat @cfg.credentials_path
@@ -378,7 +378,7 @@ if you believe they were disclosed to a third party. https://github.com/ruby/ruby/blob/trunk/test/rubygems/test_gem_config_file.rb#L378
       :rubygems_api_key => 'x',
     }
 
-    assert_equal expected, YAML.load_file(@cfg.credentials_path)
+    assert_equal expected, YAML.unsafe_load_file(@cfg.credentials_path)
 
     stat = File.stat @cfg.credentials_path
 
diff --git a/test/rubygems/test_gem_gemcutter_utilities.rb b/test/rubygems/test_gem_gemcutter_utilities.rb
index c673c62..5f55f7e 100644
--- a/test/rubygems/test_gem_gemcutter_utilities.rb
+++ b/test/rubygems/test_gem_gemcutter_utilities.rb
@@ -101,7 +101,7 @@ class TestGemGemcutterUtilities < Gem::TestCase https://github.com/ruby/ruby/blob/trunk/test/rubygems/test_gem_gemcutter_utilities.rb#L101
     assert @fetcher.last_request["authorization"]
     assert_match %r{Signed in.}, @sign_in_ui.output
 
-    credentials = YAML.load_file Gem.configuration.credentials_path
+    credentials = YAML.unsafe_load_file Gem.configuration.credentials_path
     assert_equal api_key, credentials[:rubygems_api_key]
   end
 
@@ -115,7 +115,7 @@ class TestGemGemcutterUtilities < Gem::TestCase https://github.com/ruby/ruby/blob/trunk/test/rubygems/test_gem_gemcutter_utilities.rb#L115
     assert @fetcher.last_request["authorization"]
     assert_match %r{Signed in.}, @sign_in_ui.output
 
-    credentials = YAML.load_file Gem.configuration.credentials_path
+    credentials = YAML.unsafe_load_file Gem.configuration.credentials_path
     assert_equal api_key, credentials['http://example.com']
   end
 
@@ -129,7 +129,7 @@ class TestGemGemcutterUtilities < Gem::TestCase https://github.com/ruby/ruby/blob/trunk/test/rubygems/test_gem_gemcutter_utilities.rb#L129
     assert @fetcher.last_request["authorization"]
     assert_match %r{Signed in.}, @sign_in_ui.output
 
-    credentials = YAML.load_file Gem.configuration.credentials_path
+    credentials = YAML.unsafe_load_file Gem.configuration.credentials_path
     assert_equal api_key, credentials[:rubygems_api_key]
   end
 
@@ -142,7 +142,7 @@ class TestGemGemcutterUtilities < Gem::TestCase https://github.com/ruby/ruby/blob/trunk/test/rubygems/test_gem_gemcutter_utilities.rb#L142
     assert @fetcher.last_request["authorization"]
     assert_match %r{Signed in.}, @sign_in_ui.output
 
-    credentials = YAML.load_file Gem.configuration.credentials_path
+    credentials = YAML.unsafe_load_file Gem.configuration.credentials_path
     assert_equal api_key, credentials['http://example.com']
   end
 
@@ -177,7 +177,7 @@ class TestGemGemcutterUtilities < Gem::TestCase https://github.com/ruby/ruby/blob/trunk/test/rubygems/test_gem_gemcutter_utilities.rb#L177
     assert_match %r{Enter your RubyGems.org credentials.}, @sign_in_ui.output
     assert_match %r{Signed in.}, @sign_in_ui.output
 
-    credentials = YAML.load_file Gem.configuration.credentials_path
+    credentials = YAML.unsafe_load_file Gem.configuration.credentials_path
     assert_equal api_key, credentials[:rubygems_api_key]
     assert_equal other_api_key, credentials[:other_api_key]
   end
diff --git a/test/rubygems/test_gem_package.rb b/test/rubygems/test_gem_package.rb
index 8f2f50c..f5f071b 100644
--- a/test/rubygems/test_gem_package.rb
+++ b/test/rubygems/test_gem_package.rb
@@ -98,7 +98,7 @@ class TestGemPackage < Gem::Package::TarTestCase https://github.com/ruby/ruby/blob/trunk/test/rubygems/test_gem_package.rb#L98
       },
     }
 
-    assert_equal expected, YAML.load(checksums)
+    assert_equal expected, YAML.unsafe_load(checksums)
   end
 
   def test_build_time_uses_source_date_epoch
diff --git a/test/rubygems/test_gem_specification.rb b/test/rubygems/test_gem_specification.rb
index d014eae..6e6d92a 100644
--- a/test/rubygems/test_gem_specification.rb
+++ b/test/rubygems/test_gem_specification.rb
@@ -2649,7 +2649,7 @@ end https://github.com/ruby/ruby/blob/trunk/test/rubygems/test_gem_specification.rb#L2649
 
     yaml_str = @a1.to_yaml
 
-    same_spec = YAML.load yaml_str
+    same_spec = YAML.unsafe_load yaml_str
 
     assert_equal Gem::Platform.new('powerpc-darwin7'), same_spec.platform
     assert_equal 'powerpc-darwin7.9.0', same_spec.original_platform
-- 
cgit v1.1


--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]