delano / rye

Safe, parallel access to Unix shells from Ruby
http://delano.github.com/rye
MIT License
234 stars 32 forks source link

Rye.shell does not setup the cmd field of the RAP out object #26

Open rrepen opened 11 years ago

rrepen commented 11 years ago

The RYE::SHELL has this code: ... rap = Rye::Rap.new(self) rap.add_stdout(stdout || '') rap.add_stderr(stderr || '') rap.add_exit_status($?) rap ...

To get the cmd string back I have added the following two lines ... cmd = Rye.prepare_command(cmd, args) cmd_str = cmd.dup # Take a copy of the command before it gets the redirection part cmd << " 2>#{tf.path}" # Redirect STDERR to file. Works in DOS too. ... rap = Rye::Rap.new(self) rap.add_stdout(stdout || '') rap.add_stderr(stderr || '') rap.add_exit_status($?) rap.cmd = cmd_str # Add the cmd string to the RAP object rap

By doing this I get back the command string and I have the same behavior as using a the Rye::Box

René