composite_task 0.1.0 → 0.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/composite_task.rb +8 -3
- data/lib/composite_task/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: bda48ba75bfc3f2e83db46db5b929e1714cfdc54
|
4
|
+
data.tar.gz: 2523ea0fbd6ab29cdab7ad54849d43c11aa90b0c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0800bee840cefcba3883530e144ca16b5641b4501a88148ac624682bf53754e6d8bb03ab3fbc408d1f70d999108deb859998964e70f11ecbea1ec57b40ec7a08
|
7
|
+
data.tar.gz: f0750747d7ed76c45910629a81cea199bfdca2f7f6e9d8b2aa49ebc8ea064de85ae134a86eff7d239c89877e828beff0c63604c2fa2ba606791e9c7bcbabfcb6
|
data/lib/composite_task.rb
CHANGED
@@ -108,10 +108,10 @@ class CompositeTask
|
|
108
108
|
!!action
|
109
109
|
end
|
110
110
|
|
111
|
-
# All tasks that self is composed
|
111
|
+
# All tasks that self is composed of(including self), but excluding the ones what #has_action? is false.
|
112
112
|
# :call-seq:
|
113
|
-
#
|
114
|
-
#
|
113
|
+
# tasks_with_action -> Enumerator
|
114
|
+
# tasks_with_action {|task| ... }
|
115
115
|
def tasks_with_action
|
116
116
|
return to_enum(__method__) unless block_given?
|
117
117
|
tasks.each do |task|
|
@@ -119,6 +119,11 @@ class CompositeTask
|
|
119
119
|
end
|
120
120
|
end
|
121
121
|
|
122
|
+
# Returns true only if self has no actions define in itself, or in any of its sub tasks.
|
123
|
+
def empty?
|
124
|
+
tasks_with_action.count == 0
|
125
|
+
end
|
126
|
+
|
122
127
|
# Returns the first task with action with given name.
|
123
128
|
def [] name
|
124
129
|
tasks_with_action.select{|s| s.name == name}.first
|