Sha256: 43924008082f448ddc661e11f231481b0f4f06fc4270b8cdf51671d4a3309e60

Contents?: true

Size: 438 Bytes

Versions: 2

Compression:

Stored size: 438 Bytes

Contents

#
# File::      Silently.rb
# Author::    wkm
# Copyright:: 2009
# License::   GPL
#
# Implements a silently method for executing code without warnings; intended for
# wrapping around require statements
#



# this is sourced directly from
# http://vidyapsi.wordpress.com/category/ruby/#warnings

def silently(&block)
  warn_level = $VERBOSE
  $VERBOSE = nil

  result = block.call

  $VERBOSE = warn_level
  result
end

# /end sourcing

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
sitefuel-0.0.0b lib/sitefuel/extensions/Silently.rb
sitefuel-0.0.0a lib/sitefuel/extensions/Silently.rb