1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

* lib/tempfile.rb: Merge from 1.7: Add Tempfile#size.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_6@2845 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
knu 2002-09-11 07:17:18 +00:00
parent dba42e07b5
commit ec35b84429
2 changed files with 13 additions and 0 deletions

View file

@ -85,6 +85,15 @@ class Tempfile < SimpleDelegator
def path
@tmpname
end
def size
if @tmpfile
@tmpfile.flush
@tmpfile.stat.size
else
0
end
end
end
if __FILE__ == $0