Class: Packageiq::Command

Inherits:
Object
  • Object
show all
Defined in:
lib/packageiq/command.rb

Overview

run system commands

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(args = {}) ⇒ Command

Returns a new instance of Command.



8
9
10
# File 'lib/packageiq/command.rb', line 8

def initialize(args = {})
  @command = args[:command] if args[:command]
end

Instance Attribute Details

#commandObject

Returns the value of attribute command.



6
7
8
# File 'lib/packageiq/command.rb', line 6

def command
  @command
end

#statusObject (readonly)

Returns the value of attribute status.



12
13
14
# File 'lib/packageiq/command.rb', line 12

def status
  @status
end

#stderrObject (readonly)

Returns the value of attribute stderr.



12
13
14
# File 'lib/packageiq/command.rb', line 12

def stderr
  @stderr
end

#stdoutObject (readonly)

Returns the value of attribute stdout.



12
13
14
# File 'lib/packageiq/command.rb', line 12

def stdout
  @stdout
end

Instance Method Details

#runObject



13
14
15
# File 'lib/packageiq/command.rb', line 13

def run
  @stdout, @stderr, @status = Open3.capture3(@command)
end