Class: RSpec::Multicore::ProxyIO
- Inherits:
-
Object
- Object
- RSpec::Multicore::ProxyIO
- Defined in:
- lib/rspec/multicore/reporter_bridge.rb
Overview
Sends worker stdout and stderr through the same ordered event writer.
Instance Method Summary collapse
- #<<(data) ⇒ Object
- #close ⇒ Object
- #closed? ⇒ Boolean
- #flush ⇒ Object
-
#initialize(writer, stream) ⇒ ProxyIO
constructor
A new instance of ProxyIO.
- #print(*args) ⇒ Object
- #printf(format, *args) ⇒ Object
- #puts(*args) ⇒ Object
- #sync ⇒ Object
- #sync=(_value) ⇒ Object
- #tty? ⇒ Boolean (also: #isatty)
- #write(data) ⇒ Object
Constructor Details
#initialize(writer, stream) ⇒ ProxyIO
Returns a new instance of ProxyIO.
196 197 198 199 |
# File 'lib/rspec/multicore/reporter_bridge.rb', line 196 def initialize(writer, stream) @writer = writer @stream = stream end |
Instance Method Details
#<<(data) ⇒ Object
209 |
# File 'lib/rspec/multicore/reporter_bridge.rb', line 209 def <<(data) = write(data).then { self } |
#close ⇒ Object
222 |
# File 'lib/rspec/multicore/reporter_bridge.rb', line 222 def close = nil |
#closed? ⇒ Boolean
223 |
# File 'lib/rspec/multicore/reporter_bridge.rb', line 223 def closed? = false |
#flush ⇒ Object
210 |
# File 'lib/rspec/multicore/reporter_bridge.rb', line 210 def flush = self |
#print(*args) ⇒ Object
211 |
# File 'lib/rspec/multicore/reporter_bridge.rb', line 211 def print(*args) = args.each { write(_1) }.then { nil } |
#printf(format, *args) ⇒ Object
212 |
# File 'lib/rspec/multicore/reporter_bridge.rb', line 212 def printf(format, *args) = write(format % args).then { nil } |
#puts(*args) ⇒ Object
213 |
# File 'lib/rspec/multicore/reporter_bridge.rb', line 213 def puts(*args) = (args.empty? ? write("\n") : args.each { write("#{_1}\n") }).then { nil } |
#sync ⇒ Object
216 |
# File 'lib/rspec/multicore/reporter_bridge.rb', line 216 def sync = true |
#sync=(_value) ⇒ Object
218 219 220 |
# File 'lib/rspec/multicore/reporter_bridge.rb', line 218 def sync=(_value) true end |
#tty? ⇒ Boolean Also known as: isatty
214 |
# File 'lib/rspec/multicore/reporter_bridge.rb', line 214 def tty? = false |
#write(data) ⇒ Object
201 202 203 204 205 206 207 |
# File 'lib/rspec/multicore/reporter_bridge.rb', line 201 def write(data) value = data.to_s return 0 if value.empty? @writer.emit(@stream, value) value.bytesize end |