Module: Fudge::TaskDSL
- Included in:
- Description
- Defined in:
- lib/fudge/task_dsl.rb
Overview
Domain specific language for expressing Tasks in the Fudgefile
Class Method Summary collapse
-
.included(base) ⇒ Object
Sets up attr_writers the including class will need.
Instance Method Summary collapse
-
#method_missing(meth, *args, &block) ⇒ Object
Delegate to the current object scope.
-
#scope ⇒ Object
Add self to the scope.
-
#task(name, *args) ⇒ Object
Adds a task to the current scope.
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(meth, *args, &block) ⇒ Object
Delegate to the current object scope
25 26 27 28 29 |
# File 'lib/fudge/task_dsl.rb', line 25 def method_missing(meth, *args, &block) task meth, *args, &block rescue Fudge::Exceptions::TaskNotFound super end |
Class Method Details
.included(base) ⇒ Object
Sets up attr_writers the including class will need
5 6 7 |
# File 'lib/fudge/task_dsl.rb', line 5 def self.included(base) attr_writer :scope end |
Instance Method Details
#scope ⇒ Object
Add self to the scope
10 11 12 |
# File 'lib/fudge/task_dsl.rb', line 10 def scope @scope ||= [self] end |