Sha256: c7192224ede8b980ef4098d0d038f857d99818ca6debbf20799154b70f6c27e6

Contents?: true

Size: 601 Bytes

Versions: 28

Compression:

Stored size: 601 Bytes

Contents

module Webrat
  module Selenium
    module SilenceStream
      # active_support already defines silence_stream, no need to do that again if it's already present.
      # http://github.com/rails/rails/blob/master/activesupport/lib/active_support/core_ext/kernel/reporting.rb
      unless Kernel.respond_to?(:silence_stream)
        def silence_stream(stream)
          old_stream = stream.dup
          stream.reopen(RUBY_PLATFORM =~ /mswin/ ? 'NUL:' : '/dev/null')
          stream.sync = true
          yield
        ensure
          stream.reopen(old_stream)
        end
      end
    end
  end
end

Version data entries

28 entries across 28 versions & 14 rubygems

Version Path
radiant-1.0.0 ruby-debug/ruby/1.8/gems/webrat-0.7.3/lib/webrat/selenium/silence_stream.rb
indirect-webrat-0.7.5 lib/webrat/selenium/silence_stream.rb
indirect-webrat-0.7.4 lib/webrat/selenium/silence_stream.rb
webrat-0.7.3 lib/webrat/selenium/silence_stream.rb
jbd-webrat-0.7.2.rails3 lib/webrat/selenium/silence_stream.rb
webrat-0.7.2 lib/webrat/selenium/silence_stream.rb
webrat-0.7.2.beta.2 lib/webrat/selenium/silence_stream.rb
mutle-webrat-0.7.2.beta.1 lib/webrat/selenium/silence_stream.rb
thoughtbot-webrat-0.7.2.pre lib/webrat/selenium/silence_stream.rb
webrat-0.7.2.beta.1 lib/webrat/selenium/silence_stream.rb
honkster-webrat-0.7.1.2 lib/webrat/selenium/silence_stream.rb
honkster-webrat-0.7.1.1 lib/webrat/selenium/silence_stream.rb
revo-webrat-0.7.0.1 lib/webrat/selenium/silence_stream.rb
webrat-0.7.1 lib/webrat/selenium/silence_stream.rb
davidtrogers-webrat-0.7.0 lib/webrat/selenium/silence_stream.rb
revo-webrat-0.7.0 lib/webrat/selenium/silence_stream.rb
revo-webrat-0.7.1.pre lib/webrat/selenium/silence_stream.rb
webrat-0.7.0 lib/webrat/selenium/silence_stream.rb
honkster-webrat-0.6.0.10 lib/webrat/selenium/silence_stream.rb
honkster-webrat-0.6.0.9 lib/webrat/selenium/silence_stream.rb