MINT-scxml 1.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (51) hide show
  1. data/.gemtest +0 -0
  2. data/Gemfile +5 -0
  3. data/Gemfile.lock +18 -0
  4. data/History.txt +4 -0
  5. data/MINT-scxml.gemspec +35 -0
  6. data/Manifest.txt +49 -0
  7. data/README.rdoc +50 -0
  8. data/Rakefile +31 -0
  9. data/lib/MINT-scxml.rb +5 -0
  10. data/lib/MINT-scxml/scxml-parser.rb +228 -0
  11. data/spec/atm_spec.rb +69 -0
  12. data/spec/parser_spec.rb +394 -0
  13. data/spec/spec.opts +6 -0
  14. data/spec/spec_helper.rb +8 -0
  15. data/spec/test_handgestures_spec.rb +53 -0
  16. data/spec/testmachines/atm_enhanced.rb +129 -0
  17. data/spec/testmachines/handgestures-scxmlgui.png +0 -0
  18. data/spec/testmachines/handgestures-scxmlgui.scxml +106 -0
  19. data/spec/testmachines/multiplestates.rb +25 -0
  20. data/spec/testmachines/traffic_light_enhanced.rb +56 -0
  21. data/spec/testmachines/vending_machine1.rb +18 -0
  22. data/spec/testmachines/vending_machine2.rb +42 -0
  23. data/spec/testmachines/vending_machine3.rb +48 -0
  24. data/spec/testmachines/vending_machine4.rb +29 -0
  25. data/spec_helper.rb +8 -0
  26. data/statemachines/AICommand_scxml_spec.rb +38 -0
  27. data/statemachines/AIO_scxml_spec.rb +36 -0
  28. data/statemachines/aui-scxml/AIC.scxml +26 -0
  29. data/statemachines/aui-scxml/AICommand.scxml +34 -0
  30. data/statemachines/aui-scxml/AICommand2.scxml +32 -0
  31. data/statemachines/aui-scxml/AIO.scxml +25 -0
  32. data/statemachines/aui/AIC.rb +29 -0
  33. data/statemachines/aui/AIChoiceElement.rb +32 -0
  34. data/statemachines/aui/AICommand.rb +34 -0
  35. data/statemachines/aui/AIIN.rb +7 -0
  36. data/statemachines/aui/AIINContinous.rb +41 -0
  37. data/statemachines/aui/AIMultiChoice.rb +46 -0
  38. data/statemachines/aui/AIMultiChoiceElement.rb +46 -0
  39. data/statemachines/aui/AIOUTContinous.rb +41 -0
  40. data/statemachines/aui/AISingleChoice.rb +42 -0
  41. data/statemachines/aui/AISingleChoiceElement.rb +45 -0
  42. data/statemachines/aui/aio.rb +28 -0
  43. data/statemachines/specs/AICommand_spec.rb +58 -0
  44. data/statemachines/specs/AIINContinous_spec.rb +61 -0
  45. data/statemachines/specs/AIMultiChoiceElement_spec.rb +70 -0
  46. data/statemachines/specs/AIMultiChoice_spec.rb +56 -0
  47. data/statemachines/specs/AIOUTContinous_spec.rb +71 -0
  48. data/statemachines/specs/AIO_spec.rb +53 -0
  49. data/statemachines/specs/AISingleChoiceElement_spec.rb +58 -0
  50. data/statemachines/specs/AISingleChoice_spec.rb +68 -0
  51. metadata +146 -0
