public Method

Kernel.rescue_require(sym, message = nil)

does a basic require, and prints the message passed as an optional second parameter if an error occurs.

Source Code

# File merb/core_ext/kernel.rb, line 84
def rescue_require(sym, message = nil)
  require sym
rescue LoadError, RuntimeError
  puts message if message
end
Comments

Have your say
Please use Textile formatting (click here for a cheat sheet). Use <code/> and <pre/> for code samples.
Click here to login with OpenID to to post comments.