Class: Packageiq::Command
- Inherits:
-
Object
- Object
- Packageiq::Command
- Defined in:
- lib/packageiq/command.rb
Overview
run system commands
Instance Attribute Summary collapse
-
#command ⇒ Object
Returns the value of attribute command.
-
#status ⇒ Object
readonly
Returns the value of attribute status.
-
#stderr ⇒ Object
readonly
Returns the value of attribute stderr.
-
#stdout ⇒ Object
readonly
Returns the value of attribute stdout.
Instance Method Summary collapse
-
#initialize(args = {}) ⇒ Command
constructor
A new instance of Command.
- #run ⇒ Object
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
#command ⇒ Object
Returns the value of attribute command.
6 7 8 |
# File 'lib/packageiq/command.rb', line 6 def command @command end |
#status ⇒ Object (readonly)
Returns the value of attribute status.
12 13 14 |
# File 'lib/packageiq/command.rb', line 12 def status @status end |
#stderr ⇒ Object (readonly)
Returns the value of attribute stderr.
12 13 14 |
# File 'lib/packageiq/command.rb', line 12 def stderr @stderr end |
#stdout ⇒ Object (readonly)
Returns the value of attribute stdout.
12 13 14 |
# File 'lib/packageiq/command.rb', line 12 def stdout @stdout end |
Instance Method Details
#run ⇒ Object
13 14 15 |
# File 'lib/packageiq/command.rb', line 13 def run @stdout, @stderr, @status = Open3.capture3(@command) end |