Welcome to mirror list, hosted at ThFree Co, Russian Federation.

reporting.rb « support « test - github.com/twbs/bootstrap-rubygem.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 1d473634fced31402be6ba3f71ddde3cbe644b15 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
module Kernel
  def silence_stdout_if(cond, &run)
    silence_stream_if(cond, STDOUT, &run)
  end

  def silence_stderr_if(cond, &run)
    silence_stream_if(cond, STDERR, &run)
  end

  def silence_stream_if(cond, stream, &run)
    if cond
      silence_stream(stream, &run)
    else
      run.call
    end
  end
end