Class: Uttk::Dumpers::BasicColor
- Inherits:
-
Dumper
- Object
- Logger::Backend
- Dumper
- Uttk::Dumpers::BasicColor
- Includes:
- Concrete
- Defined in:
- lib/uttk/dumpers/BasicColor.rb
Instance Attribute Summary
Attributes inherited from Dumper
Instance Method Summary collapse
-
#initialize(*a, &b) ⇒ BasicColor
constructor
A new instance of BasicColor.
- #update(*a, &b) ⇒ Object
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, = 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 .inspect, :yellow} " + "<%=color 'block_given: #{not b.nil?}', :cyan %>" end |