Class: Eclair::LessViewer::ColorPP

Inherits:
PP
  • Object
show all
Defined in:
lib/eclair/less_viewer.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.pp(obj, out = $>, width = 79) ⇒ Object



6
7
8
9
10
11
# File 'lib/eclair/less_viewer.rb', line 6

def self.pp(obj, out = $>, width = 79)
  q = ColorPP.new(out, width)
  q.guard_inspect_key { q.pp obj }
  q.flush
  out << "\n"
end

Instance Method Details

#text(str, width = str.length) ⇒ Object



13
14
15
# File 'lib/eclair/less_viewer.rb', line 13

def text(str, width = str.length)
  super(CodeRay.scan(str, :ruby).term, width)
end