diff options
Diffstat (limited to 'lib/tempfile.rb')
-rw-r--r-- | lib/tempfile.rb | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/lib/tempfile.rb b/lib/tempfile.rb index a0c7f4cf3f..fd03b2ccc8 100644 --- a/lib/tempfile.rb +++ b/lib/tempfile.rb @@ -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 |