y_petri 2.0.14.p1 → 2.0.14

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: 6c46f784c2f2df0ff3008daa1c29aaeb03dbafcc
4
- data.tar.gz: cd6bb027a5079b5b02241f2bf08edcf3b6aeeb47
3
+ metadata.gz: 04fefe57afd5fa9850489c3d5dcfe27ffd520e05
4
+ data.tar.gz: f544785cc23baa8b9d26d0afb15984d8c85c59a4
5
5
  SHA512:
6
- metadata.gz: de99715667452ffbfe93f2984b193f9af2601a0ec52de5a8551b2be331574adf4a8e56f4f27f8e7a6f664a961597d708d16a8365303ab65bcbbdf44fae125fc5
7
- data.tar.gz: ed7637fc1976b90b3336237a98c2ef0e7255dac36e6c8b720c6c1b3bfc0f9726e3e42f233d29624827b862e5ea75bea87ed19a4442ed5c5e01f0aaab9379b812
6
+ metadata.gz: 705160694568b66998cbeff7a273113e5a84f80d97f14fe161c427bf95d06894e4eee6d0cc8a7b9e4f60aec4c1483b8685826df339de92c3a7856eda4a3c8f3b
7
+ data.tar.gz: 98e978bf1c89bcef1bac79c5b1f3a90dbfc48fc98842cd18569f46a672a2484853fc0a7d1d1f1e70c883db6a13c849e85e888b98ac1d7702733d34c4dbe95969
@@ -6,9 +6,7 @@ class YPetri::Place
6
6
  # Marking guard.
7
7
  #
8
8
  class Guard
9
- ERRMSG = -> m, pl, assert do
10
- "Marking #{m}:#{m.class}#{pl ? " of place #{pl}" : ''} #{assert}!"
11
- end
9
+ ERRMSG = -> m, assert { "Marking #{m}:#{m.class} #{assert}!" }
12
10
 
13
11
  attr_reader :assertion, :block
14
12
 
@@ -34,9 +32,9 @@ class YPetri::Place
34
32
  # Validates a supplied marking value against the guard block. Raises
35
33
  # +YPetri::GuardError+ if the guard fails, otherwise returns _true_.
36
34
  #
37
- def validate( marking, place=nil )
38
- λ = __fail__( marking, place, assertion )
39
- λ.call if @Lab.new( λ ).instance_exec( marking, &block ) == false
35
+ def validate( marking_value )
36
+ λ = __fail__( marking_value, assertion )
37
+ λ.call if @Lab.new( λ ).instance_exec( marking_value, &block ) == false
40
38
  return true
41
39
  end
42
40
 
@@ -44,8 +42,8 @@ class YPetri::Place
44
42
 
45
43
  # Constructs the fail closure.
46
44
  #
47
- def __fail__ marking, place, assertion
48
- -> { fail YPetri::GuardError, ERRMSG.( marking, place, assertion ) }
45
+ def __fail__ marking_value, assertion
46
+ -> { fail YPetri::GuardError, ERRMSG.( marking_value, assertion ) }
49
47
  end
50
48
  end
51
49
 
@@ -94,7 +92,7 @@ class YPetri::Place
94
92
  #
95
93
  def federated_guard_closure
96
94
  lineup = guards.dup
97
- -> m { lineup.each { |g| g.validate( m, self ) }; return m }
95
+ -> m { lineup.each { |g| g.validate m }; return m }
98
96
  end
99
97
 
100
98
  # Applies guards on the marking currently owned by the place.
@@ -1,4 +1,4 @@
1
1
  module YPetri
2
- VERSION = "2.0.14.p1"
2
+ VERSION = "2.0.14"
3
3
  DEBUG = false
4
4
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: y_petri
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.14.p1
4
+ version: 2.0.14
5
5
  platform: ruby
6
6
  authors:
7
7
  - boris
@@ -125,9 +125,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
125
125
  version: '0'
126
126
  required_rubygems_version: !ruby/object:Gem::Requirement
127
127
  requirements:
128
- - - '>'
128
+ - - '>='
129
129
  - !ruby/object:Gem::Version
130
- version: 1.3.1
130
+ version: '0'
131
131
  requirements: []
132
132
  rubyforge_project:
133
133
  rubygems_version: 2.0.3