module Scripto::PrintCommands
Constants
- GREEN
- RED
- RESET
- YELLOW
Attributes
verbose[RW]
Public Instance Methods
fatal(str)
click to toggle source
Print a red error banner to $stderr, then exit.
# File lib/scripto/print_commands.rb, line 49 def fatal(str) banner(str, color: RED) exit(1) end
verbose!()
click to toggle source
verbose?()
click to toggle source
Is verbose mode turned on?
# File lib/scripto/print_commands.rb, line 11 def verbose? !!@verbose end
vprintf(str, *args)
click to toggle source
Printf to $stderr, but only if verbose?
.
# File lib/scripto/print_commands.rb, line 32 def vprintf(str, *args) $stderr.printf(str, *args) if verbose? end
vputs(str = nil)
click to toggle source
Puts to $stderr, but only if verbose?
.
# File lib/scripto/print_commands.rb, line 27 def vputs(str = nil) $stderr.puts(str) if verbose? end
warning(str)
click to toggle source
Print a yellow warning banner to $stderr.
# File lib/scripto/print_commands.rb, line 44 def warning(str) banner("Warning: #{str}", color: YELLOW) end