class Webgen::LoadError
This error is raised when a needed library is not found.
Attributes
gem[R]
The name of the Rubygem that provides the missing library.
library[R]
The name of the library that is missing.
Public Class Methods
new(library_or_error, location = nil, path = nil, gem = nil)
click to toggle source
Create a new LoadError.
If library_or_error is a String, it is treated as the missing
library name and an approriate error message is created. If it is an
exception, the exception is wrapped.
Calls superclass method
Webgen::Error.new
# File lib/webgen/error.rb, line 112 def initialize(library_or_error, location = nil, path = nil, gem = nil) if library_or_error.kind_of?(String) msg = "The needed library '#{library_or_error}' is missing." msg << " You can install it with rubygems by running 'gem install #{gem}'!" if gem super(msg, location, path) @library = library_or_error else super(library_or_error, location, path) @library = nil end @gem = gem end