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

Deprecate Gem::Util.silent_system

There's better tools for this job.
This commit is contained in:
David Rodríguez 2020-06-12 11:37:38 +02:00 committed by Hiroshi SHIBATA
parent afce7eb39e
commit 2b4abcff90
Notes: git 2020-06-15 21:21:02 +09:00
2 changed files with 15 additions and 2 deletions

View file

@ -1,8 +1,11 @@
# frozen_string_literal: true # frozen_string_literal: true
require 'rubygems/deprecate'
## ##
# This module contains various utility methods as module methods. # This module contains various utility methods as module methods.
module Gem::Util module Gem::Util
## ##
# Zlib::GzipReader wrapper that unzips +data+. # Zlib::GzipReader wrapper that unzips +data+.
@ -67,6 +70,14 @@ module Gem::Util
system(*(cmds << opt)) system(*(cmds << opt))
end end
class << self
extend Gem::Deprecate
rubygems_deprecate :silent_system
end
## ##
# Enumerates the parents of +directory+. # Enumerates the parents of +directory+.

View file

@ -15,8 +15,10 @@ class TestGemUtil < Gem::TestCase
def test_silent_system def test_silent_system
skip if Gem.java_platform? skip if Gem.java_platform?
assert_silent do Gem::Deprecate.skip_during do
Gem::Util.silent_system(*ruby_with_rubygems_in_load_path, '-e', 'puts "hello"; warn "hello"') assert_silent do
Gem::Util.silent_system(*ruby_with_rubygems_in_load_path, '-e', 'puts "hello"; warn "hello"')
end
end end
end end