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
#data, #enabled, #name, #timeout
Instance Method Summary collapse
-
#configure(params, extended_context = {}, options = {}) ⇒ Object
Configures the Task.
-
#execute ⇒ Object
Executes the Task and returns its results.
Methods inherited from Henry::Task
#after_execute, #before_execute, create, #disable!, #disabled?, #enable!, #enabled?, #execution, #execution=, #export_config, #export_params, #initialize, #logger, #report
Constructor Details
This class inherits a constructor from Henry::Task
Instance Method Details
#configure(params, extended_context = {}, options = {}) ⇒ Object
Configures the Task.
51 52 |
# File 'lib/henry/task/rake_task.rb', line 51 def configure(params, extended_context={}, ={}) end |
#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 37 38 39 40 41 42 43 44 45 |
# File 'lib/henry/task/rake_task.rb', line 21 def execute begin 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 rescue Errno::ENOENT => e self.execution.code = 'ERROR' self.execution. = e. self.execution.output = 'Output file missing, please check the task logs.' self.execution.backtrace = e.backtrace self.execution.log = self.logger.log_as_hash end end |