Class: Lifeline::LifelineRakeTask
- Inherits:
-
Rake::TaskLib
- Object
- Rake::TaskLib
- Lifeline::LifelineRakeTask
- Defined in:
- lib/lifeline.rb
Overview
Define rake tasks for running, starting, and terminating
Instance Attribute Summary collapse
-
#namespace ⇒ String
The namespace to define the tasks in.
Instance Method Summary collapse
-
#initialize(namespace, opts = {}, &block) ⇒ LifelineRakeTask
constructor
Creates 3 new tasks for the lifeline in the namespace specified.
Constructor Details
#initialize(namespace, opts = {}, &block) ⇒ LifelineRakeTask
Creates 3 new tasks for the lifeline in the namespace specified. These tasks are
-
run - a task for running the code provided in the block
-
lifeline - a lifeline task for running the run task if it’s not already running
-
terminate - a task for terminating all lifelines.
75 76 77 78 79 80 81 82 83 84 85 |
# File 'lib/lifeline.rb', line 75 def initialize(namespace, opts={}, &block) if !block_given? raise ArgumentError, "You must pass in a block to be the body of the run rake task" end @namespace = namespace define_run_task(opts, &block) define_lifeline_task define_terminate_task end |
Instance Attribute Details
#namespace ⇒ String
The namespace to define the tasks in
62 63 64 |
# File 'lib/lifeline.rb', line 62 def namespace @namespace end |