Sha256: 91adcee8bc86f7291c4d534a5749e4525c227c751b10a7c06f5955c50f417401

Contents?: true

Size: 270 Bytes

Versions: 9

Compression:

Stored size: 270 Bytes

Contents

# Adapted from
# activesupport/lib/active_support/core_ext/kernel/reporting.rb, line 44
class IO
  def silence_stream(&block)
    old_stream = dup
    self.reopen('/dev/null')
    self.sync = true
    yield
  ensure
    reopen(old_stream)
    old_stream.close
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
routemaster-client-1.2.3 core_ext/silence_stream.rb
routemaster-client-1.2.2 core_ext/silence_stream.rb
routemaster-client-1.2.1 core_ext/silence_stream.rb
routemaster-client-1.2.0 core_ext/silence_stream.rb
routemaster-client-1.1.0 core_ext/silence_stream.rb
routemaster-client-1.0.0 core_ext/silence_stream.rb
routemaster-client-0.0.3 core_ext/silence_stream.rb
routemaster-client-0.0.2 core_ext/silence_stream.rb
routemaster-client-0.0.1 core_ext/silence_stream.rb