Class: Spiceweasel::Command
- Inherits:
-
Object
- Object
- Spiceweasel::Command
- Defined in:
- lib/spiceweasel/command.rb
Instance Attribute Summary collapse
-
#allow_failure ⇒ Object
(also: #allow_failure?)
readonly
Returns the value of attribute allow_failure.
-
#command ⇒ Object
(also: #to_s)
readonly
Returns the value of attribute command.
-
#timeout ⇒ Object
readonly
Returns the value of attribute timeout.
Instance Method Summary collapse
-
#initialize(command, options = {}) ⇒ Command
constructor
A new instance of Command.
- #shellout_opts ⇒ Object
Constructor Details
#initialize(command, options = {}) ⇒ Command
Returns a new instance of Command.
8 9 10 11 12 13 |
# File 'lib/spiceweasel/command.rb', line 8 def initialize(command, ={}) @command = command.rstrip @options = @timeout = ['timeout'] @allow_failure = .has_key?('allow_failure') ? ['allow_failure'] : true end |
Instance Attribute Details
#allow_failure ⇒ Object (readonly) Also known as: allow_failure?
Returns the value of attribute allow_failure.
4 5 6 |
# File 'lib/spiceweasel/command.rb', line 4 def allow_failure @allow_failure end |
#command ⇒ Object (readonly) Also known as: to_s
Returns the value of attribute command.
6 7 8 |
# File 'lib/spiceweasel/command.rb', line 6 def command @command end |
#timeout ⇒ Object (readonly)
Returns the value of attribute timeout.
5 6 7 |
# File 'lib/spiceweasel/command.rb', line 5 def timeout @timeout end |
Instance Method Details
#shellout_opts ⇒ Object
15 16 17 18 19 |
# File 'lib/spiceweasel/command.rb', line 15 def shellout_opts opts = {} opts[:timeout] = timeout if timeout opts end |