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



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

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: "")


16
17
18
# File 'lib/inch/cli/trace_helper.rb', line 16

def trace(text = "")
  puts text
end

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



20
21
22
23
# File 'lib/inch/cli/trace_helper.rb', line 20

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