Module: Inch::CLI::TraceHelper

Included in:
Command::Base, Command::Options::Base, Command::Output::Base, CommandParser
Defined in:
lib/inch/cli/trace_helper.rb

Instance Method Summary collapse

Instance Method Details

#debug(msg) ⇒ Object



4
5
6
7
8
9
# File 'lib/inch/cli/trace_helper.rb', line 4

def debug(msg)
  return unless ENV['DEBUG']
  msg.to_s.lines.each do |line|
    trace edged :dark, line.gsub(/\n$/,'').dark
  end
end

#trace(text = "") ⇒ void

This method returns an undefined value.

Writes the given text to stdout

Parameters:

  • text (String) (defaults to: "")


14
15
16
# File 'lib/inch/cli/trace_helper.rb', line 14

def trace(text = "")
  puts text
end

#trace_header(text, color, bg_color = nil) ⇒ Object



18
19
20
21
# File 'lib/inch/cli/trace_helper.rb', line 18

def trace_header(text, color, bg_color = nil)
  trace header(text, color, bg_color)
  trace if !use_color?
end