Class: Fudge::Tasks::Shell
Overview
Allow use of shell commands as tasks
Instance Attribute Summary collapse
-
#arguments ⇒ Object
Returns the value of attribute arguments.
-
#check_for ⇒ Object
Returns the value of attribute check_for.
Attributes inherited from Task
Instance Method Summary collapse
-
#initialize(*args) ⇒ Shell
constructor
A new instance of Shell.
-
#run(options = {}) ⇒ Object
Execute the shell command.
Methods inherited from Task
Constructor Details
#initialize(*args) ⇒ Shell
Returns a new instance of Shell.
7 8 9 |
# File 'lib/fudge/tasks/shell.rb', line 7 def initialize(*args) self.arguments = super.join(' ') end |
Instance Attribute Details
#arguments ⇒ Object
Returns the value of attribute arguments.
5 6 7 |
# File 'lib/fudge/tasks/shell.rb', line 5 def arguments @arguments end |
#check_for ⇒ Object
Returns the value of attribute check_for.
5 6 7 |
# File 'lib/fudge/tasks/shell.rb', line 5 def check_for @check_for end |
Instance Method Details
#run(options = {}) ⇒ Object
Execute the shell command
14 15 16 17 18 19 20 |
# File 'lib/fudge/tasks/shell.rb', line 14 def run(={}) formatter = get_formatter() @output, success = run_command(cmd(), formatter) return false unless success return check_for_output(formatter) end |