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 138 138: def initialize(string = '') 139: @tempfile = Tempfile.new "TempIO-#{@@count += 1}" 140: @tempfile.binmode 141: @tempfile.write string 142: @tempfile.rewind 143: end
# File lib/rubygems/test_utilities.rb, line 145 145: def method_missing(meth, *args, &block) 146: @tempfile.send(meth, *args, &block) 147: end