Skip to content

Instantly share code, notes, and snippets.

@nuna
Created August 18, 2010 12:26
Show Gist options
  • Save nuna/534529 to your computer and use it in GitHub Desktop.
Save nuna/534529 to your computer and use it in GitHub Desktop.
require 'tempfile'
def tempwrite
f = Tempfile.new('temp')
f.puts 'nihanihanihanihatorigairu'
f.close
return f
end
temp = tempwrite
GC.start
File.open(temp.path) do |f|
puts f.gets
end
#=> nihanihanihanihatorigairu
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment