Guest User

Untitled

a guest
Aug 18th, 2018
78
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.60 KB | None | 0 0
  1. def run( cmd )
  2. # set self.cmd to the passed in param, directly, stripping any '\n. as we do.
  3. self.cmd = cmd
  4. @@bash.execute "#{self.cmd}", :stdout => @@stdout, :stderr => @@stderr
  5. Benchmark.benchmark(CAPTION) do |x|
  6. # Start and track timing for each individual commands, storing as a Benchmark Tms block.
  7. self.timings = x.report("Timings: ") do
  8. # Set cmd_output on self, for later processing, to the returned cmd output.
  9. #self.cmd_output = %x[ #{self.cmd} 2>&1 ]
  10. end
  11. self.cmd_output = @@stdout.string.strip!
  12. puts "#{self.cmd_output}"
  13.  
  14. end
Add Comment
Please, Sign In to add comment