state_machine 0.6.3 → 0.7.0
Sign up to get free protection for your applications and to get access to all the features.
- data/CHANGELOG.rdoc +31 -1
- data/README.rdoc +33 -21
- data/Rakefile +2 -2
- data/examples/merb-rest/controller.rb +51 -0
- data/examples/merb-rest/model.rb +28 -0
- data/examples/merb-rest/view_edit.html.erb +24 -0
- data/examples/merb-rest/view_index.html.erb +23 -0
- data/examples/merb-rest/view_new.html.erb +13 -0
- data/examples/merb-rest/view_show.html.erb +17 -0
- data/examples/rails-rest/controller.rb +43 -0
- data/examples/rails-rest/migration.rb +11 -0
- data/examples/rails-rest/model.rb +23 -0
- data/examples/rails-rest/view_edit.html.erb +25 -0
- data/examples/rails-rest/view_index.html.erb +23 -0
- data/examples/rails-rest/view_new.html.erb +14 -0
- data/examples/rails-rest/view_show.html.erb +17 -0
- data/lib/state_machine/assertions.rb +2 -2
- data/lib/state_machine/callback.rb +14 -8
- data/lib/state_machine/condition_proxy.rb +3 -3
- data/lib/state_machine/event.rb +19 -21
- data/lib/state_machine/event_collection.rb +114 -0
- data/lib/state_machine/extensions.rb +127 -11
- data/lib/state_machine/guard.rb +1 -1
- data/lib/state_machine/integrations/active_record/locale.rb +2 -1
- data/lib/state_machine/integrations/active_record.rb +117 -39
- data/lib/state_machine/integrations/data_mapper/observer.rb +20 -64
- data/lib/state_machine/integrations/data_mapper.rb +71 -26
- data/lib/state_machine/integrations/sequel.rb +69 -21
- data/lib/state_machine/machine.rb +267 -139
- data/lib/state_machine/machine_collection.rb +145 -0
- data/lib/state_machine/matcher.rb +2 -2
- data/lib/state_machine/node_collection.rb +9 -4
- data/lib/state_machine/state.rb +22 -32
- data/lib/state_machine/state_collection.rb +66 -17
- data/lib/state_machine/transition.rb +259 -28
- data/lib/state_machine.rb +121 -56
- data/tasks/state_machine.rake +1 -0
- data/tasks/state_machine.rb +26 -0
- data/test/active_record.log +116877 -0
- data/test/functional/state_machine_test.rb +118 -12
- data/test/sequel.log +28542 -0
- data/test/unit/callback_test.rb +46 -1
- data/test/unit/condition_proxy_test.rb +55 -28
- data/test/unit/event_collection_test.rb +228 -0
- data/test/unit/event_test.rb +51 -46
- data/test/unit/integrations/active_record_test.rb +128 -70
- data/test/unit/integrations/data_mapper_test.rb +150 -58
- data/test/unit/integrations/sequel_test.rb +63 -6
- data/test/unit/invalid_event_test.rb +7 -0
- data/test/unit/machine_collection_test.rb +678 -0
- data/test/unit/machine_test.rb +198 -91
- data/test/unit/node_collection_test.rb +33 -30
- data/test/unit/state_collection_test.rb +112 -5
- data/test/unit/state_test.rb +23 -3
- data/test/unit/transition_test.rb +750 -89
- metadata +28 -3
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: state_machine
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.7.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Aaron Pfeifer
|
@@ -9,7 +9,7 @@ autorequire:
|
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
11
|
|
12
|
-
date: 2009-
|
12
|
+
date: 2009-04-04 00:00:00 -04:00
|
13
13
|
default_executable:
|
14
14
|
dependencies: []
|
15
15
|
|
@@ -22,10 +22,25 @@ extensions: []
|
|
22
22
|
extra_rdoc_files: []
|
23
23
|
|
24
24
|
files:
|
25
|
+
- examples/rails-rest
|
26
|
+
- examples/rails-rest/view_edit.html.erb
|
27
|
+
- examples/rails-rest/migration.rb
|
28
|
+
- examples/rails-rest/view_show.html.erb
|
29
|
+
- examples/rails-rest/controller.rb
|
30
|
+
- examples/rails-rest/model.rb
|
31
|
+
- examples/rails-rest/view_new.html.erb
|
32
|
+
- examples/rails-rest/view_index.html.erb
|
25
33
|
- examples/car.rb
|
26
34
|
- examples/Vehicle_state.png
|
27
35
|
- examples/AutoShop_state.png
|
28
36
|
- examples/vehicle.rb
|
37
|
+
- examples/merb-rest
|
38
|
+
- examples/merb-rest/view_edit.html.erb
|
39
|
+
- examples/merb-rest/view_show.html.erb
|
40
|
+
- examples/merb-rest/controller.rb
|
41
|
+
- examples/merb-rest/model.rb
|
42
|
+
- examples/merb-rest/view_new.html.erb
|
43
|
+
- examples/merb-rest/view_index.html.erb
|
29
44
|
- examples/traffic_light.rb
|
30
45
|
- examples/TrafficLight_state.png
|
31
46
|
- examples/auto_shop.rb
|
@@ -48,6 +63,7 @@ files:
|
|
48
63
|
- lib/state_machine/matcher_helpers.rb
|
49
64
|
- lib/state_machine/transition.rb
|
50
65
|
- lib/state_machine/callback.rb
|
66
|
+
- lib/state_machine/machine_collection.rb
|
51
67
|
- lib/state_machine/extensions.rb
|
52
68
|
- lib/state_machine/state.rb
|
53
69
|
- lib/state_machine/state_collection.rb
|
@@ -55,7 +71,10 @@ files:
|
|
55
71
|
- lib/state_machine/matcher.rb
|
56
72
|
- lib/state_machine/condition_proxy.rb
|
57
73
|
- lib/state_machine/machine.rb
|
74
|
+
- lib/state_machine/event_collection.rb
|
58
75
|
- lib/state_machine.rb
|
76
|
+
- tasks/state_machine.rb
|
77
|
+
- tasks/state_machine.rake
|
59
78
|
- test/sequel.log
|
60
79
|
- test/active_record.log
|
61
80
|
- test/test_helper.rb
|
@@ -71,12 +90,15 @@ files:
|
|
71
90
|
- test/unit/integrations/data_mapper_test.rb
|
72
91
|
- test/unit/integrations/active_record_test.rb
|
73
92
|
- test/unit/integrations/sequel_test.rb
|
93
|
+
- test/unit/machine_collection_test.rb
|
74
94
|
- test/unit/state_machine_test.rb
|
75
95
|
- test/unit/state_collection_test.rb
|
96
|
+
- test/unit/invalid_event_test.rb
|
76
97
|
- test/unit/callback_test.rb
|
77
98
|
- test/unit/invalid_transition_test.rb
|
78
99
|
- test/unit/transition_test.rb
|
79
100
|
- test/unit/eval_helpers_test.rb
|
101
|
+
- test/unit/event_collection_test.rb
|
80
102
|
- test/unit/event_test.rb
|
81
103
|
- test/unit/state_test.rb
|
82
104
|
- test/unit/guard_test.rb
|
@@ -111,7 +133,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
111
133
|
requirements: []
|
112
134
|
|
113
135
|
rubyforge_project: pluginaweek
|
114
|
-
rubygems_version: 1.
|
136
|
+
rubygems_version: 1.3.1
|
115
137
|
signing_key:
|
116
138
|
specification_version: 2
|
117
139
|
summary: Adds support for creating state machines for attributes on any Ruby class
|
@@ -123,12 +145,15 @@ test_files:
|
|
123
145
|
- test/unit/integrations/data_mapper_test.rb
|
124
146
|
- test/unit/integrations/active_record_test.rb
|
125
147
|
- test/unit/integrations/sequel_test.rb
|
148
|
+
- test/unit/machine_collection_test.rb
|
126
149
|
- test/unit/state_machine_test.rb
|
127
150
|
- test/unit/state_collection_test.rb
|
151
|
+
- test/unit/invalid_event_test.rb
|
128
152
|
- test/unit/callback_test.rb
|
129
153
|
- test/unit/invalid_transition_test.rb
|
130
154
|
- test/unit/transition_test.rb
|
131
155
|
- test/unit/eval_helpers_test.rb
|
156
|
+
- test/unit/event_collection_test.rb
|
132
157
|
- test/unit/event_test.rb
|
133
158
|
- test/unit/state_test.rb
|
134
159
|
- test/unit/guard_test.rb
|