Top Level Namespace

Defined Under Namespace

Modules: Webgen Classes: Hash, Rainpress

Instance Method Summary collapse

Instance Method Details

#webgen_require(library, gem = library) ⇒ Object

Require the given library but handle a possible loading error more gracefully.

The parameter gem (which defaults to library) should be set to the Rubygem that provides the library or to nil if no such Rubygem exists.



9
10
11
12
13
# File 'lib/webgen/core_ext.rb', line 9

def webgen_require(library, gem = library)
  require library
rescue LoadError
  raise Webgen::LoadError.new(library, self.class.name, nil, gem)
end