features/support/filesystem.rb
# Runs a command in the current directory.
#
# It populates the following instance variables:
#
#   * @stdout - The standard output captured from the process.
#   * @stderr - The standard error captured from the process.
#   * @last_exit_status - The process exit status.
#
# @param [String] command
#   The command to run.
#
# @api public
Runs a command in the current directory.
It populates the following instance variables.

@stdout - The standard output captured from the process.
@stderr - The standard error captured from the process.
@last_exit_status - The process exit status.
Runs a command in the current directory . It populates the following instance variables . @stdout - The standard output captured from the process . @stderr - The standard error captured from the process . @last_exit_status - The process exit status .
def run(command)
    in_current_dir do
      rout, wout = IO.pipe
      rerr, werr = IO.pipe
      pid = Process.spawn(command, :out => wout, :err => werr)
      _, status = Process.wait2(pid)
      wout.close
      werr.close
      @stdout = rout.readlines.join("\n").force_encoding('utf-8')
      @stderr = rerr.readlines.join("\n").force_encoding('utf-8')
      rout.close
      rerr.close
      @last_exit_status = status.exitstatus
    end
  end
def run ( command ) in_current_dir do rout , wout = IO . pipe rerr , werr = IO . pipe pid = Process . spawn ( command , :out => wout , :err => werr ) _ , status = Process . wait2 ( pid ) wout . close werr . close @stdout = rout . readlines . join ( "\n" ) . force_encoding ( 'utf-8' ) @stderr = rerr . readlines . join ( "\n" ) . force_encoding ( 'utf-8' ) rout . close rerr . close @last_exit_status = status . exitstatus end end
Runs a command in the current directory.
Runs a command in the current directory .
# stdout, stderr pipes # close write ends so we could read them # dispose the read ends of the pipes
command
<not_specific>
<not_specific>
command The command to run.
command The command to run .
api
None