about summary refs log tree commit homepage
path: root/lib/dtas.rb
diff options
context:
space:
mode:
authorEric Wong <e@80x24.org>2015-09-06 23:15:36 +0000
committerEric Wong <e@80x24.org>2015-09-06 23:16:43 +0000
commit856b1c7064155e59c84942a7e8cd36128b6be34e (patch)
treec45027bedec2caa280c26c815f45a8f4d1b8a120 /lib/dtas.rb
parentc3bb7810709a99a9886c7f96aed6fa62690a12cb (diff)
downloaddtas-856b1c7064155e59c84942a7e8cd36128b6be34e.tar.gz
This allows us to avoid wasting time reopening the same
device over and over again.
Diffstat (limited to 'lib/dtas.rb')
-rw-r--r--lib/dtas.rb5
1 files changed, 5 insertions, 0 deletions
diff --git a/lib/dtas.rb b/lib/dtas.rb
index f11d549..0b704ca 100644
--- a/lib/dtas.rb
+++ b/lib/dtas.rb
@@ -13,6 +13,11 @@ module DTAS # :nodoc:
       Time.now.to_f
     end
   end
+
+  @null = nil
+  def self.null
+    @null ||= File.open('/dev/null', 'r+')
+  end
 end
 
 require_relative 'dtas/compat_onenine'