From a7f672a17e64851af284d356791d01c76fded6e2 Mon Sep 17 00:00:00 2001 From: hsbt Date: Wed, 23 Jul 2014 19:44:23 +0000 Subject: * 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 --- ChangeLog | 5 +++++ lib/tempfile.rb | 10 ---------- sample/tempfile.rb | 8 ++++++++ 3 files changed, 13 insertions(+), 10 deletions(-) create mode 100644 sample/tempfile.rb diff --git a/ChangeLog b/ChangeLog index eb6ed98244..9e3bf35a2e 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +Thu Jul 24 04:36:49 2014 SHIBATA Hiroshi + + * lib/tempfile.rb: split executable code into sample directory. + * sample/tempfile.rb: ditto. + Thu Jul 24 04:29:36 2014 SHIBATA Hiroshi * lib/pstore.rb: split executable code into sample directory. diff --git a/lib/tempfile.rb b/lib/tempfile.rb index 361d66491e..4fcd431ecd 100644 --- a/lib/tempfile.rb +++ b/lib/tempfile.rb @@ -381,13 +381,3 @@ def Tempfile.create(basename, *rest) tmpfile end end - -if __FILE__ == $0 -# $DEBUG = true - f = Tempfile.new("foo") - f.print("foo\n") - f.close - f.open - p f.gets # => "foo\n" - f.close! -end 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! -- cgit v1.2.3