Try to laod the given library using the built-in require, but do
not raise a LoadError if unsuccessful. Returns true
if the
library was successfully loaded; returns false
otherwise.
If a gemname is given, then the “gem gemname” command will be called before the library is loaded.
# File lib/webby.rb, line 142 def try_require( lib, gemname = nil ) gem gemname unless gemname.nil? require lib true rescue LoadError false end