Sha256: 86fdf25bebf4401eda3a24aba60b2fb1d9357cd49b6bcafadfb41bae7e8c36d1
Contents?: true
Size: 581 Bytes
Versions: 12
Compression:
Stored size: 581 Bytes
Contents
require 'thread' module Drydock module Screen extend self @@mutex = Mutex.new @@output = StringIO.new @@offset = 0 def print(*msg) @@mutex.synchronize do @@output.print *msg end end def puts(*msg) @@mutex.synchronize do @@output.puts *msg end end def flush @@mutex.synchronize do #return if @@offset == @@output.tell @@output.seek @@offset STDOUT.puts @@output.read unless @@output.eof? @@offset = @@output.tell end end end end
Version data entries
12 entries across 12 versions & 3 rubygems