Sha256: 0aa86c1de70dac24c20ba9c0ba3390d261a24b829e5d65b005da4ae1f73a7066

Contents?: true

Size: 399 Bytes

Versions: 8

Compression:

Stored size: 399 Bytes

Contents

# frozen_string_literal: true

require "okay/version"

module Okay
  ##
  # Helper functions for suppressing warnings when we know it's okay.
  module WarningHelpers
    def silence_warnings(&block)
      with_warnings(nil, &block)
    end

    def with_warnings(flag, &_block)
      old_verbose = $VERBOSE
      $VERBOSE = flag
      yield
    ensure
      $VERBOSE = old_verbose
    end
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
okay-12.0.4 lib/okay/warning_helpers.rb
okay-12.0.3 lib/okay/warning_helpers.rb
okay-12.0.2 lib/okay/warning_helpers.rb
okay-12.0.1 lib/okay/warning_helpers.rb
okay-12.0.0 lib/okay/warning_helpers.rb
okay-11.0.0 lib/okay/warning_helpers.rb
okay-10.0.0 lib/okay/warning_helpers.rb
okay-9.0.0 lib/okay/warning_helpers.rb