Class | Rye::Rap |
In: |
lib/rye/rap.rb
|
Parent: | Array |
This class is a modified Array which is returned by all command methods. The command output is split by line into an instance of this class. If there is only a single element it will act like a String.
This class also contains a reference to the instance of Rye::Box or Rye::Set that the command was executed on.
obj | -> | box |
obj | -> | set |
Output STDOUT content to (remote) path This works like a shell redirect so the file contents are cleared before outputting.
rbox.ps('aux') > 'processes.log'
Output STDOUT content to (remote) path This works like a shell redirect so if the target file exists the STDOUT content will be appended.
rbox.ps('aux') >> 'processes.log'
Parse the exit code.
For example, when running a command via Rye.shell, this method is send $? which is Process::Status object. Via Rye::Box.run_command it‘s just an exit code returned by Net::SSH.
In JRuby, if code is a Process::Status object, @pid will be set to -1 (JRuby doesn‘t return the pid).
Returns the exit code as an Integer.
Add STDOUT output from the command executed via SSH. This is available to maintain consistency with the add_stderr method. Otherwise there‘s no need to use this method (treat the Rye::Rap object like an Array).
Returns a reference to the Rye::Rap object (which acts like an Array that contains the STDOUT from the command executed over SSH). This is available to maintain consistency with the stderr method.