Sha256: f6e50f8bbcd4a6874548966cd5863d848bcdf8df5df5cab8c247491a81684d3e
Contents?: true
Size: 508 Bytes
Versions: 15
Compression:
Stored size: 508 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+/, ' ') end end World CommandLine include CommandLine
Version data entries
15 entries across 15 versions & 1 rubygems