behave_fun 0.1.1 → 0.1.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +2 -2
- data/lib/behave_fun/branch_tasks/dynamic_guard_selector.rb +5 -0
- data/lib/behave_fun/decorators/repeat.rb +3 -1
- data/lib/behave_fun/task_builder.rb +5 -0
- data/lib/behave_fun/tree.rb +1 -1
- data/lib/behave_fun/version.rb +1 -1
- data/lib/behave_fun.rb +6 -0
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 935e48b4d598edb584ef80612774fec7028552597b1a6e56b4d2ec4b6283f616
|
4
|
+
data.tar.gz: 9a51961b11ec757601e3912eee99918a4ec9b39b7913d7dc95aaae25218bc627
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e2a1e6a8aa77715d47b2238920626da6b232e75e4fd92cc22b525c88d7de1036c54d1c704aa29dc5276fce1573876b164b48e6492102288a5168e0c1ccb3d41f
|
7
|
+
data.tar.gz: 5592475d04f9fb7198f4d6222673a98ebe6dbeec7ecd80e22fcf580022f4a8b7ced2901dfda2e8da887b5ca432fd1a48164ebdc5b6f89914405e14d77da69fe0
|
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
behave_fun (0.1.
|
4
|
+
behave_fun (0.1.2)
|
5
5
|
activesupport (~> 6.0.0)
|
6
6
|
zeitwerk (~> 2.3.0)
|
7
7
|
|
@@ -18,7 +18,7 @@ GEM
|
|
18
18
|
diff-lcs (1.3)
|
19
19
|
i18n (1.8.2)
|
20
20
|
concurrent-ruby (~> 1.0)
|
21
|
-
minitest (5.14.
|
21
|
+
minitest (5.14.1)
|
22
22
|
rake (12.3.3)
|
23
23
|
rspec (3.9.0)
|
24
24
|
rspec-core (~> 3.9.0)
|
@@ -2,7 +2,7 @@ module BehaveFun
|
|
2
2
|
class Decorators::Repeat < Decorator
|
3
3
|
attr_accessor :counter
|
4
4
|
|
5
|
-
def initialize(times: )
|
5
|
+
def initialize(times: -1)
|
6
6
|
super
|
7
7
|
@times = times
|
8
8
|
end
|
@@ -13,6 +13,8 @@ module BehaveFun
|
|
13
13
|
end
|
14
14
|
|
15
15
|
def child_success
|
16
|
+
return @children[0].reset if @times == -1
|
17
|
+
|
16
18
|
@counter += 1
|
17
19
|
if @counter < @times
|
18
20
|
@children[0].reset
|
@@ -22,6 +22,11 @@ module BehaveFun
|
|
22
22
|
control.guard = builder.control.root
|
23
23
|
end
|
24
24
|
|
25
|
+
def include(task)
|
26
|
+
cloned_task = BehaveFun.build_task { build_from_hash(task.as_json) }
|
27
|
+
@control.add_child(cloned_task)
|
28
|
+
end
|
29
|
+
|
25
30
|
def build_from_hash(task_hash)
|
26
31
|
type_name, params, guard_with, children =
|
27
32
|
task_hash.values_at(:type, :params, :guard_with, :children)
|
data/lib/behave_fun/tree.rb
CHANGED
data/lib/behave_fun/version.rb
CHANGED
data/lib/behave_fun.rb
CHANGED