Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def run( cmd )
- # set self.cmd to the passed in param, directly, stripping any '\n. as we do.
- self.cmd = cmd
- @@bash.execute "#{self.cmd}", :stdout => @@stdout, :stderr => @@stderr
- Benchmark.benchmark(CAPTION) do |x|
- # Start and track timing for each individual commands, storing as a Benchmark Tms block.
- self.timings = x.report("Timings: ") do
- # Set cmd_output on self, for later processing, to the returned cmd output.
- #self.cmd_output = %x[ #{self.cmd} 2>&1 ]
- end
- self.cmd_output = @@stdout.string.strip!
- puts "#{self.cmd_output}"
- end
Add Comment
Please, Sign In to add comment