| Class | Webgen::LoadError |
| In: |
lib/webgen/error.rb
|
| Parent: | Error |
This error is raised when a needed library is not found.
| gem | [R] | The name of the Rubygem that provides the missing library. |
| library | [R] | The name of the library that is missing. |
Create a new LoadError using the provided values.
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.
# File lib/webgen/error.rb, line 103
103: def initialize(library_or_error, class_name = nil, alcn = nil, gem = nil)
104: if library_or_error.kind_of?(String)
105: msg = "The needed library '#{library_or_error}' is missing."
106: msg += " You can install it via rubygems with 'gem install #{gem}'!" if gem
107: super(msg, class_name, alcn)
108: @library = library_or_error
109: else
110: super(library_or_error, class_name, alcn)
111: @library = nil
112: end
113: @gem = gem
114: end