mirror of
https://github.com/ruby/ruby.git
synced 2026-01-26 12:14:51 +00:00
[ruby/rubygems] Removed deprecated Gem::Util.silent_system
https://github.com/ruby/rubygems/commit/728269cc4a
This commit is contained in:
parent
31928c10a2
commit
ecec9dc606
@ -1,7 +1,5 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
require_relative "deprecate"
|
||||
|
||||
##
|
||||
# This module contains various utility methods as module methods.
|
||||
|
||||
@ -56,26 +54,6 @@ module Gem::Util
|
||||
IO.popen command, &:read
|
||||
end
|
||||
|
||||
##
|
||||
# Invokes system, but silences all output.
|
||||
|
||||
def self.silent_system(*command)
|
||||
opt = { out: IO::NULL, err: [:child, :out] }
|
||||
if Hash === command.last
|
||||
opt.update(command.last)
|
||||
cmds = command[0...-1]
|
||||
else
|
||||
cmds = command.dup
|
||||
end
|
||||
system(*(cmds << opt))
|
||||
end
|
||||
|
||||
class << self
|
||||
extend Gem::Deprecate
|
||||
|
||||
rubygems_deprecate :silent_system
|
||||
end
|
||||
|
||||
##
|
||||
# Enumerates the parents of +directory+.
|
||||
|
||||
|
||||
@ -13,17 +13,6 @@ class TestGemUtil < Gem::TestCase
|
||||
end
|
||||
end
|
||||
|
||||
def test_silent_system
|
||||
pend if Gem.java_platform?
|
||||
Gem::Deprecate.skip_during do
|
||||
out, err = capture_output do
|
||||
Gem::Util.silent_system(*ruby_with_rubygems_in_load_path, "-e", 'puts "hello"; warn "hello"')
|
||||
end
|
||||
assert_empty out
|
||||
assert_empty err
|
||||
end
|
||||
end
|
||||
|
||||
def test_traverse_parents
|
||||
FileUtils.mkdir_p "a/b/c"
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user