Class: Croaky::Stream::StdErrStream

Inherits:
Object
  • Object
show all
Includes:
IO::IoCapturable
Defined in:
lib/croaky/stream/std_err_stream.rb

Overview

Standard error stream

Direct Known Subclasses

JavaStdErrStream

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#stderr_str_ioObject

Returns the value of attribute stderr_str_io.



13
14
15
# File 'lib/croaky/stream/std_err_stream.rb', line 13

def stderr_str_io
  @stderr_str_io
end

Instance Method Details

#capture_ioObject



15
16
17
18
# File 'lib/croaky/stream/std_err_stream.rb', line 15

def capture_io
  self.stderr_str_io = StringIO.new
  $stderr = stderr_str_io
end

#read_captured_ioObject



24
25
26
# File 'lib/croaky/stream/std_err_stream.rb', line 24

def read_captured_io
  [stderr_str_io.string]
end

#restore_ioObject



20
21
22
# File 'lib/croaky/stream/std_err_stream.rb', line 20

def restore_io
  $stderr = STDERR
end