Class: Cucumber::Formatter::ColorIO

Inherits:
Object
  • Object
show all
Extended by:
Forwardable
Defined in:
lib/cucumber/formatter/color_io.rb

Overview

Adapter to make #puts/#print/#flush work with colours on Windows

Instance Method Summary collapse

Constructor Details

#initializeColorIO

Returns a new instance of ColorIO.



11
12
13
14
# File 'lib/cucumber/formatter/color_io.rb', line 11

def initialize
  @kernel = Kernel
  @stdout = STDOUT
end

Instance Method Details

#<<(output) ⇒ Object

Ensure using << still gets colours in win32console



17
18
19
20
# File 'lib/cucumber/formatter/color_io.rb', line 17

def <<(output)
  print(output)
  self
end