aboutsummaryrefslogtreecommitdiffstats
path: root/sample
diff options
context:
space:
mode:
authorhsbt <hsbt@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2014-07-23 19:44:23 +0000
committerhsbt <hsbt@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2014-07-23 19:44:23 +0000
commita7f672a17e64851af284d356791d01c76fded6e2 (patch)
treeb359c8c00712147191b4946825bfbdecaffa95c3 /sample
parent31f2d1d7eba3030474fd79b48f19b3d77e2d8ded (diff)
downloadruby-a7f672a17e64851af284d356791d01c76fded6e2.tar.gz
* 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
Diffstat (limited to 'sample')
-rw-r--r--sample/tempfile.rb8
1 files changed, 8 insertions, 0 deletions
diff --git a/sample/tempfile.rb b/sample/tempfile.rb
new file mode 100644
index 0000000000..5a363614a3
--- /dev/null
+++ b/sample/tempfile.rb
@@ -0,0 +1,8 @@
+require 'tempfile'
+
+f = Tempfile.new("foo")
+f.print("foo\n")
+f.close
+f.open
+p f.gets # => "foo\n"
+f.close!