durable_rules 2.0.4 → 2.0.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/librb/durable.rb +1 -3
- data/librb/engine.rb +8 -9
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4f2783f44507366a2029205429dd94b99da4fdb8
|
4
|
+
data.tar.gz: 15e4d147d321f18e701583d1cb0f1a77dac4a977
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 73533cb05af0e9d0a5190187f5636e49fcbe000e7c2f374d3d142d20a998a94f22016a4570f1623e4809c8698d2d1a403afc1ca5aa2879a991998f2b93fa36d5
|
7
|
+
data.tar.gz: 9ba5938a86bb9737246f6779a9d499f06eb116b2d079d5b2ac521769cbfde26b220c4dd68af14e12d1e5238927d155518e714aed5764d3b7a0e65dc8a06726a2
|
data/librb/durable.rb
CHANGED
data/librb/engine.rb
CHANGED
@@ -403,20 +403,17 @@ module Engine
|
|
403
403
|
Rules.renew_action_lease @handle, sid.to_s
|
404
404
|
end
|
405
405
|
|
406
|
-
def Ruleset.create_rulesets(
|
406
|
+
def Ruleset.create_rulesets(host, ruleset_definitions)
|
407
407
|
branches = {}
|
408
408
|
for name, definition in ruleset_definitions do
|
409
409
|
name = name.to_s
|
410
410
|
if name.end_with? "$state"
|
411
411
|
name = name[0..-7]
|
412
|
-
name = "#{parent_name}.#{name}" if parent_name
|
413
412
|
branches[name] = Statechart.new name, host, definition
|
414
413
|
elsif name.end_with? "$flow"
|
415
414
|
name = name[0..-6]
|
416
|
-
name = "#{parent_name}.#{name}" if parent_name
|
417
415
|
branches[name] = Flowchart.new name, host, definition
|
418
416
|
else
|
419
|
-
name = "#{parent_name}.#{name}" if parent_name
|
420
417
|
branches[name] = Ruleset.new name, host, definition
|
421
418
|
end
|
422
419
|
end
|
@@ -929,9 +926,11 @@ module Engine
|
|
929
926
|
@ruleset_directory[ruleset_name]
|
930
927
|
end
|
931
928
|
|
932
|
-
def
|
933
|
-
register_rulesets
|
934
|
-
|
929
|
+
def set_rulesets(ruleset_definitions)
|
930
|
+
register_rulesets ruleset_definitions
|
931
|
+
for ruleset_name, ruleset_definition in ruleset_definitions do
|
932
|
+
save_ruleset ruleset_name, ruleset_definition
|
933
|
+
end
|
935
934
|
end
|
936
935
|
|
937
936
|
def post(ruleset_name, event, complete = nil)
|
@@ -993,8 +992,8 @@ module Engine
|
|
993
992
|
get_ruleset(ruleset_name).renew_action_lease sid
|
994
993
|
end
|
995
994
|
|
996
|
-
def register_rulesets(
|
997
|
-
rulesets = Ruleset.create_rulesets(
|
995
|
+
def register_rulesets(ruleset_definitions)
|
996
|
+
rulesets = Ruleset.create_rulesets(self, ruleset_definitions)
|
998
997
|
for ruleset_name, ruleset in rulesets do
|
999
998
|
if @ruleset_directory.key? ruleset_name
|
1000
999
|
raise ArgumentError, "Ruleset with name #{ruleset_name} already registered"
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: durable_rules
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.0.
|
4
|
+
version: 2.0.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jesus Ruiz
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-07-
|
11
|
+
date: 2019-07-21 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rake
|