diff options
Diffstat (limited to 'lib/tempfile.rb')
-rw-r--r-- | lib/tempfile.rb | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/lib/tempfile.rb b/lib/tempfile.rb index 66d96200b5..78b770c5a4 100644 --- a/lib/tempfile.rb +++ b/lib/tempfile.rb @@ -12,7 +12,7 @@ require 'delegate' require 'final' -class Tempfile < SimpleDelegater +class Tempfile < SimpleDelegator Max_try = 10 def initialize(basename, tmpdir = '/tmp') @@ -70,3 +70,12 @@ class Tempfile < SimpleDelegater end end end + +if __FILE__ == $0 + f = Tempfile.new("foo") + f.print("foo\n") + f.close + f.open + p f.gets # => "foo\n" + f.close(true) +end |