Top Level Namespace
Defined Under Namespace
Modules: RandomVariable
Instance Method Summary collapse
-
#required_gem(name) ⇒ Object
Attemps to require the gem denoted by
name
, otherwise it displays an error message and exits.
Instance Method Details
#required_gem(name) ⇒ Object
Attemps to require the gem denoted by name
, otherwise it displays an error message and exits
18 19 20 21 22 23 24 25 26 27 |
# File 'lib/tests/common.rb', line 18 def required_gem(name) begin require name rescue LoadError # 'rescue' only rescues StandardError without args abort("Gem '#{name}' required in order to work properly, " + "please install the required gem and try again.\n" + "\tThe installation is usually done as follows:\n" + "\t\tgem install #{name}"); end end |