class Tryouts
def library(name=nil, *path)
library __FILE__, '..', 'lib'
library '/an/absolute/path'
in specified in multiple arguments they are joined and expanded.
a specific copy of the library. Otherwise, it loads from the system path. If the path
* +path+ Add a path to the front of $LOAD_PATH (optional). Use this if you want to load
* +name+ The name of the library in question (required). Stored as a Symbol to +@library+.
Require +name+. If +path+ is supplied, it will "require path".
def library(name=nil, *path) return @library if name.nil? @library, @dtype = name.to_sym, :api path = File.expand_path(File.join *path) $LOAD_PATH.unshift path unless path.nil? begin require @library.to_s rescue LoadError => ex newex = Tryouts::Exception.new(ex.message) trace = ex.backtrace trace.unshift @paths.last newex.set_backtrace trace @errors << newex Tryouts.failed = true rescue SyntaxError, Exception, TypeError, RuntimeError, NoMethodError, NameError => ex @errors << ex Tryouts.failed = true end end