Class: Spiceweasel::Command
- Inherits:
-
Object
- Object
- Spiceweasel::Command
- Defined in:
- lib/spiceweasel/command.rb
Overview
prepares shellout calls
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.
27 28 29 30 31 32 |
# File 'lib/spiceweasel/command.rb', line 27 def initialize(command, = {}) @command = command.rstrip @options = @timeout = ['timeout'] @allow_failure = .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.
23 24 25 |
# File 'lib/spiceweasel/command.rb', line 23 def allow_failure @allow_failure end |
#command ⇒ Object (readonly) Also known as: to_s
Returns the value of attribute command.
25 26 27 |
# File 'lib/spiceweasel/command.rb', line 25 def command @command end |
#timeout ⇒ Object (readonly)
Returns the value of attribute timeout.
24 25 26 |
# File 'lib/spiceweasel/command.rb', line 24 def timeout @timeout end |
Instance Method Details
#shellout_opts ⇒ Object
34 35 36 37 38 |
# File 'lib/spiceweasel/command.rb', line 34 def shellout_opts opts = {} opts[:timeout] = timeout if timeout opts end |