Class: Henry::Task::RakeTask
- Inherits:
-
Henry::Task
- Object
- Henry::Task
- Henry::Task::RakeTask
- Defined in:
- lib/henry/task/rake_task.rb
Overview
The Henry Task implementation for Rake Tasks
Direct Known Subclasses
Constant Summary collapse
- OUT_PATH =
The temporary output file path for the RakeTask execution.
'rake.out'
- APPLICATION_NAME =
The Rake Application name.
'rake'
Instance Attribute Summary
Attributes inherited from Henry::Task
Instance Method Summary collapse
-
#execute ⇒ Object
Executes the Task and returns its results.
Methods inherited from Henry::Task
#after_execute, #before_execute, #configure, create, #disable!, #disabled?, #enable!, #enabled?, #execution, #export_params, #initialize, #logger, #report
Constructor Details
This class inherits a constructor from Henry::Task
Instance Method Details
#execute ⇒ Object
Executes the Task and returns its results.
21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 |
# File 'lib/henry/task/rake_task.rb', line 21 def execute begin Rake.application[self.application_name].invoke self.execution.code = 'OK' self.execution. = 'OK' self.execution.output = File.open(self.out_path, 'r').read self.execution.log = self.logger.log_as_hash rescue Exception => e self.execution.code = 'ERROR' self.execution. = e. self.execution.output = File.open(self.out_path, 'r').read self.execution.backtrace = e.backtrace self.execution.log = self.logger.log_as_hash end end |