Class: Uttk::Dumpers::BasicColor

Inherits:
Dumper show all
Includes:
Concrete
Defined in:
lib/uttk/dumpers/BasicColor.rb

Instance Attribute Summary

Attributes inherited from Dumper

#options

Instance Method Summary collapse

Methods inherited from Dumper

#<<, #each_output, #flush, #print, #puts

Constructor Details

#initialize(*a, &b) ⇒ BasicColor

Returns a new instance of BasicColor.



14
15
16
17
18
# File 'lib/uttk/dumpers/BasicColor.rb', line 14

def initialize ( *a, &b )
  super
  raise "HighLine not available" unless defined? HighLine
  @h = HighLine.new(nil, self)
end

Instance Method Details

#update(*a, &b) ⇒ Object



20
21
22
23
24
25
26
27
28
29
# File 'lib/uttk/dumpers/BasicColor.rb', line 20

def update ( *a, &b )
  super
  msg, path, node, options = a
  path = Logger::Path.new(path) unless path.nil?
  @h.say "#{@h.color msg.inspect.ljust(10), :red} " +
         "#{@h.color path.inspect, :green} " +
         "#{@h.color node.inspect, :magenta} " +
         "#{@h.color options.inspect, :yellow} " +
         "<%=color 'block_given: #{not b.nil?}', :cyan %>"
end