module ConfigmonkeyCli::Application::OutputHelper

Public Instance Methods

abort(msg, exit_code = 1) click to toggle source
# File lib/configmonkey_cli/application/output_helper.rb, line 20
def abort msg, exit_code = 1
  puts c("[ABORT] #{msg}", :red)
  exit(exit_code)
end
debug(msg, lvl = 1) click to toggle source
# File lib/configmonkey_cli/application/output_helper.rb, line 16
def debug msg, lvl = 1
  puts c("[DEBUG] #{msg}", :black) if @opts[:debug] && @opts[:debug] >= lvl
end
error(msg) click to toggle source
# File lib/configmonkey_cli/application/output_helper.rb, line 25
def error msg
  warn c(msg, :red)
end
print(*a) click to toggle source
puts(*a) click to toggle source
# File lib/configmonkey_cli/application/output_helper.rb, line 4
def puts *a
  sync { @opts[:stdout].send(:puts, *a) }
end
warn(*a) click to toggle source
# File lib/configmonkey_cli/application/output_helper.rb, line 12
def warn *a
  sync { @opts[:stdout].send(:warn, *a) }
end