Top Level Namespace

Defined Under Namespace

Modules: TFW

Instance Method Summary collapse

Instance Method Details

#silent_blockObject



125
126
127
128
129
130
131
132
133
# File 'lib/tfw.rb', line 125

def silent_block
  stderr, stdout = [STDERR, STDOUT].map(&:clone)
  [STDERR, STDOUT].each { |e| e.reopen File.new('/dev/null', 'w') }
  begin
    yield
  ensure
    { STDERR => stderr, STDOUT => stdout }.each { |k, v| k.reopen v }
  end
end

#tfw_load_module(&block) ⇒ Object



135
136
137
# File 'lib/tfw.rb', line 135

def tfw_load_module(&block)
  TFW.load_module(self, &block)
end