composite_task 0.1.0 → 0.2.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: cf0b99f705295dcf7ccdfd879b5d2f5305a231fb
4
- data.tar.gz: 4c044311656cf9df4ee077d35a6d0e706ccbbdb3
3
+ metadata.gz: bda48ba75bfc3f2e83db46db5b929e1714cfdc54
4
+ data.tar.gz: 2523ea0fbd6ab29cdab7ad54849d43c11aa90b0c
5
5
  SHA512:
6
- metadata.gz: 73e42f649a10568aee5e70932591b3580fb9a1f6940fbdb6e4c6326cf34a1b450bbc51bf01b16a4f30a0d56539e1f9b70f47fdbbf5000ffe982d4c0eeeab0efe
7
- data.tar.gz: 506fb9b0b76856e9dcc27bc388cf1480d233266261631ee6a077f66731b139a16a1e46a602db6be9f0c8726049a4230955186b53d2e69435b5c630bdc0d696ad
6
+ metadata.gz: 0800bee840cefcba3883530e144ca16b5641b4501a88148ac624682bf53754e6d8bb03ab3fbc408d1f70d999108deb859998964e70f11ecbea1ec57b40ec7a08
7
+ data.tar.gz: f0750747d7ed76c45910629a81cea199bfdca2f7f6e9d8b2aa49ebc8ea064de85ae134a86eff7d239c89877e828beff0c63604c2fa2ba606791e9c7bcbabfcb6
@@ -108,10 +108,10 @@ class CompositeTask
108
108
  !!action
109
109
  end
110
110
 
111
- # All tasks that self is composed (including self), only includen the ones where #has_action? is true.
111
+ # All tasks that self is composed of(including self), but excluding the ones what #has_action? is false.
112
112
  # :call-seq:
113
- # tasks -> Enumerator
114
- # tasks {|task| ... }
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
@@ -1,3 +1,3 @@
1
1
  class CompositeTask
2
- VERSION = '0.1.0'
2
+ VERSION = '0.2.1'
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: composite_task
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Fabio Pugliese Ornellas