petri-dsl 0.1.0 → 0.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +6 -6
- data/lib/petri/net.rb +2 -1
- data/lib/petri/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a563a541a724d814f57a488b5fbef4170c8ecd3c40f0c6fb589f1bab1844cd06
|
4
|
+
data.tar.gz: 121f814bf7e76481c6ab4a51386d294fe5a77a902f1d17fd7c30e321513b3ad2
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 979348114683330b5df034398d6bfdd604837f828cb861ad31bd95064b293b26c2f8e14e754bd29d58cd079578cf34008209f1a956602210c4786cc7ccd09e3b
|
7
|
+
data.tar.gz: a0fa3c6f4541fded3ccc477bd5f59a7da980fe2544ce2564a4f2869dfe1e60456ee359dbb3f9876f495860c05cc5e11eb6dcc8526058902ff692937b0e8e9603
|
data/README.md
CHANGED
@@ -26,20 +26,20 @@ network = Petri::Net.new do |net|
|
|
26
26
|
net.end_place :end, name: 'End'
|
27
27
|
|
28
28
|
net.transition :leader_evaluate, name: 'Leader Evaluate', consume: :start do |t|
|
29
|
-
|
30
|
-
|
29
|
+
t.produce :leader_approved, name: 'Leader Approved', with_guard: :approved
|
30
|
+
t.produce :rejected, name: 'Rejected', with_guard: :rejected
|
31
31
|
end
|
32
32
|
|
33
33
|
net.transition :hr_evaluate, name: 'HR Evaluate', consume: :leader_approved do |t|
|
34
|
-
|
35
|
-
|
34
|
+
t.produce :hr_approved, name: 'HR Approved', with_guard: :approved
|
35
|
+
t.produce :rejected, with_guard: :rejected
|
36
36
|
end
|
37
37
|
|
38
38
|
net.transition :report_back, name: 'Report Back', consume: :hr_approved, produce: :end
|
39
39
|
|
40
40
|
net.transition :resend_request, name: 'Resend Request', consume: :rejected do |t|
|
41
|
-
|
42
|
-
|
41
|
+
t.produce :start, with_guard: :resend
|
42
|
+
t.produce :end, with_guard: :discard
|
43
43
|
end
|
44
44
|
end
|
45
45
|
|
data/lib/petri/net.rb
CHANGED
@@ -9,7 +9,8 @@ class Petri::Net
|
|
9
9
|
|
10
10
|
def add_place(place, options={})
|
11
11
|
entity = place if place.is_a? Petri::Place
|
12
|
-
entity = Petri::Place.new(place, options)
|
12
|
+
entity = Petri::Place.new(place, options) if place.is_a? Symbol
|
13
|
+
raise TypeError unless entity.is_a? Petri::Place
|
13
14
|
|
14
15
|
@places << entity unless @places.include?(entity)
|
15
16
|
entity
|
data/lib/petri/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: petri-dsl
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Delton Ding
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-02-
|
11
|
+
date: 2020-02-14 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: ''
|
14
14
|
email:
|