Module: Abid::TaskManager
- Included in:
- Application
- Defined in:
- lib/abid/task_manager.rb
Class Method Summary collapse
-
.record_task_metadata ⇒ Object
:nodoc:.
Instance Method Summary collapse
- #[](task_name, scopes = nil, **params) ⇒ Object
- #define_mixin(task_class, mixin_name, &block) ⇒ Object
- #define_play(task_class, play_name, extends: nil, &block) ⇒ Object
- #initialize ⇒ Object
- #lookup_play_class(task_name, scope = nil) ⇒ Object
- #play_base(&block) ⇒ Object
Class Method Details
.record_task_metadata ⇒ Object
:nodoc:
56 57 58 |
# File 'lib/abid/task_manager.rb', line 56 def # :nodoc: Rake::TaskManager. end |
Instance Method Details
#[](task_name, scopes = nil, **params) ⇒ Object
20 21 22 23 24 25 26 27 28 |
# File 'lib/abid/task_manager.rb', line 20 def [](task_name, scopes = nil, **params) task = super(task_name, scopes) if task.respond_to? :bind task.bind(**params) else task end end |
#define_mixin(task_class, mixin_name, &block) ⇒ Object
14 15 16 17 18 |
# File 'lib/abid/task_manager.rb', line 14 def define_mixin(task_class, mixin_name, &block) define_task(task_class, mixin_name).tap do |task| task.mixin_definition = block end end |
#define_play(task_class, play_name, extends: nil, &block) ⇒ Object
7 8 9 10 11 12 |
# File 'lib/abid/task_manager.rb', line 7 def define_play(task_class, play_name, extends: nil, &block) define_task(task_class, play_name).tap do |task| task.extends = extends task.play_class_definition = block end end |
#initialize ⇒ Object
3 4 5 |
# File 'lib/abid/task_manager.rb', line 3 def initialize super end |
#lookup_play_class(task_name, scope = nil) ⇒ Object
38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 |
# File 'lib/abid/task_manager.rb', line 38 def lookup_play_class(task_name, scope = nil) if task_name.nil? play_base elsif task_name.is_a? Class task_name else t = lookup(task_name.to_s, scope) if t.respond_to? :play_class t.play_class elsif t.nil? fail "play #{task_name} not found" else fail "task #{task_name} has no play class" end end end |