class Transfuse::Cmd

Attributes

cmd[RW]
status[RW]
stderr[RW]
stdout[RW]

Public Class Methods

new(cmd) click to toggle source
# File lib/transfuse/cmd.rb, line 15
def initialize cmd
  @cmd = cmd
end

Public Instance Methods

run(file=nil) click to toggle source
# File lib/transfuse/cmd.rb, line 19
def run file=nil
  unless file.nil?
    if File.exist?(file) and File.stat(file).size > 0
      @stdout = ""
      @stderr = ""
      @status = Status.new
      return true
    end
  end
  @stdout, @stderr, @status = Open3.capture3 @cmd
  return false
end
to_s() click to toggle source
# File lib/transfuse/cmd.rb, line 32
def to_s
  @cmd
end