silent_system(*command)
public
Invokes system, but silences all output.
# File lib/rubygems/util.rb, line 72
def self.silent_system *command
require 'thread'
@silent_mutex ||= Mutex.new
null_device = Gem.win_platform? ? 'NUL' : '/dev/null'
@silent_mutex.synchronize do
begin
stdout = STDOUT.dup
stderr = STDERR.dup
STDOUT.reopen null_device, 'w'
STDERR.reopen null_device, 'w'
return system(*command)
ensure
STDOUT.reopen stdout
STDERR.reopen stderr
end
end
end