MINT-statemachine 1.4.1 → 1.5.0
Sign up to get free protection for your applications and to get access to all the features.
- data/CHANGES +5 -0
- data/lib/statemachine/action_invokation.rb +5 -1
- data/lib/statemachine/version.rb +2 -2
- data/spec/action_invokation_spec.rb +10 -0
- metadata +4 -4
data/CHANGES
CHANGED
@@ -1,5 +1,10 @@
|
|
1
1
|
= Statemachine Changelog
|
2
2
|
|
3
|
+
== Version 1.5.0 (2013/07/19)
|
4
|
+
|
5
|
+
* Support for proc definition inside script element, which can be used with the MINT-scxml parser to define
|
6
|
+
scripts that contain a proc with parameters that can be set with the triggering event.
|
7
|
+
|
3
8
|
== Version 1.4.1 (2013/07/02)
|
4
9
|
|
5
10
|
* bug fixed: direct entry into a parallel state child state that has been already entered has not reseted parallel state
|
@@ -22,7 +22,11 @@ module Statemachine
|
|
22
22
|
result = invoke_method(a[1],args, message)
|
23
23
|
elsif a[0] == 'script'
|
24
24
|
result = invoke_string(a[1])
|
25
|
-
|
25
|
+
if result.is_a? Proc
|
26
|
+
result = invoke_proc(result, args, message)
|
27
|
+
else
|
28
|
+
result = true if result == nil
|
29
|
+
end
|
26
30
|
elsif a[0] == "if"
|
27
31
|
result = invoke_string(a[1])
|
28
32
|
if result
|
data/lib/statemachine/version.rb
CHANGED
@@ -36,6 +36,16 @@ describe "Action Invokation" do
|
|
36
36
|
@noodle.shape.should eql("capellini")
|
37
37
|
end
|
38
38
|
|
39
|
+
it "script actions with singe proc" do
|
40
|
+
sm = Statemachine.build do |smb|
|
41
|
+
smb.trans :cold, :fire, :hot, [["script", "Proc.new { |r| @shape = r}"]]
|
42
|
+
end
|
43
|
+
sm.context = @noodle
|
44
|
+
|
45
|
+
sm.fire "capellini"
|
46
|
+
@noodle.shape.should eql("capellini")
|
47
|
+
end
|
48
|
+
|
39
49
|
it "String actions" do
|
40
50
|
sm = Statemachine.build do |smb|
|
41
51
|
smb.trans :cold, :fire, :hot, "@shape = 'fettucini'; @cooked = true"
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: MINT-statemachine
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.5.0
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2013-07-
|
12
|
+
date: 2013-07-19 00:00:00.000000000Z
|
13
13
|
dependencies: []
|
14
14
|
description: The MINT Statemachine is a ruby library for building Finite State Machines,
|
15
15
|
based on the Statemachine gem by Micah Martin.
|
@@ -73,7 +73,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
73
73
|
version: '0'
|
74
74
|
segments:
|
75
75
|
- 0
|
76
|
-
hash:
|
76
|
+
hash: 99668051
|
77
77
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
78
78
|
none: false
|
79
79
|
requirements:
|
@@ -85,7 +85,7 @@ rubyforge_project:
|
|
85
85
|
rubygems_version: 1.8.15
|
86
86
|
signing_key:
|
87
87
|
specification_version: 3
|
88
|
-
summary: MINT-Statemachine-1.
|
88
|
+
summary: MINT-Statemachine-1.5.0 - Statemachine Library for Ruby based on statemachine
|
89
89
|
from http://slagyr.github.com/statemachine http://www.multi-access.de/open-source-software/third-party-software-extensions/
|
90
90
|
test_files:
|
91
91
|
- spec/default_transition_spec.rb
|