Sha256: d2ee6bcbb147d493591c32df283e3f032521acf2ea545437bcfc5e788522fc1e
Contents?: true
Size: 514 Bytes
Versions: 11
Compression:
Stored size: 514 Bytes
Contents
require 'tempfile' module CommandLine def run command output = Tempfile.new("child") Dir.chdir SCRATCH do process = ChildProcess.build(*("#{command}".split(' '))) process.detach process.io.stdout = output process.io.stderr = output process.start wait_until(:timeout_after => 30.seconds) { process.exited? } end File.read(output.path) end def normalise text text.gsub(/[\n]/, ' ').gsub(/\s+/, ' ').strip end end World CommandLine include CommandLine
Version data entries
11 entries across 11 versions & 1 rubygems