Class | TempIO |
In: |
lib/rubygems/test_utilities.rb
|
Parent: | Object |
A StringIO duck-typed class that uses Tempfile instead of String as the backing store.
# File lib/rubygems/test_utilities.rb, line 109 109: def initialize(string = '') 110: @tempfile = Tempfile.new "TempIO-#{@@count += 1}" 111: @tempfile.binmode 112: @tempfile.write string 113: @tempfile.rewind 114: end
# File lib/rubygems/test_utilities.rb, line 116 116: def method_missing(meth, *args, &block) 117: @tempfile.send(meth, *args, &block) 118: end