summaryrefslogtreecommitdiff
path: root/lib/tempfile.rb
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2010-05-01 13:54:01 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2010-05-01 13:54:01 +0000
commit5e02a28a8b5e6defca76c4f3ee76bc48f0ce67b2 (patch)
tree10a108ea86dc514019b01f42351998119464ba01 /lib/tempfile.rb
parent9ad152e55580b497cbba4c7a15d20cba8e3ef1f5 (diff)
* lib/tempfile.rb (Tempfile#size): stat by path name when it is
closed. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27578 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib/tempfile.rb')
-rwxr-xr-xlib/tempfile.rb2
1 files changed, 2 insertions, 0 deletions
diff --git a/lib/tempfile.rb b/lib/tempfile.rb
index 79dd5cc..c45865d 100755
--- a/lib/tempfile.rb
+++ b/lib/tempfile.rb
@@ -255,6 +255,8 @@ class Tempfile < DelegateClass(File)
if @tmpfile
@tmpfile.flush
@tmpfile.stat.size
+ elsif @tmpname
+ File.size(@tmpname)
else
0
end