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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: f2e766fe17ad24973f882bf0abbc8ccc4fb1e194099da69c1b8eeba5127b923b
4
- data.tar.gz: 86df851c947b96f4b262e62e7e9d8e911a68ad10e49585b5e578d7ae41a69718
3
+ metadata.gz: a563a541a724d814f57a488b5fbef4170c8ecd3c40f0c6fb589f1bab1844cd06
4
+ data.tar.gz: 121f814bf7e76481c6ab4a51386d294fe5a77a902f1d17fd7c30e321513b3ad2
5
5
  SHA512:
6
- metadata.gz: 0c396c291a966d3d6c396c5d190e85f56870336d0f11240f9e8e4c74f316f652397013c52589f4a0d2e61686a71ae1275982980affb07f8018aa91750c29d58b
7
- data.tar.gz: cc374b930af65407d31c2139049679fc359f7d7c721924375ef89b6489e14377553278d1b28992e3be86ce9a6deefd16997fc0723b20c3c457aa689250924d70
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
- t.produce :leader_approved, name: 'Leader Approved', with_guard: :approved
30
- t.produce :rejected, name: 'Rejected', with_guard: :rejected
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
- t.produce :hr_approved, name: 'HR Approved', with_guard: :approved
35
- t.produce :rejected, with_guard: :rejected
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
- t.produce :start, with_guard: :resend
42
- t.produce :end, with_guard: :discard
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
@@ -1,3 +1,3 @@
1
1
  module Petri
2
- VERSION = "0.1.0"
2
+ VERSION = "0.1.1"
3
3
  end
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.0
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-13 00:00:00.000000000 Z
11
+ date: 2020-02-14 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: ''
14
14
  email: