Namespace for classes and methods that provide common functionality.
Return the constant object for the given absolute constant name.
# File lib/webgen/common.rb, line 11 11: def self.const_for_name(name) 12: name.split('::').inject(Object) {|b,n| b.const_get(n)} 13: end
Return the file name where the error occured.
# File lib/webgen/common.rb, line 21 21: def self.error_file(error) 22: (error.is_a?(::SyntaxError) ? error.message : error.backtrace[0]).scan(/(?:^|\s)(.*?):(\d+)/).first.first 23: end
Return the error line by inspecting the backtrace of the given error instance.
# File lib/webgen/common.rb, line 16 16: def self.error_line(error) 17: (error.is_a?(::SyntaxError) ? error.message : error.backtrace[0]).scan(/:(\d+)/).first.first.to_i rescue nil 18: end
Disabled; run with --debug to generate this.
Generated with the Darkfish Rdoc Generator 1.1.6.