@@ -0,0 +1,53 @@
1
+ require File.dirname(__FILE__) + '/../../spec_helper'
2
+
3
+ describe "AIO" do
4
+ before (:each) do
5
+ @statemachine = Statemachine.build do
6
+ superstate :AIO do
7
+ trans :initialized, :organize, :organized
8
+ trans :organized, :present, :presenting
9
+ trans :suspended, :organize, :organized
10
+
11
+ superstate :presenting do
12
+ event :suspend, :suspended
13
+
14
+ trans :defocused, :focus, :focused
15
+ trans :defocused, :next, :focused#, :focus_next
16
+ trans :defocused, :prev, :focused#, :focus_prev
17
+ trans :defocused, :parent, :focused#, :focus_parent
18
+ trans :focused, :defocus, :defocused
19
+ end
20
+ end
21
+ end
22
+ end
23
+
24
+
25
+ it "should start in :initialized" do
26
+ @statemachine.state.should == :initialized
27
+ end
28
+
29
+ it "should enter the superstate :presenting" do
30
+ @statemachine.organize
31
+ @statemachine.state.should == :organized
32
+ @statemachine.present
33
+ @statemachine.state.should == :defocused
34
+ end
35
+
36
+ it "should support transitions inside the superstate" do
37
+ @statemachine.organize
38
+ @statemachine.present
39
+ @statemachine.focus
40
+ @statemachine.state.should == :focused
41
+ @statemachine.defocus
42
+ @statemachine.state.should == :defocused
43
+ end
44
+
45
+ it "should leave the superstate" do
46
+ @statemachine.organize
47
+ @statemachine.present
48
+ @statemachine.suspend
49
+ @statemachine.state.should == :suspended
50
+ end
51
+
52
+
53
+ end
@@ -0,0 +1,58 @@
1
+ require File.dirname(__FILE__) + '/../../spec_helper'
2
+
3
+ describe "AISingleChoiceElement" do
4
+ before (:each) do
5
+ @statemachine = Statemachine.build do
6
+ superstate :AISingleChoiceElement do
7
+ trans :initialized, :organize, :organized
8
+ trans :organized, :present, :presenting_H
9
+ trans :suspended, :organize, :organized
10
+
11
+ superstate :presenting do
12
+ event :suspend, :suspended
13
+
14
+ parallel :p do
15
+ statemachine :s1 do
16
+ superstate :selection do
17
+ # TODO make In() work
18
+ trans :unchosen, :choose, :chosen#, :all_unchoose, In(:focused)
19
+ trans :chosen, :unchoose, :unchosen
20
+ end
21
+ end
22
+ statemachine :s2 do
23
+ superstate :presentingAIChoiceElement do
24
+ event :suspend, :suspended
25
+
26
+ trans :defocused, :focus, :focused
27
+ trans :defocused, :next, :focused#, :focus_next
28
+ trans :defocused, :prev, :focused#, :focus_prev
29
+ trans :defocused, :parent, :focused#, :focus_parent
30
+ trans :focused, :defocus, :defocused
31
+ # TODO make In() work
32
+ trans :focused, :drag, :dragging#, :self_choose, In(:unchosen)
33
+ trans :focused, :drag, :dragging#, nil, In(:chosen)
34
+ trans :dragging, :drop, :defocused
35
+ end
36
+ end
37
+ end
38
+ end
39
+ end
40
+ end
41
+ end
42
+
43
+ it "should support parallel transitions" do
44
+ @statemachine.organize
45
+ @statemachine.present
46
+ @statemachine.focus
47
+ @statemachine.choose
48
+ @statemachine.states_id.should == [:chosen, :focused]
49
+ @statemachine.drag
50
+ @statemachine.states_id.should == [:chosen, :dragging]
51
+ @statemachine.unchoose
52
+ @statemachine.drop
53
+ @statemachine.states_id.should == [:unchosen, :defocused]
54
+ end
55
+
56
+ #TODO implement test to check if In() is working
57
+
58
+ end
@@ -0,0 +1,68 @@
1
+ require File.dirname(__FILE__) + '/../../spec_helper'
2
+
3
+ describe "AISingleChoice" do
4
+ before (:each) do
5
+ @statemachine = Statemachine.build do
6
+ superstate :AISingleChoice do
7
+ trans :initialized, :organize, :organized
8
+ trans :organized, :present, :presenting
9
+ trans :suspended, :organize, :organized
10
+
11
+ superstate :presenting do
12
+ event :suspend, :suspended
13
+
14
+ parallel :p do
15
+ statemachine :s1 do
16
+ #trans :listing, :drop, :dropped, :drop_all_dragging, In(:focused)
17
+ # TODO make In() work
18
+ trans :listing, :drop, :dropped, nil, Proc.new {@statemachine.In(:focused)}
19
+ # TODO how to implement transitions without events
20
+ # trans :dropped, nil , :listing, :unfocus_self
21
+ end
22
+ statemachine :s2 do
23
+ superstate :presentingAIC do
24
+ event :suspend, :suspended
25
+
26
+ trans :defocused, :focus, :focused
27
+ trans :defocused, :next, :focused#, :focus_next
28
+ trans :defocused, :prev, :focused#, :focus_prev
29
+ trans :defocused, :parent, :focused#, :focus_parent
30
+ trans :defocused, :child, :focused#, :focus_child
31
+ trans :focused, :defocus, :defocused
32
+ end
33
+ end
34
+ end
35
+ end
36
+ end
37
+ end
38
+ end
39
+
40
+ it "should enter :presenting " do
41
+ @statemachine.organize
42
+ @statemachine.present
43
+ @statemachine.states_id.should == [:listing, :defocused]
44
+ end
45
+
46
+ #TODO test to check In when it starts to work
47
+
48
+
49
+
50
+
51
+ it "should support parallel transitions" do
52
+ @statemachine.organize
53
+ @statemachine.present
54
+ @statemachine.drop
55
+ @statemachine.states_id.should == [:listing, :defocused]
56
+ @statemachine.focus
57
+ @statemachine.drop
58
+ @statemachine.states_id.should == [:dropped, :focused]
59
+ end
60
+
61
+ it "should leave :presenting and parallel state" do
62
+ @statemachine.organize
63
+ @statemachine.present
64
+ @statemachine.suspend
65
+ @statemachine.state.should == :suspended
66
+ end
67
+
68
+ end
metadata ADDED
@@ -0,0 +1,146 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: MINT-scxml
3
+ version: !ruby/object:Gem::Version
4
+ hash: 23
5
+ prerelease:
6
+ segments:
7
+ - 1
8
+ - 0
9
+ - 0
10
+ version: 1.0.0
11
+ platform: ruby
12
+ authors:
13
+ - Jessica H. Colnago, Sebastian Feuerstack
14
+ autorequire:
15
+ bindir: bin
16
+ cert_chain: []
17
+
18
+ date: 2011-11-01 00:00:00 Z
19
+ dependencies:
20
+ - !ruby/object:Gem::Dependency
21
+ name: MINT-statemachine
22
+ prerelease: false
23
+ requirement: &id001 !ruby/object:Gem::Requirement
24
+ none: false
25
+ requirements:
26
+ - - ~>
27
+ - !ruby/object:Gem::Version
28
+ hash: 25
29
+ segments:
30
+ - 1
31
+ - 2
32
+ - 3
33
+ version: 1.2.3
34
+ type: :runtime
35
+ version_requirements: *id001
36
+ - !ruby/object:Gem::Dependency
37
+ name: hoe
38
+ prerelease: false
39
+ requirement: &id002 !ruby/object:Gem::Requirement
40
+ none: false
41
+ requirements:
42
+ - - ~>
43
+ - !ruby/object:Gem::Version
44
+ hash: 17
45
+ segments:
46
+ - 2
47
+ - 9
48
+ version: "2.9"
49
+ type: :development
50
+ version_requirements: *id002
51
+ description: This gem implements a state chart XML (SCXML) parser that generates a ruby statemachine.
52
+ email: Sebastian@Feuerstack.org
53
+ executables: []
54
+
55
+ extensions: []
56
+
57
+ extra_rdoc_files:
58
+ - History.txt
59
+ - Manifest.txt
60
+ files:
61
+ - Gemfile
62
+ - Gemfile.lock
63
+ - History.txt
64
+ - MINT-scxml.gemspec
65
+ - Manifest.txt
66
+ - README.rdoc
67
+ - Rakefile
68
+ - lib/MINT-scxml.rb
69
+ - lib/MINT-scxml/scxml-parser.rb
70
+ - spec/atm_spec.rb
71
+ - spec/parser_spec.rb
72
+ - spec/spec.opts
73
+ - spec/spec_helper.rb
74
+ - spec/test_handgestures_spec.rb
75
+ - spec/testmachines/atm_enhanced.rb
76
+ - spec/testmachines/handgestures-scxmlgui.png
77
+ - spec/testmachines/handgestures-scxmlgui.scxml
78
+ - spec/testmachines/multiplestates.rb
79
+ - spec/testmachines/traffic_light_enhanced.rb
80
+ - spec/testmachines/vending_machine1.rb
81
+ - spec/testmachines/vending_machine2.rb
82
+ - spec/testmachines/vending_machine3.rb
83
+ - spec/testmachines/vending_machine4.rb
84
+ - spec_helper.rb
85
+ - statemachines/AICommand_scxml_spec.rb
86
+ - statemachines/AIO_scxml_spec.rb
87
+ - statemachines/aui-scxml/AIC.scxml
88
+ - statemachines/aui-scxml/AICommand.scxml
89
+ - statemachines/aui-scxml/AICommand2.scxml
90
+ - statemachines/aui-scxml/AIO.scxml
91
+ - statemachines/aui/AIC.rb
92
+ - statemachines/aui/AIChoiceElement.rb
93
+ - statemachines/aui/AICommand.rb
94
+ - statemachines/aui/AIIN.rb
95
+ - statemachines/aui/AIINContinous.rb
96
+ - statemachines/aui/AIMultiChoice.rb
97
+ - statemachines/aui/AIMultiChoiceElement.rb
98
+ - statemachines/aui/AIOUTContinous.rb
99
+ - statemachines/aui/AISingleChoice.rb
100
+ - statemachines/aui/AISingleChoiceElement.rb
101
+ - statemachines/aui/aio.rb
102
+ - statemachines/specs/AICommand_spec.rb
103
+ - statemachines/specs/AIINContinous_spec.rb
104
+ - statemachines/specs/AIMultiChoiceElement_spec.rb
105
+ - statemachines/specs/AIMultiChoice_spec.rb
106
+ - statemachines/specs/AIOUTContinous_spec.rb
107
+ - statemachines/specs/AIO_spec.rb
108
+ - statemachines/specs/AISingleChoiceElement_spec.rb
109
+ - statemachines/specs/AISingleChoice_spec.rb
110
+ - .gemtest
111
+ homepage: http://www.multi-access.de
112
+ licenses: []
113
+
114
+ post_install_message:
115
+ rdoc_options:
116
+ - --main
117
+ - README.rdoc
118
+ require_paths:
119
+ - lib
120
+ required_ruby_version: !ruby/object:Gem::Requirement
121
+ none: false
122
+ requirements:
123
+ - - ">="
124
+ - !ruby/object:Gem::Version
125
+ hash: 3
126
+ segments:
127
+ - 0
128
+ version: "0"
129
+ required_rubygems_version: !ruby/object:Gem::Requirement
130
+ none: false
131
+ requirements:
132
+ - - ">="
133
+ - !ruby/object:Gem::Version
134
+ hash: 3
135
+ segments:
136
+ - 0
137
+ version: "0"
138
+ requirements: []
139
+
140
+ rubyforge_project: MINT-scxml
141
+ rubygems_version: 1.8.5
142
+ signing_key:
143
+ specification_version: 3
144
+ summary: This gem implements a state chart XML (SCXML) parser that generates a ruby statemachine.
145
+ test_files: []
146
+