Module: ScriptRunner

Defined in:
lib/script-runner.rb,
lib/script-runner/cmds.rb,
lib/script-runner/main.rb,
lib/script-runner/version.rb

Defined Under Namespace

Modules: Commands Classes: Main

Constant Summary collapse

VERSION =
"0.0.7"

Class Method Summary collapse

Class Method Details

.run(paths, env_vars, options = {}, &block) ⇒ Object

Run a set of scripts

Note: non executable files are skipped and a warning is sent to the console

– :error_handler - a lambda that gets passed the script file path that exited with a non zero value – :log_level - one of :debug, :info, :warn, :errror



16
17
18
19
20
21
# File 'lib/script-runner.rb', line 16

def self.run( paths, env_vars, options = {}, &block)
  logger = options[:logger] || get_logger(options[:log_level])
  runner = ScriptRunner::Main.new(logger)
  error_handler = options[:error_handler]
  runner.run(paths, env_vars, error_handler, &block)
end