state_machine 0.9.4 → 0.10.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/CHANGELOG.rdoc +20 -0
- data/LICENSE +1 -1
- data/README.rdoc +74 -4
- data/Rakefile +3 -3
- data/lib/state_machine.rb +51 -24
- data/lib/state_machine/{guard.rb → branch.rb} +34 -40
- data/lib/state_machine/callback.rb +13 -18
- data/lib/state_machine/error.rb +13 -0
- data/lib/state_machine/eval_helpers.rb +3 -0
- data/lib/state_machine/event.rb +67 -30
- data/lib/state_machine/event_collection.rb +20 -3
- data/lib/state_machine/extensions.rb +3 -3
- data/lib/state_machine/integrations.rb +7 -0
- data/lib/state_machine/integrations/active_model.rb +149 -59
- data/lib/state_machine/integrations/active_model/versions.rb +30 -0
- data/lib/state_machine/integrations/active_record.rb +74 -148
- data/lib/state_machine/integrations/active_record/locale.rb +0 -7
- data/lib/state_machine/integrations/active_record/versions.rb +149 -0
- data/lib/state_machine/integrations/base.rb +64 -0
- data/lib/state_machine/integrations/data_mapper.rb +50 -39
- data/lib/state_machine/integrations/data_mapper/observer.rb +47 -12
- data/lib/state_machine/integrations/data_mapper/versions.rb +62 -0
- data/lib/state_machine/integrations/mongo_mapper.rb +37 -64
- data/lib/state_machine/integrations/mongo_mapper/locale.rb +4 -0
- data/lib/state_machine/integrations/mongo_mapper/versions.rb +102 -0
- data/lib/state_machine/integrations/mongoid.rb +297 -0
- data/lib/state_machine/integrations/mongoid/locale.rb +4 -0
- data/lib/state_machine/integrations/mongoid/versions.rb +18 -0
- data/lib/state_machine/integrations/sequel.rb +99 -55
- data/lib/state_machine/integrations/sequel/versions.rb +40 -0
- data/lib/state_machine/machine.rb +273 -136
- data/lib/state_machine/machine_collection.rb +21 -13
- data/lib/state_machine/node_collection.rb +6 -1
- data/lib/state_machine/path.rb +120 -0
- data/lib/state_machine/path_collection.rb +90 -0
- data/lib/state_machine/state.rb +28 -9
- data/lib/state_machine/state_collection.rb +1 -1
- data/lib/state_machine/transition.rb +65 -6
- data/lib/state_machine/transition_collection.rb +1 -1
- data/test/files/en.yml +8 -0
- data/test/functional/state_machine_test.rb +15 -2
- data/test/unit/branch_test.rb +890 -0
- data/test/unit/callback_test.rb +9 -36
- data/test/unit/error_test.rb +43 -0
- data/test/unit/event_collection_test.rb +67 -33
- data/test/unit/event_test.rb +165 -38
- data/test/unit/integrations/active_model_test.rb +103 -3
- data/test/unit/integrations/active_record_test.rb +90 -43
- data/test/unit/integrations/base_test.rb +87 -0
- data/test/unit/integrations/data_mapper_test.rb +105 -44
- data/test/unit/integrations/mongo_mapper_test.rb +261 -64
- data/test/unit/integrations/mongoid_test.rb +1529 -0
- data/test/unit/integrations/sequel_test.rb +33 -49
- data/test/unit/integrations_test.rb +4 -0
- data/test/unit/invalid_event_test.rb +15 -2
- data/test/unit/invalid_parallel_transition_test.rb +18 -0
- data/test/unit/invalid_transition_test.rb +72 -2
- data/test/unit/machine_collection_test.rb +55 -61
- data/test/unit/machine_test.rb +388 -26
- data/test/unit/node_collection_test.rb +14 -4
- data/test/unit/path_collection_test.rb +266 -0
- data/test/unit/path_test.rb +485 -0
- data/test/unit/state_collection_test.rb +30 -0
- data/test/unit/state_test.rb +82 -35
- data/test/unit/transition_collection_test.rb +48 -44
- data/test/unit/transition_test.rb +198 -41
- metadata +111 -74
- data/test/unit/guard_test.rb +0 -909
@@ -589,24 +589,12 @@ class TransitionWithAfterCallbacksTest < Test::Unit::TestCase
|
|
589
589
|
assert !@run
|
590
590
|
end
|
591
591
|
|
592
|
-
def test_should_run_if_not_successful_and_includes_failures
|
593
|
-
@machine.after_transition(:include_failures => true) {|object| @run = true}
|
594
|
-
@transition.run_callbacks {{:success => false}}
|
595
|
-
assert @run
|
596
|
-
end
|
597
|
-
|
598
592
|
def test_should_run_if_successful
|
599
593
|
@machine.after_transition {|object| @run = true}
|
600
594
|
@transition.run_callbacks {{:success => true}}
|
601
595
|
assert @run
|
602
596
|
end
|
603
597
|
|
604
|
-
def test_should_run_if_successful_and_includes_failures
|
605
|
-
@machine.after_transition(:include_failures => true) {|object| @run = true}
|
606
|
-
@transition.run_callbacks {{:success => true}}
|
607
|
-
assert @run
|
608
|
-
end
|
609
|
-
|
610
598
|
def test_should_pass_transition_as_argument
|
611
599
|
@machine.after_transition {|*args| @args = args}
|
612
600
|
|
@@ -826,13 +814,6 @@ class TransitionWithAroundCallbacksTest < Test::Unit::TestCase
|
|
826
814
|
assert !@after_run
|
827
815
|
end
|
828
816
|
|
829
|
-
def test_should_succeed_if_including_failure_and_block_success_is_false
|
830
|
-
@machine.around_transition(:include_failures => true) {|block| @before_run = true; block.call; @after_run = true}
|
831
|
-
assert_equal true, @transition.run_callbacks {{:success => false}}
|
832
|
-
assert @before_run
|
833
|
-
assert @after_run
|
834
|
-
end
|
835
|
-
|
836
817
|
def test_should_succeed_if_block_success_is_false
|
837
818
|
@machine.around_transition {|block| @before_run = true; block.call; @after_run = true}
|
838
819
|
assert_equal true, @transition.run_callbacks {{:success => true}}
|
@@ -954,6 +935,128 @@ class TransitionWithMultipleAroundCallbacksTest < Test::Unit::TestCase
|
|
954
935
|
end
|
955
936
|
end
|
956
937
|
|
938
|
+
class TransitionWithFailureCallbacksTest < Test::Unit::TestCase
|
939
|
+
def setup
|
940
|
+
@klass = Class.new
|
941
|
+
|
942
|
+
@machine = StateMachine::Machine.new(@klass)
|
943
|
+
@machine.state :parked, :idling
|
944
|
+
@machine.event :ignite
|
945
|
+
|
946
|
+
@object = @klass.new
|
947
|
+
@object.state = 'parked'
|
948
|
+
@transition = StateMachine::Transition.new(@object, @machine, :ignite, :parked, :idling)
|
949
|
+
end
|
950
|
+
|
951
|
+
def test_should_only_run_those_that_match_transition_context
|
952
|
+
@count = 0
|
953
|
+
callback = lambda {@count += 1}
|
954
|
+
|
955
|
+
@machine.after_failure :do => callback
|
956
|
+
@machine.after_failure :on => :park, :do => callback
|
957
|
+
@machine.after_failure :on => :ignite, :do => callback
|
958
|
+
@transition.run_callbacks {{:success => false}}
|
959
|
+
|
960
|
+
assert_equal 2, @count
|
961
|
+
end
|
962
|
+
|
963
|
+
def test_should_run_if_not_successful
|
964
|
+
@machine.after_failure {|object| @run = true}
|
965
|
+
@transition.run_callbacks {{:success => false}}
|
966
|
+
assert @run
|
967
|
+
end
|
968
|
+
|
969
|
+
def test_should_not_run_if_successful
|
970
|
+
@machine.after_failure {|object| @run = true}
|
971
|
+
@transition.run_callbacks {{:success => true}}
|
972
|
+
assert !@run
|
973
|
+
end
|
974
|
+
|
975
|
+
def test_should_pass_transition_as_argument
|
976
|
+
@machine.after_failure {|*args| @args = args}
|
977
|
+
|
978
|
+
@transition.run_callbacks {{:success => false}}
|
979
|
+
assert_equal [@object, @transition], @args
|
980
|
+
end
|
981
|
+
|
982
|
+
def test_should_catch_halts
|
983
|
+
@machine.after_failure {throw :halt}
|
984
|
+
|
985
|
+
result = nil
|
986
|
+
assert_nothing_thrown { result = @transition.run_callbacks {{:success => false}} }
|
987
|
+
assert_equal true, result
|
988
|
+
end
|
989
|
+
|
990
|
+
def test_should_not_catch_exceptions
|
991
|
+
@machine.after_failure {raise ArgumentError}
|
992
|
+
assert_raise(ArgumentError) { @transition.run_callbacks {{:success => false}} }
|
993
|
+
end
|
994
|
+
|
995
|
+
def test_should_not_be_able_to_run_twice
|
996
|
+
@count = 0
|
997
|
+
@machine.after_failure {@count += 1}
|
998
|
+
@transition.run_callbacks {{:success => false}}
|
999
|
+
@transition.run_callbacks {{:success => false}}
|
1000
|
+
assert_equal 1, @count
|
1001
|
+
end
|
1002
|
+
|
1003
|
+
def test_should_not_be_able_to_run_twice_if_halted
|
1004
|
+
@count = 0
|
1005
|
+
@machine.after_failure {@count += 1; throw :halt}
|
1006
|
+
@transition.run_callbacks {{:success => false}}
|
1007
|
+
@transition.run_callbacks {{:success => false}}
|
1008
|
+
assert_equal 1, @count
|
1009
|
+
end
|
1010
|
+
|
1011
|
+
def test_should_be_able_to_run_again_after_resetting
|
1012
|
+
@count = 0
|
1013
|
+
@machine.after_failure {@count += 1}
|
1014
|
+
@transition.run_callbacks {{:success => false}}
|
1015
|
+
@transition.reset
|
1016
|
+
@transition.run_callbacks {{:success => false}}
|
1017
|
+
assert_equal 2, @count
|
1018
|
+
end
|
1019
|
+
end
|
1020
|
+
|
1021
|
+
class TransitionWithMultipleFailureCallbacksTest < Test::Unit::TestCase
|
1022
|
+
def setup
|
1023
|
+
@klass = Class.new
|
1024
|
+
|
1025
|
+
@machine = StateMachine::Machine.new(@klass)
|
1026
|
+
@machine.state :parked, :idling
|
1027
|
+
@machine.event :ignite
|
1028
|
+
|
1029
|
+
@object = @klass.new
|
1030
|
+
@object.state = 'parked'
|
1031
|
+
@transition = StateMachine::Transition.new(@object, @machine, :ignite, :parked, :idling)
|
1032
|
+
end
|
1033
|
+
|
1034
|
+
def test_should_run_in_the_order_they_were_defined
|
1035
|
+
@callbacks = []
|
1036
|
+
@machine.after_failure {@callbacks << 1}
|
1037
|
+
@machine.after_failure {@callbacks << 2}
|
1038
|
+
@transition.run_callbacks {{:success => false}}
|
1039
|
+
|
1040
|
+
assert_equal [1, 2], @callbacks
|
1041
|
+
end
|
1042
|
+
|
1043
|
+
def test_should_not_run_further_callbacks_if_halted
|
1044
|
+
@callbacks = []
|
1045
|
+
@machine.after_failure {@callbacks << 1; throw :halt}
|
1046
|
+
@machine.after_failure {@callbacks << 2}
|
1047
|
+
|
1048
|
+
assert_equal true, @transition.run_callbacks {{:success => false}}
|
1049
|
+
assert_equal [1], @callbacks
|
1050
|
+
end
|
1051
|
+
|
1052
|
+
def test_should_fail_if_any_callback_halted
|
1053
|
+
@machine.after_failure {true}
|
1054
|
+
@machine.after_failure {throw :halt}
|
1055
|
+
|
1056
|
+
assert_equal true, @transition.run_callbacks {{:success => false}}
|
1057
|
+
end
|
1058
|
+
end
|
1059
|
+
|
957
1060
|
class TransitionWithMixedCallbacksTest < Test::Unit::TestCase
|
958
1061
|
def setup
|
959
1062
|
@klass = Class.new
|
@@ -1056,16 +1159,33 @@ class TransitionWithMixedCallbacksTest < Test::Unit::TestCase
|
|
1056
1159
|
assert_equal true, @transition.run_callbacks
|
1057
1160
|
assert_equal [:before_1, :before_around_1, :before_2, :before_around_2, :after_around_2, :after_around_1, :after_1], @callbacks
|
1058
1161
|
end
|
1162
|
+
end
|
1163
|
+
|
1164
|
+
class TransitionWithBeforeCallbacksSkippedTest < Test::Unit::TestCase
|
1165
|
+
def setup
|
1166
|
+
@klass = Class.new
|
1167
|
+
|
1168
|
+
@machine = StateMachine::Machine.new(@klass)
|
1169
|
+
@machine.state :parked, :idling
|
1170
|
+
@machine.event :ignite
|
1171
|
+
|
1172
|
+
@object = @klass.new
|
1173
|
+
@object.state = 'parked'
|
1174
|
+
@transition = StateMachine::Transition.new(@object, @machine, :ignite, :parked, :idling)
|
1175
|
+
end
|
1059
1176
|
|
1060
|
-
def
|
1061
|
-
@
|
1062
|
-
@machine.around_transition {|block| block.call; @callbacks << :after_around_1}
|
1063
|
-
@machine.around_transition(:include_failures => true) {|block| block.call; @callbacks << :after_around_2}
|
1064
|
-
@machine.after_transition {@callbacks << :after_1}
|
1065
|
-
@machine.after_transition(:include_failures => true) {@callbacks << :after_2}
|
1177
|
+
def test_should_not_run_before_callbacks
|
1178
|
+
@machine.before_transition {@run = true}
|
1066
1179
|
|
1067
|
-
assert_equal
|
1068
|
-
|
1180
|
+
assert_equal false, @transition.run_callbacks(:before => false)
|
1181
|
+
assert !@run
|
1182
|
+
end
|
1183
|
+
|
1184
|
+
def test_should_run_failure_callbacks
|
1185
|
+
@machine.after_failure {@run = true}
|
1186
|
+
|
1187
|
+
assert_equal false, @transition.run_callbacks(:before => false)
|
1188
|
+
assert @run
|
1069
1189
|
end
|
1070
1190
|
end
|
1071
1191
|
|
@@ -1110,20 +1230,6 @@ class TransitionWithAfterCallbacksSkippedTest < Test::Unit::TestCase
|
|
1110
1230
|
assert !@run
|
1111
1231
|
end
|
1112
1232
|
|
1113
|
-
def test_should_run_after_callbacks_that_include_failures_if_block_success_is_false
|
1114
|
-
@machine.after_transition(:include_failures => true) {@run = true}
|
1115
|
-
|
1116
|
-
assert_equal true, @transition.run_callbacks(:after => false) {{:success => false}}
|
1117
|
-
assert @run
|
1118
|
-
end
|
1119
|
-
|
1120
|
-
def test_should_run_around_callbacks_that_include_failures_if_block_success_is_false
|
1121
|
-
@machine.around_transition(:include_failures => true) {|block| block.call; @run = true}
|
1122
|
-
|
1123
|
-
assert_equal true, @transition.run_callbacks(:after => false) {{:success => false}}
|
1124
|
-
assert @run
|
1125
|
-
end
|
1126
|
-
|
1127
1233
|
def test_should_continue_around_transition_execution_on_second_call
|
1128
1234
|
@callbacks = []
|
1129
1235
|
@machine.around_transition {|block| @callbacks << :before_around_1; block.call; @callbacks << :after_around_1}
|
@@ -1382,3 +1488,54 @@ class TransitionTransientTest < Test::Unit::TestCase
|
|
1382
1488
|
assert @transition.transient?
|
1383
1489
|
end
|
1384
1490
|
end
|
1491
|
+
|
1492
|
+
class TransitionEqualityTest < Test::Unit::TestCase
|
1493
|
+
def setup
|
1494
|
+
@klass = Class.new
|
1495
|
+
|
1496
|
+
@machine = StateMachine::Machine.new(@klass)
|
1497
|
+
@machine.state :parked, :idling
|
1498
|
+
@machine.event :ignite
|
1499
|
+
|
1500
|
+
@object = @klass.new
|
1501
|
+
@object.state = 'parked'
|
1502
|
+
@transition = StateMachine::Transition.new(@object, @machine, :ignite, :parked, :idling)
|
1503
|
+
end
|
1504
|
+
|
1505
|
+
def test_should_be_equal_with_same_properties
|
1506
|
+
transition = StateMachine::Transition.new(@object, @machine, :ignite, :parked, :idling)
|
1507
|
+
assert_equal transition, @transition
|
1508
|
+
end
|
1509
|
+
|
1510
|
+
def test_should_not_be_equal_with_different_machines
|
1511
|
+
machine = StateMachine::Machine.new(@klass, :namespace => :other)
|
1512
|
+
machine.state :parked, :idling
|
1513
|
+
machine.event :ignite
|
1514
|
+
transition = StateMachine::Transition.new(@object, machine, :ignite, :parked, :idling)
|
1515
|
+
|
1516
|
+
assert_not_equal transition, @transition
|
1517
|
+
end
|
1518
|
+
|
1519
|
+
def test_should_not_be_equal_with_different_objects
|
1520
|
+
transition = StateMachine::Transition.new(@klass.new, @machine, :ignite, :parked, :idling)
|
1521
|
+
assert_not_equal transition, @transition
|
1522
|
+
end
|
1523
|
+
|
1524
|
+
def test_should_not_be_equal_with_different_event_names
|
1525
|
+
@machine.event :park
|
1526
|
+
transition = StateMachine::Transition.new(@object, @machine, :park, :parked, :idling)
|
1527
|
+
assert_not_equal transition, @transition
|
1528
|
+
end
|
1529
|
+
|
1530
|
+
def test_should_not_be_equal_with_different_from_state_names
|
1531
|
+
@machine.state :first_gear
|
1532
|
+
transition = StateMachine::Transition.new(@object, @machine, :ignite, :first_gear, :idling)
|
1533
|
+
assert_not_equal transition, @transition
|
1534
|
+
end
|
1535
|
+
|
1536
|
+
def test_should_not_be_equal_with_different_to_state_names
|
1537
|
+
@machine.state :first_gear
|
1538
|
+
transition = StateMachine::Transition.new(@object, @machine, :ignite, :idling, :first_gear)
|
1539
|
+
assert_not_equal transition, @transition
|
1540
|
+
end
|
1541
|
+
end
|
metadata
CHANGED
@@ -1,7 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: state_machine
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
|
4
|
+
hash: 55
|
5
|
+
prerelease: false
|
6
|
+
segments:
|
7
|
+
- 0
|
8
|
+
- 10
|
9
|
+
- 0
|
10
|
+
version: 0.10.0
|
5
11
|
platform: ruby
|
6
12
|
authors:
|
7
13
|
- Aaron Pfeifer
|
@@ -9,7 +15,7 @@ autorequire:
|
|
9
15
|
bindir: bin
|
10
16
|
cert_chain: []
|
11
17
|
|
12
|
-
date:
|
18
|
+
date: 2011-03-19 00:00:00 -04:00
|
13
19
|
default_executable:
|
14
20
|
dependencies: []
|
15
21
|
|
@@ -22,88 +28,107 @@ extensions: []
|
|
22
28
|
extra_rdoc_files: []
|
23
29
|
|
24
30
|
files:
|
25
|
-
- examples/
|
26
|
-
- examples/vehicle.rb
|
27
|
-
- examples/car.rb
|
28
|
-
- examples/Vehicle_state.png
|
29
|
-
- examples/rails-rest/view_index.html.erb
|
31
|
+
- examples/rails-rest/view_edit.html.erb
|
30
32
|
- examples/rails-rest/view_new.html.erb
|
31
33
|
- examples/rails-rest/view_show.html.erb
|
32
|
-
- examples/rails-rest/controller.rb
|
33
|
-
- examples/rails-rest/view_edit.html.erb
|
34
34
|
- examples/rails-rest/model.rb
|
35
35
|
- examples/rails-rest/migration.rb
|
36
|
-
- examples/
|
36
|
+
- examples/rails-rest/view_index.html.erb
|
37
|
+
- examples/rails-rest/controller.rb
|
38
|
+
- examples/TrafficLight_state.png
|
37
39
|
- examples/traffic_light.rb
|
38
|
-
- examples/
|
40
|
+
- examples/AutoShop_state.png
|
41
|
+
- examples/Vehicle_state.png
|
42
|
+
- examples/auto_shop.rb
|
43
|
+
- examples/vehicle.rb
|
44
|
+
- examples/merb-rest/view_edit.html.erb
|
39
45
|
- examples/merb-rest/view_new.html.erb
|
40
46
|
- examples/merb-rest/view_show.html.erb
|
41
|
-
- examples/merb-rest/controller.rb
|
42
|
-
- examples/merb-rest/view_edit.html.erb
|
43
47
|
- examples/merb-rest/model.rb
|
44
|
-
- examples/
|
45
|
-
- examples/
|
46
|
-
-
|
47
|
-
-
|
48
|
-
- lib/tasks/state_machine.rb
|
49
|
-
- lib/state_machine/transition.rb
|
50
|
-
- lib/state_machine/initializers/rails.rb
|
51
|
-
- lib/state_machine/initializers/merb.rb
|
52
|
-
- lib/state_machine/condition_proxy.rb
|
53
|
-
- lib/state_machine/matcher.rb
|
54
|
-
- lib/state_machine/state.rb
|
55
|
-
- lib/state_machine/assertions.rb
|
56
|
-
- lib/state_machine/integrations.rb
|
57
|
-
- lib/state_machine/eval_helpers.rb
|
58
|
-
- lib/state_machine/event_collection.rb
|
59
|
-
- lib/state_machine/matcher_helpers.rb
|
60
|
-
- lib/state_machine/guard.rb
|
61
|
-
- lib/state_machine/event.rb
|
48
|
+
- examples/merb-rest/view_index.html.erb
|
49
|
+
- examples/merb-rest/controller.rb
|
50
|
+
- examples/Car_state.png
|
51
|
+
- examples/car.rb
|
62
52
|
- lib/state_machine/callback.rb
|
53
|
+
- lib/state_machine/condition_proxy.rb
|
54
|
+
- lib/state_machine/error.rb
|
63
55
|
- lib/state_machine/machine_collection.rb
|
64
|
-
- lib/state_machine/
|
65
|
-
- lib/state_machine/
|
56
|
+
- lib/state_machine/integrations/sequel/versions.rb
|
57
|
+
- lib/state_machine/integrations/base.rb
|
58
|
+
- lib/state_machine/integrations/sequel.rb
|
66
59
|
- lib/state_machine/integrations/active_model.rb
|
60
|
+
- lib/state_machine/integrations/data_mapper/observer.rb
|
61
|
+
- lib/state_machine/integrations/data_mapper/versions.rb
|
67
62
|
- lib/state_machine/integrations/mongo_mapper.rb
|
68
|
-
- lib/state_machine/integrations/data_mapper.rb
|
69
|
-
- lib/state_machine/integrations/active_record.rb
|
70
|
-
- lib/state_machine/integrations/sequel.rb
|
71
63
|
- lib/state_machine/integrations/active_record/locale.rb
|
72
|
-
- lib/state_machine/integrations/
|
64
|
+
- lib/state_machine/integrations/active_record/versions.rb
|
65
|
+
- lib/state_machine/integrations/mongo_mapper/locale.rb
|
66
|
+
- lib/state_machine/integrations/mongo_mapper/versions.rb
|
67
|
+
- lib/state_machine/integrations/data_mapper.rb
|
68
|
+
- lib/state_machine/integrations/mongoid.rb
|
73
69
|
- lib/state_machine/integrations/active_model/locale.rb
|
74
70
|
- lib/state_machine/integrations/active_model/observer.rb
|
71
|
+
- lib/state_machine/integrations/active_model/versions.rb
|
72
|
+
- lib/state_machine/integrations/mongoid/locale.rb
|
73
|
+
- lib/state_machine/integrations/mongoid/versions.rb
|
74
|
+
- lib/state_machine/integrations/active_record.rb
|
75
|
+
- lib/state_machine/integrations.rb
|
76
|
+
- lib/state_machine/path_collection.rb
|
75
77
|
- lib/state_machine/state_collection.rb
|
76
|
-
- lib/state_machine/
|
78
|
+
- lib/state_machine/matcher.rb
|
79
|
+
- lib/state_machine/machine.rb
|
80
|
+
- lib/state_machine/branch.rb
|
81
|
+
- lib/state_machine/event_collection.rb
|
82
|
+
- lib/state_machine/eval_helpers.rb
|
83
|
+
- lib/state_machine/path.rb
|
77
84
|
- lib/state_machine/extensions.rb
|
85
|
+
- lib/state_machine/initializers/merb.rb
|
86
|
+
- lib/state_machine/initializers/rails.rb
|
78
87
|
- lib/state_machine/initializers.rb
|
79
|
-
-
|
88
|
+
- lib/state_machine/node_collection.rb
|
89
|
+
- lib/state_machine/assertions.rb
|
90
|
+
- lib/state_machine/event.rb
|
91
|
+
- lib/state_machine/state.rb
|
92
|
+
- lib/state_machine/matcher_helpers.rb
|
93
|
+
- lib/state_machine/transition.rb
|
94
|
+
- lib/state_machine/transition_collection.rb
|
95
|
+
- lib/tasks/state_machine.rake
|
96
|
+
- lib/tasks/state_machine.rb
|
97
|
+
- lib/state_machine.rb
|
98
|
+
- test/functional/state_machine_test.rb
|
80
99
|
- test/files/switch.rb
|
81
|
-
- test/
|
82
|
-
- test/unit/transition_test.rb
|
100
|
+
- test/files/en.yml
|
83
101
|
- test/unit/machine_test.rb
|
84
|
-
- test/unit/
|
85
|
-
- test/unit/
|
86
|
-
- test/unit/
|
87
|
-
- test/unit/
|
88
|
-
- test/unit/
|
102
|
+
- test/unit/transition_test.rb
|
103
|
+
- test/unit/matcher_helpers_test.rb
|
104
|
+
- test/unit/invalid_parallel_transition_test.rb
|
105
|
+
- test/unit/state_test.rb
|
106
|
+
- test/unit/path_collection_test.rb
|
107
|
+
- test/unit/node_collection_test.rb
|
89
108
|
- test/unit/assertions_test.rb
|
90
|
-
- test/unit/
|
91
|
-
- test/unit/
|
92
|
-
- test/unit/
|
109
|
+
- test/unit/state_machine_test.rb
|
110
|
+
- test/unit/invalid_event_test.rb
|
111
|
+
- test/unit/branch_test.rb
|
112
|
+
- test/unit/event_test.rb
|
113
|
+
- test/unit/callback_test.rb
|
93
114
|
- test/unit/eval_helpers_test.rb
|
94
115
|
- test/unit/integrations/mongo_mapper_test.rb
|
95
116
|
- test/unit/integrations/data_mapper_test.rb
|
96
|
-
- test/unit/integrations/sequel_test.rb
|
97
117
|
- test/unit/integrations/active_model_test.rb
|
98
118
|
- test/unit/integrations/active_record_test.rb
|
119
|
+
- test/unit/integrations/sequel_test.rb
|
120
|
+
- test/unit/integrations/base_test.rb
|
121
|
+
- test/unit/integrations/mongoid_test.rb
|
122
|
+
- test/unit/error_test.rb
|
123
|
+
- test/unit/state_collection_test.rb
|
124
|
+
- test/unit/invalid_transition_test.rb
|
125
|
+
- test/unit/integrations_test.rb
|
126
|
+
- test/unit/transition_collection_test.rb
|
99
127
|
- test/unit/matcher_test.rb
|
100
|
-
- test/unit/node_collection_test.rb
|
101
|
-
- test/unit/matcher_helpers_test.rb
|
102
|
-
- test/unit/state_test.rb
|
103
128
|
- test/unit/machine_collection_test.rb
|
104
|
-
- test/unit/
|
129
|
+
- test/unit/event_collection_test.rb
|
130
|
+
- test/unit/path_test.rb
|
105
131
|
- test/unit/condition_proxy_test.rb
|
106
|
-
- test/functional/state_machine_test.rb
|
107
132
|
- test/test_helper.rb
|
108
133
|
- CHANGELOG.rdoc
|
109
134
|
- init.rb
|
@@ -120,48 +145,60 @@ rdoc_options: []
|
|
120
145
|
require_paths:
|
121
146
|
- lib
|
122
147
|
required_ruby_version: !ruby/object:Gem::Requirement
|
148
|
+
none: false
|
123
149
|
requirements:
|
124
150
|
- - ">="
|
125
151
|
- !ruby/object:Gem::Version
|
152
|
+
hash: 3
|
153
|
+
segments:
|
154
|
+
- 0
|
126
155
|
version: "0"
|
127
|
-
version:
|
128
156
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
157
|
+
none: false
|
129
158
|
requirements:
|
130
159
|
- - ">="
|
131
160
|
- !ruby/object:Gem::Version
|
161
|
+
hash: 3
|
162
|
+
segments:
|
163
|
+
- 0
|
132
164
|
version: "0"
|
133
|
-
version:
|
134
165
|
requirements: []
|
135
166
|
|
136
167
|
rubyforge_project: pluginaweek
|
137
|
-
rubygems_version: 1.3.
|
168
|
+
rubygems_version: 1.3.7
|
138
169
|
signing_key:
|
139
170
|
specification_version: 3
|
140
171
|
summary: Adds support for creating state machines for attributes on any Ruby class
|
141
172
|
test_files:
|
142
|
-
- test/
|
143
|
-
- test/unit/transition_test.rb
|
173
|
+
- test/functional/state_machine_test.rb
|
144
174
|
- test/unit/machine_test.rb
|
145
|
-
- test/unit/
|
146
|
-
- test/unit/
|
147
|
-
- test/unit/
|
148
|
-
- test/unit/
|
149
|
-
- test/unit/
|
175
|
+
- test/unit/transition_test.rb
|
176
|
+
- test/unit/matcher_helpers_test.rb
|
177
|
+
- test/unit/invalid_parallel_transition_test.rb
|
178
|
+
- test/unit/state_test.rb
|
179
|
+
- test/unit/path_collection_test.rb
|
180
|
+
- test/unit/node_collection_test.rb
|
150
181
|
- test/unit/assertions_test.rb
|
151
|
-
- test/unit/
|
152
|
-
- test/unit/
|
153
|
-
- test/unit/
|
182
|
+
- test/unit/state_machine_test.rb
|
183
|
+
- test/unit/invalid_event_test.rb
|
184
|
+
- test/unit/branch_test.rb
|
185
|
+
- test/unit/event_test.rb
|
186
|
+
- test/unit/callback_test.rb
|
154
187
|
- test/unit/eval_helpers_test.rb
|
155
188
|
- test/unit/integrations/mongo_mapper_test.rb
|
156
189
|
- test/unit/integrations/data_mapper_test.rb
|
157
|
-
- test/unit/integrations/sequel_test.rb
|
158
190
|
- test/unit/integrations/active_model_test.rb
|
159
191
|
- test/unit/integrations/active_record_test.rb
|
192
|
+
- test/unit/integrations/sequel_test.rb
|
193
|
+
- test/unit/integrations/base_test.rb
|
194
|
+
- test/unit/integrations/mongoid_test.rb
|
195
|
+
- test/unit/error_test.rb
|
196
|
+
- test/unit/state_collection_test.rb
|
197
|
+
- test/unit/invalid_transition_test.rb
|
198
|
+
- test/unit/integrations_test.rb
|
199
|
+
- test/unit/transition_collection_test.rb
|
160
200
|
- test/unit/matcher_test.rb
|
161
|
-
- test/unit/node_collection_test.rb
|
162
|
-
- test/unit/matcher_helpers_test.rb
|
163
|
-
- test/unit/state_test.rb
|
164
201
|
- test/unit/machine_collection_test.rb
|
165
|
-
- test/unit/
|
202
|
+
- test/unit/event_collection_test.rb
|
203
|
+
- test/unit/path_test.rb
|
166
204
|
- test/unit/condition_proxy_test.rb
|
167
|
-
- test/functional/state_machine_test.rb
|