module Shell private def run(command) puts "--> #{command}" if (!system(command)) raise "error running command: #{command}" end end def run_command(full_command) if (@command_runner) @command_runner.call(full_command) else run(full_command) end end def check_directory(path) raise "#{path} is not a directory" unless File.directory? path return path end def get_environment(name) value = ENV[name] raise "#{name} is not set" unless value return value end def get_environment_or_default(name, default_value='') value = ENV[name] value = default_value if not value return value end end class SystemCommandRunner end