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 win32console

Instance Method Summary collapse

Constructor Details

#initialize(kernel, stdout) ⇒ ColorIO

Returns a new instance of ColorIO.



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

def initialize(kernel, stdout)
  @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