1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

Replace Gem::Util.silent_system with better tools

This commit is contained in:
David Rodríguez 2020-03-24 12:54:22 +01:00 committed by Hiroshi SHIBATA
parent c61031d6b6
commit afce7eb39e
Notes: git 2020-06-15 21:21:03 +09:00
2 changed files with 8 additions and 5 deletions

View file

@ -103,9 +103,11 @@ class Gem::Source::Git < Gem::Source
success = system @git, 'reset', '--quiet', '--hard', rev_parse success = system @git, 'reset', '--quiet', '--hard', rev_parse
success &&= if @need_submodules
Gem::Util.silent_system @git, 'submodule', 'update', _, status = Open3.capture2e(@git, 'submodule', 'update', '--quiet', '--init', '--recursive')
'--quiet', '--init', '--recursive' if @need_submodules
success &&= status.success?
end
success success
end end

View file

@ -69,8 +69,9 @@ class TestGemSourceGit < Gem::TestCase
git_gem 'b' git_gem 'b'
Dir.chdir 'git/a' do Dir.chdir 'git/a' do
Gem::Util.silent_system @git, 'submodule', '--quiet', output, status = Open3.capture2e(@git, 'submodule', '--quiet', 'add', File.expand_path('../b'), 'b')
'add', File.expand_path('../b'), 'b' assert status.success?, output
system @git, 'commit', '--quiet', '-m', 'add submodule b' system @git, 'commit', '--quiet', '-m', 'add submodule b'
end end