class ThreadOut
Public Class Methods
new(out)
click to toggle source
# File lib/common/ext/stdout.rb, line 6 def initialize(out) @out = out end
Public Instance Methods
flush()
click to toggle source
# File lib/common/ext/stdout.rb, line 43 def flush if Thread.current[:stdout] then Thread.current[:stdout].flush else begin @out.flush rescue Exception end end end
print(stuff='')
click to toggle source
# File lib/common/ext/stdout.rb, line 32 def print(stuff='') if Thread.current[:stdout] then Thread.current[:stdout].puts stuff else begin @out.print stuff rescue Exception end end end
puts(stuff='')
click to toggle source
# File lib/common/ext/stdout.rb, line 21 def puts(stuff='') if Thread.current[:stdout] then Thread.current[:stdout].puts stuff else begin @out.puts stuff rescue Exception end end end
write(stuff='')
click to toggle source
# File lib/common/ext/stdout.rb, line 10 def write(stuff='') if Thread.current[:stdout] then Thread.current[:stdout].write stuff else begin @out.write stuff rescue Exception end end end