1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00
ruby--ruby/sample/tempfile.rb
hsbt a7f672a17e * lib/tempfile.rb: split executable code into sample directory.
* sample/tempfile.rb: ditto.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@46920 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-07-23 19:44:23 +00:00

8 lines
107 B
Ruby

require 'tempfile'
f = Tempfile.new("foo")
f.print("foo\n")
f.close
f.open
p f.gets # => "foo\n"
f.close!