Sha256: 8807cd2cc6e7561f56b54eba6199acf2111e9cf03841b545d548e00a2a596ed5

Contents?: true

Size: 303 Bytes

Versions: 9

Compression:

Stored size: 303 Bytes

Contents

# Ruby may implement #puts with two calls to #print: One for the
# value, and one for the new-line.  Do that, in order to flush
# out thread-safety bugs.

class ThreadUnsafeStringIO < StringIO
  def puts(*args)
    args.each do |arg|
      print arg
      Thread.pass
      print "\n"
    end
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
cute_print-1.1.4 test_support/thread_unsafe_string_io.rb
cute_print-1.1.3 test_support/thread_unsafe_string_io.rb
cute_print-1.1.2 test_support/thread_unsafe_string_io.rb
cute_print-1.1.1 test_support/thread_unsafe_string_io.rb
cute_print-1.1.0 test_support/thread_unsafe_string_io.rb
cute_print-1.0.1 test_support/thread_unsafe_string_io.rb
cute_print-1.0.0 test_support/thread_unsafe_string_io.rb
cute_print-0.4.0 test_support/thread_unsafe_string_io.rb
cute_print-0.3.0 test_support/thread_unsafe_string_io.rb