Class: Polars::Command

Inherits:
Object
  • Object
show all
Defined in:
lib/polars/system.rb

Overview

Command Class

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(command) ⇒ Command

Returns a new instance of Command.



25
26
27
# File 'lib/polars/system.rb', line 25

def initialize(command)
  @command = command
end

Instance Attribute Details

#command_lineObject (readonly)

Returns the value of attribute command_line.



39
40
41
# File 'lib/polars/system.rb', line 39

def command_line
  @command_line
end

#errorObject (readonly)

Returns the value of attribute error.



41
42
43
# File 'lib/polars/system.rb', line 41

def error
  @error
end

#exit_statusObject (readonly)

Returns the value of attribute exit_status.



38
39
40
# File 'lib/polars/system.rb', line 38

def exit_status
  @exit_status
end

#outputObject (readonly)

Returns the value of attribute output.



40
41
42
# File 'lib/polars/system.rb', line 40

def output
  @output
end

Instance Method Details

#runObject



29
30
31
32
33
34
35
36
# File 'lib/polars/system.rb', line 29

def run
  result = AwesomeSpawn.run(@command)
  @exit_status = result.exit_status
  @command_line = result.command_line
  @output = result.output
  @error = result.error
  @exit_status
end