diff options
author | Eric Wong <normalperson@yhbt.net> | 2013-08-26 00:09:32 +0000 |
---|---|---|
committer | Eric Wong <normalperson@yhbt.net> | 2013-08-26 00:09:32 +0000 |
commit | a1198562c51c5374a85d74e1cfe9e6a695384a3d (patch) | |
tree | 0a7cb6480c144da6363a74e8adf75a73b2ba204d /lib/dtas/process.rb | |
parent | 5a966a1ec8662d2e0b9035675a770c6f2c739b7d (diff) | |
download | dtas-a1198562c51c5374a85d74e1cfe9e6a695384a3d.tar.gz |
Shellwords.join is an identical method and there's no reason not to use it.
Diffstat (limited to 'lib/dtas/process.rb')
-rw-r--r-- | lib/dtas/process.rb | 9 |
1 files changed, 1 insertions, 8 deletions
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 |