Sha256: 5fb806b1068f61f057348f73f691d131e752bc847e868d7da58204c4a9197acb
Contents?: true
Size: 766 Bytes
Versions: 17
Compression:
Stored size: 766 Bytes
Contents
module SolrWrapper # Runs a command using popen4 (typically for JRuby) class Popen4Runner < Runner def run(stringio) pid, input, output, error = IO.popen4(command) if config.verbose? && !silence_output? IO.copy_stream(output, $stderr) IO.copy_stream(error, $stderr) else IO.copy_stream(output, stringio) IO.copy_stream(error, stringio) end input.close output.close error.close exit_status = Process.waitpid2(pid).last stringio.rewind exit_status end private def command env_str + ' ' + argument_list.join(' ') end def env_str config.env.map { |k, v| "#{Shellwords.escape(k)}=#{Shellwords.escape(v)}" }.join(' ') end end end
Version data entries
17 entries across 17 versions & 2 rubygems