Class: Rake::Task
- Includes:
- StatePatch
- Defined in:
- lib/ruby_smart/support/core_ext/rake/task.rb
Defined Under Namespace
Modules: StatePatch
Instance Attribute Summary collapse
-
#state ⇒ Object
readonly
Returns the value of attribute state.
Instance Method Summary collapse
-
#append(&block) ⇒ Rake::Task
append the given block to the 'actions'-array this method is chainable and returns self.
-
#execute(*args) ⇒ Object
included
from StatePatch
overwriting the execute method to track the current state.
-
#invoked? ⇒ Boolean
returns true, if this task was invoked.
-
#performed? ⇒ Boolean
returns true, if this task performed (executed).
-
#prepend(&block) ⇒ Rake::Task
prepends the given block to the 'actions'-array this method is chainable and returns self.
-
#running? ⇒ Boolean
returns true, if this task is currently running.
Instance Attribute Details
#state ⇒ Object (readonly)
Returns the value of attribute state.
18 19 20 |
# File 'lib/ruby_smart/support/core_ext/rake/task.rb', line 18 def state @state end |
Instance Method Details
#append(&block) ⇒ Rake::Task
append the given block to the 'actions'-array this method is chainable and returns self
43 44 45 46 |
# File 'lib/ruby_smart/support/core_ext/rake/task.rb', line 43 def append(&block) @actions << block self end |
#execute(*args) ⇒ Object Originally defined in module StatePatch
overwriting the execute method to track the current state
#invoked? ⇒ Boolean
returns true, if this task was invoked
22 23 24 |
# File 'lib/ruby_smart/support/core_ext/rake/task.rb', line 22 def invoked? !!@already_invoked end |
#performed? ⇒ Boolean
returns true, if this task performed (executed)
28 29 30 |
# File 'lib/ruby_smart/support/core_ext/rake/task.rb', line 28 def performed? @state == :done end |
#prepend(&block) ⇒ Rake::Task
prepends the given block to the 'actions'-array this method is chainable and returns self
53 54 55 56 |
# File 'lib/ruby_smart/support/core_ext/rake/task.rb', line 53 def prepend(&block) @actions.unshift(block) self end |
#running? ⇒ Boolean
returns true, if this task is currently running
34 35 36 |
# File 'lib/ruby_smart/support/core_ext/rake/task.rb', line 34 def running? @state == :running end |