class Object

Public Instance Methods

webgen_require(library, gem = library) click to toggle source

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.

   # File lib/webgen/core_ext.rb
 8 def webgen_require(library, gem = library)
 9   require library
10 rescue LoadError
11   raise Webgen::LoadError.new(library, self.class.name, nil, gem)
12 end