Sha256: 79aae03e1f5a4af55b5a482aa46fc0c831cb3a7c0b0bdb5789c054efaeb5c5d0

Contents?: true

Size: 493 Bytes

Versions: 27

Compression:

Stored size: 493 Bytes

Contents

# Kernel#with_warnings_suppressed - Supresses warnings in a given block.
# Require this file to use it or run it directly to perform a self-test.
# 
# Author:: Rob Pitt
# Copyright:: Copyright (c) 2008 Rob Pitt
# License:: Free to use and modify so long as credit to previous author(s) is left in place.
#

module Kernel
  # Suppresses warnings within a given block.
  def with_warnings_suppressed
    saved_verbosity = $-v
    $-v = nil
    yield
  ensure
    $-v = saved_verbosity
  end
end

Version data entries

27 entries across 27 versions & 1 rubygems

Version Path
ruby-fs-stack-0.5.3 lib/ruby-fs-stack/warning_suppressor.rb
ruby-fs-stack-0.5.2 lib/ruby-fs-stack/warning_suppressor.rb
ruby-fs-stack-0.5.1 lib/ruby-fs-stack/warning_suppressor.rb
ruby-fs-stack-0.5.0 lib/ruby-fs-stack/warning_suppressor.rb
ruby-fs-stack-0.4.12 lib/ruby-fs-stack/warning_suppressor.rb
ruby-fs-stack-0.4.11 lib/ruby-fs-stack/warning_suppressor.rb
ruby-fs-stack-0.4.10 lib/ruby-fs-stack/warning_suppressor.rb
ruby-fs-stack-0.4.9 lib/ruby-fs-stack/warning_suppressor.rb
ruby-fs-stack-0.4.8 lib/ruby-fs-stack/warning_suppressor.rb
ruby-fs-stack-0.4.7 lib/ruby-fs-stack/warning_suppressor.rb
ruby-fs-stack-0.4.6 lib/ruby-fs-stack/warning_suppressor.rb
ruby-fs-stack-0.4.5 lib/ruby-fs-stack/warning_suppressor.rb
ruby-fs-stack-0.4.4 lib/ruby-fs-stack/warning_suppressor.rb
ruby-fs-stack-0.4.3 lib/ruby-fs-stack/warning_suppressor.rb
ruby-fs-stack-0.4.2 lib/ruby-fs-stack/warning_suppressor.rb
ruby-fs-stack-0.4.0 lib/ruby-fs-stack/warning_suppressor.rb
ruby-fs-stack-0.3.3 lib/ruby-fs-stack/warning_suppressor.rb
ruby-fs-stack-0.3.2 lib/ruby-fs-stack/warning_suppressor.rb
ruby-fs-stack-0.3.0 lib/ruby-fs-stack/warning_suppressor.rb
ruby-fs-stack-0.2.6 lib/ruby-fs-stack/warning_suppressor.rb