From a1198562c51c5374a85d74e1cfe9e6a695384a3d Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Mon, 26 Aug 2013 00:09:32 +0000 Subject: process: remove redundant "xs" method Shellwords.join is an identical method and there's no reason not to use it. --- lib/dtas/process.rb | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) (limited to 'lib/dtas/process.rb') diff --git a/lib/dtas/process.rb b/lib/dtas/process.rb index 3f1dc07..c19b5c5 100644 --- a/lib/dtas/process.rb +++ b/lib/dtas/process.rb @@ -18,12 +18,6 @@ module DTAS::Process # :nodoc: end while true end - # a convienient way to display commands so it's easy to - # read, copy and paste to a shell - def xs(cmd) - cmd.map { |w| Shellwords.escape(w) }.join(' ') - end - # for long-running processes (sox/play/ecasound filters) def dtas_spawn(env, cmd, opts) opts = { close_others: true, pgroup: true }.merge!(opts) @@ -87,10 +81,9 @@ module DTAS::Process # :nodoc: r.close _, status = Process.waitpid2(pid) return res if status.success? - raise RuntimeError, "`#{xs(cmd)}' failed: #{status.inspect}" + raise RuntimeError, "`#{Shellwords.join(cmd)}' failed: #{status.inspect}" end # XXX only for DTAS::Source::{Sox,Av}.try module_function :qx - module_function :xs end -- cgit v1.2.3-24-ge0c7