Sha256: 72174c690672427fc1ba2c40f412ab465dcf73d99132c62d9b0ed6c34ba02064
Contents?: true
Size: 465 Bytes
Versions: 1
Compression:
Stored size: 465 Bytes
Contents
require 'benchmark' require 'open3' module FrontKick class Command def self.exec(*cmd) stdout = nil stderr = nil exit_code = nil duration = Benchmark.realtime do Open3.popen3(*cmd) do |stdin, out, err, wait_thr| stdout = out.read stderr = err.read exit_code = wait_thr.value.exitstatus end end CommandResult.new(stdout, stderr, exit_code, duration) end end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
frontkick-0.0.1 | lib/frontkick/command.rb |