From 856b1c7064155e59c84942a7e8cd36128b6be34e Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Sun, 6 Sep 2015 23:15:36 +0000 Subject: use a common /dev/null This allows us to avoid wasting time reopening the same device over and over again. --- lib/dtas/format.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'lib/dtas/format.rb') diff --git a/lib/dtas/format.rb b/lib/dtas/format.rb index a6314bd..cfcec64 100644 --- a/lib/dtas/format.rb +++ b/lib/dtas/format.rb @@ -44,9 +44,9 @@ class DTAS::Format # :nodoc: def self.precision(env, infile) # sox.git f4562efd0aa3 - qx(env, %W(soxi -p #{infile}), err: "/dev/null").to_i + qx(env, %W(soxi -p #{infile}), err: DTAS.null).to_i rescue # fallback to parsing the whole output - s = qx(env, %W(soxi #{infile}), err: "/dev/null") + s = qx(env, %W(soxi #{infile}), err: DTAS.null) s =~ /Precision\s+:\s*(\d+)-bit/n v = $1.to_i return v if v > 0 -- cgit v1.2.3-24-ge0c7