ruby-changes:61725
From: David <ko1@a...>
Date: Mon, 15 Jun 2020 21:21:02 +0900 (JST)
Subject: [ruby-changes:61725] afce7eb39e (master): Replace `Gem::Util.silent_system` with better tools
https://git.ruby-lang.org/ruby.git/commit/?id=afce7eb39e From afce7eb39ec58f9ec65b3cf53059a4bc3bd58cbd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?David=20Rodr=C3=ADguez?= <deivid.rodriguez@r...> Date: Tue, 24 Mar 2020 12:54:22 +0100 Subject: Replace `Gem::Util.silent_system` with better tools diff --git a/lib/rubygems/source/git.rb b/lib/rubygems/source/git.rb index ec2c371..b76a068 100644 --- a/lib/rubygems/source/git.rb +++ b/lib/rubygems/source/git.rb @@ -103,9 +103,11 @@ class Gem::Source::Git < Gem::Source https://github.com/ruby/ruby/blob/trunk/lib/rubygems/source/git.rb#L103 success = system @git, 'reset', '--quiet', '--hard', rev_parse - success &&= - Gem::Util.silent_system @git, 'submodule', 'update', - '--quiet', '--init', '--recursive' if @need_submodules + if @need_submodules + _, status = Open3.capture2e(@git, 'submodule', 'update', '--quiet', '--init', '--recursive') + + success &&= status.success? + end success end diff --git a/test/rubygems/test_gem_source_git.rb b/test/rubygems/test_gem_source_git.rb index bcf97e3..393190c 100644 --- a/test/rubygems/test_gem_source_git.rb +++ b/test/rubygems/test_gem_source_git.rb @@ -69,8 +69,9 @@ class TestGemSourceGit < Gem::TestCase https://github.com/ruby/ruby/blob/trunk/test/rubygems/test_gem_source_git.rb#L69 git_gem 'b' Dir.chdir 'git/a' do - Gem::Util.silent_system @git, 'submodule', '--quiet', - 'add', File.expand_path('../b'), 'b' + output, status = Open3.capture2e(@git, 'submodule', '--quiet', 'add', File.expand_path('../b'), 'b') + assert status.success?, output + system @git, 'commit', '--quiet', '-m', 'add submodule b' end -- cgit v0.10.2 -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/