Module: PiotrbCliUtils::Util
- Defined in:
- lib/piotrb_cli_utils/util.rb
Instance Method Summary collapse
Instance Method Details
#fail_with(*messages, code: 1) ⇒ Object
5 6 7 8 9 10 |
# File 'lib/piotrb_cli_utils/util.rb', line 5 def fail_with(*, code: 1) .each do || warn(Paint[, :red]) end exit code end |
#log(message, depth: 0, newline: true) ⇒ Object
12 13 14 15 16 17 18 19 |
# File 'lib/piotrb_cli_utils/util.rb', line 12 def log(, depth: 0, newline: true) = Array() .each do |m| indent = ' ' * depth print indent + m print "\n" if newline end end |