Class: RGitFlow::Tasks::Task
- Defined in:
- lib/rgitflow/tasks/task.rb
Direct Known Subclasses
Feature::Finish, Feature::Start, Hotfix::Finish, Hotfix::Start, Release::Finish, Release::Start, SCM::Task
Constant Summary
Constants included from Printing
Printing::DEBUG_PREFIX, Printing::ERROR_PREFIX, Printing::INPUT_PREFIX, Printing::STATUS_PREFIX
Instance Attribute Summary collapse
-
#after ⇒ Proc
Runs a +Proc+ after the task.
-
#before ⇒ Proc
Runs a +Proc+ before the task.
-
#dependencies ⇒ Array<String>
The dependencies of the task.
-
#description ⇒ String
The description of the task.
-
#name ⇒ String
The name of the task.
-
#namespaces ⇒ Array<String>
The namespaces of the task.
Instance Method Summary collapse
- #define ⇒ Object protected
-
#initialize(git, name, description, namespaces = ['rgitflow'], dependencies = []) {|_self| ... } ⇒ Task
constructor
A new instance of Task.
- #run ⇒ Object protected
Methods included from Console
#execute, #invoke, #multi_task, #task?
Methods included from Printing
#debug, #error, #prompt, #status
Constructor Details
#initialize(git, name, description, namespaces = ['rgitflow'], dependencies = []) {|_self| ... } ⇒ Task
Returns a new instance of Task.
33 34 35 36 37 38 39 40 41 42 43 44 |
# File 'lib/rgitflow/tasks/task.rb', line 33 def initialize(git, name, description, namespaces = ['rgitflow'], dependencies = []) @git = git @name = name @description = description @namespaces = namespaces @dependencies = dependencies yield self if block_given? define end |
Instance Attribute Details
#after ⇒ Proc
Runs a +Proc+ after the task
31 32 33 |
# File 'lib/rgitflow/tasks/task.rb', line 31 def after @after end |
#before ⇒ Proc
Runs a +Proc+ before the task
27 28 29 |
# File 'lib/rgitflow/tasks/task.rb', line 27 def before @before end |
#dependencies ⇒ Array<String>
The dependencies of the task
23 24 25 |
# File 'lib/rgitflow/tasks/task.rb', line 23 def dependencies @dependencies end |
#description ⇒ String
The description of the task
19 20 21 |
# File 'lib/rgitflow/tasks/task.rb', line 19 def description @description end |
#name ⇒ String
The name of the task
15 16 17 |
# File 'lib/rgitflow/tasks/task.rb', line 15 def name @name end |
#namespaces ⇒ Array<String>
The namespaces of the task
11 12 13 |
# File 'lib/rgitflow/tasks/task.rb', line 11 def namespaces @namespaces end |
Instance Method Details
#define ⇒ Object (protected)
48 49 50 51 52 53 54 55 56 57 |
# File 'lib/rgitflow/tasks/task.rb', line 48 def define full_name = [*@namespaces, @name].join(":") desc @description unless ::Rake.application.last_comment task full_name => @dependencies do before.call if before.is_a?(Proc) run after.call if after.is_a?(Proc) end end |
#run ⇒ Object (protected)
59 60 61 |
# File 'lib/rgitflow/tasks/task.rb', line 59 def run raise NotImplementedError end |