summaryrefslogtreecommitdiff
path: root/lib/tempfile.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/tempfile.rb')
-rw-r--r--lib/tempfile.rb9
1 files changed, 9 insertions, 0 deletions
diff --git a/lib/tempfile.rb b/lib/tempfile.rb
index a0c7f4c..fd03b2c 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