state_machine 1.0.1 → 1.0.2
Sign up to get free protection for your applications and to get access to all the features.
- data/.gitignore +11 -0
- data/.travis.yml +16 -0
- data/.yardopts +5 -0
- data/Appraisals +260 -0
- data/CHANGELOG.rdoc +15 -0
- data/Gemfile +3 -0
- data/README.rdoc +156 -29
- data/Rakefile +31 -57
- data/gemfiles/active_model-3.0.0.gemfile +7 -0
- data/gemfiles/active_model-3.0.0.gemfile.lock +32 -0
- data/gemfiles/active_model-3.0.5.gemfile +7 -0
- data/gemfiles/active_model-3.0.5.gemfile.lock +32 -0
- data/gemfiles/active_record-2.0.0.gemfile +8 -0
- data/gemfiles/active_record-2.0.0.gemfile.lock +30 -0
- data/gemfiles/active_record-2.0.5.gemfile +8 -0
- data/gemfiles/active_record-2.0.5.gemfile.lock +30 -0
- data/gemfiles/active_record-2.1.0.gemfile +8 -0
- data/gemfiles/active_record-2.1.0.gemfile.lock +30 -0
- data/gemfiles/active_record-2.1.2.gemfile +8 -0
- data/gemfiles/active_record-2.1.2.gemfile.lock +30 -0
- data/gemfiles/active_record-2.2.3.gemfile +8 -0
- data/gemfiles/active_record-2.2.3.gemfile.lock +30 -0
- data/gemfiles/active_record-2.3.12.gemfile +8 -0
- data/gemfiles/active_record-2.3.12.gemfile.lock +30 -0
- data/gemfiles/active_record-3.0.0.gemfile +8 -0
- data/gemfiles/active_record-3.0.0.gemfile.lock +44 -0
- data/gemfiles/active_record-3.0.5.gemfile +8 -0
- data/gemfiles/active_record-3.0.5.gemfile.lock +43 -0
- data/gemfiles/data_mapper-0.10.2.gemfile +12 -0
- data/gemfiles/data_mapper-0.10.2.gemfile.lock +45 -0
- data/gemfiles/data_mapper-0.9.11.gemfile +12 -0
- data/gemfiles/data_mapper-0.9.11.gemfile.lock +47 -0
- data/gemfiles/data_mapper-0.9.4.gemfile +12 -0
- data/gemfiles/data_mapper-0.9.4.gemfile.lock +61 -0
- data/gemfiles/data_mapper-0.9.7.gemfile +12 -0
- data/gemfiles/data_mapper-0.9.7.gemfile.lock +57 -0
- data/gemfiles/data_mapper-1.0.0.gemfile +12 -0
- data/gemfiles/data_mapper-1.0.0.gemfile.lock +53 -0
- data/gemfiles/data_mapper-1.0.1.gemfile +12 -0
- data/gemfiles/data_mapper-1.0.1.gemfile.lock +53 -0
- data/gemfiles/data_mapper-1.0.2.gemfile +12 -0
- data/gemfiles/data_mapper-1.0.2.gemfile.lock +53 -0
- data/gemfiles/data_mapper-1.1.0.gemfile +12 -0
- data/gemfiles/data_mapper-1.1.0.gemfile.lock +51 -0
- data/gemfiles/default.gemfile +7 -0
- data/gemfiles/default.gemfile.lock +24 -0
- data/gemfiles/mongo_mapper-0.5.5.gemfile +8 -0
- data/gemfiles/mongo_mapper-0.5.5.gemfile.lock +33 -0
- data/gemfiles/mongo_mapper-0.5.8.gemfile +8 -0
- data/gemfiles/mongo_mapper-0.5.8.gemfile.lock +33 -0
- data/gemfiles/mongo_mapper-0.6.0.gemfile +8 -0
- data/gemfiles/mongo_mapper-0.6.0.gemfile.lock +33 -0
- data/gemfiles/mongo_mapper-0.6.10.gemfile +8 -0
- data/gemfiles/mongo_mapper-0.6.10.gemfile.lock +33 -0
- data/gemfiles/mongo_mapper-0.7.0.gemfile +8 -0
- data/gemfiles/mongo_mapper-0.7.0.gemfile.lock +33 -0
- data/gemfiles/mongo_mapper-0.7.5.gemfile +8 -0
- data/gemfiles/mongo_mapper-0.7.5.gemfile.lock +36 -0
- data/gemfiles/mongo_mapper-0.8.0.gemfile +10 -0
- data/gemfiles/mongo_mapper-0.8.0.gemfile.lock +40 -0
- data/gemfiles/mongo_mapper-0.8.3.gemfile +10 -0
- data/gemfiles/mongo_mapper-0.8.3.gemfile.lock +40 -0
- data/gemfiles/mongo_mapper-0.8.4.gemfile +8 -0
- data/gemfiles/mongo_mapper-0.8.4.gemfile.lock +38 -0
- data/gemfiles/mongo_mapper-0.8.6.gemfile +8 -0
- data/gemfiles/mongo_mapper-0.8.6.gemfile.lock +38 -0
- data/gemfiles/mongo_mapper-0.9.0.gemfile +7 -0
- data/gemfiles/mongo_mapper-0.9.0.gemfile.lock +41 -0
- data/gemfiles/mongoid-2.0.0.gemfile +7 -0
- data/gemfiles/mongoid-2.0.0.gemfile.lock +42 -0
- data/gemfiles/mongoid-2.1.4.gemfile +7 -0
- data/gemfiles/mongoid-2.1.4.gemfile.lock +40 -0
- data/gemfiles/sequel-2.11.0.gemfile +8 -0
- data/gemfiles/sequel-2.11.0.gemfile.lock +28 -0
- data/gemfiles/sequel-2.12.0.gemfile +8 -0
- data/gemfiles/sequel-2.12.0.gemfile.lock +28 -0
- data/gemfiles/sequel-2.8.0.gemfile +8 -0
- data/gemfiles/sequel-2.8.0.gemfile.lock +28 -0
- data/gemfiles/sequel-3.0.0.gemfile +8 -0
- data/gemfiles/sequel-3.0.0.gemfile.lock +28 -0
- data/gemfiles/sequel-3.13.0.gemfile +8 -0
- data/gemfiles/sequel-3.13.0.gemfile.lock +28 -0
- data/gemfiles/sequel-3.14.0.gemfile +8 -0
- data/gemfiles/sequel-3.14.0.gemfile.lock +28 -0
- data/gemfiles/sequel-3.23.0.gemfile +8 -0
- data/gemfiles/sequel-3.23.0.gemfile.lock +28 -0
- data/gemfiles/sequel-3.24.0.gemfile +8 -0
- data/gemfiles/sequel-3.24.0.gemfile.lock +28 -0
- data/lib/state_machine/event.rb +13 -90
- data/lib/state_machine/helper_module.rb +17 -0
- data/lib/state_machine/integrations/active_model.rb +35 -0
- data/lib/state_machine/integrations/active_record.rb +41 -2
- data/lib/state_machine/integrations/data_mapper.rb +17 -2
- data/lib/state_machine/integrations/mongo_mapper.rb +34 -7
- data/lib/state_machine/integrations/mongoid.rb +34 -26
- data/lib/state_machine/integrations/mongoid/versions.rb +29 -3
- data/lib/state_machine/integrations/sequel.rb +22 -72
- data/lib/state_machine/integrations/sequel/versions.rb +87 -6
- data/lib/state_machine/machine.rb +279 -19
- data/lib/state_machine/state.rb +2 -2
- data/lib/state_machine/state_context.rb +133 -0
- data/lib/state_machine/version.rb +3 -0
- data/state_machine.gemspec +22 -0
- data/test/test_helper.rb +1 -3
- data/test/unit/branch_test.rb +1 -3
- data/test/unit/event_collection_test.rb +3 -3
- data/test/unit/event_test.rb +1 -3
- data/test/unit/helper_module_test.rb +17 -0
- data/test/unit/integrations/active_model_test.rb +0 -4
- data/test/unit/integrations/active_record_test.rb +50 -9
- data/test/unit/integrations/data_mapper_test.rb +267 -253
- data/test/unit/integrations/mongo_mapper_test.rb +47 -15
- data/test/unit/integrations/mongoid_test.rb +50 -8
- data/test/unit/integrations/sequel_test.rb +10 -6
- data/test/unit/machine_test.rb +206 -25
- data/test/unit/state_context_test.rb +421 -0
- data/test/unit/state_test.rb +20 -3
- metadata +303 -128
- data/lib/state_machine/condition_proxy.rb +0 -94
- data/test/unit/condition_proxy_test.rb +0 -328
@@ -0,0 +1,36 @@
|
|
1
|
+
PATH
|
2
|
+
remote: /home/aaron/Projects/Personal/pluginaweek/state_machine
|
3
|
+
specs:
|
4
|
+
state_machine (1.0.1)
|
5
|
+
|
6
|
+
GEM
|
7
|
+
remote: http://www.rubygems.org/
|
8
|
+
specs:
|
9
|
+
activesupport (2.3.11)
|
10
|
+
appraisal (0.3.8)
|
11
|
+
bundler
|
12
|
+
rake
|
13
|
+
bson (1.0)
|
14
|
+
jnunemaker-validatable (1.8.4)
|
15
|
+
activesupport (>= 2.3.4)
|
16
|
+
mongo (1.0)
|
17
|
+
bson (= 1.0)
|
18
|
+
mongo_mapper (0.7.5)
|
19
|
+
activesupport (>= 2.3.4)
|
20
|
+
jnunemaker-validatable (= 1.8.4)
|
21
|
+
mongo (= 1.0)
|
22
|
+
rake (0.9.2)
|
23
|
+
rcov (0.9.10)
|
24
|
+
ruby-graphviz (1.0.0)
|
25
|
+
|
26
|
+
PLATFORMS
|
27
|
+
ruby
|
28
|
+
|
29
|
+
DEPENDENCIES
|
30
|
+
activesupport (= 2.3.11)
|
31
|
+
appraisal (~> 0.3.8)
|
32
|
+
mongo_mapper (= 0.7.5)
|
33
|
+
rake
|
34
|
+
rcov
|
35
|
+
ruby-graphviz (~> 1.0)
|
36
|
+
state_machine!
|
@@ -0,0 +1,40 @@
|
|
1
|
+
PATH
|
2
|
+
remote: /home/aaron/Projects/Personal/pluginaweek/state_machine
|
3
|
+
specs:
|
4
|
+
state_machine (1.0.1)
|
5
|
+
|
6
|
+
GEM
|
7
|
+
remote: http://www.rubygems.org/
|
8
|
+
specs:
|
9
|
+
activesupport (2.3.11)
|
10
|
+
appraisal (0.3.8)
|
11
|
+
bundler
|
12
|
+
rake
|
13
|
+
bson (1.0.1)
|
14
|
+
jnunemaker-validatable (1.8.4)
|
15
|
+
activesupport (>= 2.3.4)
|
16
|
+
mongo (1.0.1)
|
17
|
+
bson (= 1.0.1)
|
18
|
+
mongo_mapper (0.8.0)
|
19
|
+
activesupport (>= 2.3.4)
|
20
|
+
jnunemaker-validatable (~> 1.8.4)
|
21
|
+
plucky (~> 0.3.0)
|
22
|
+
plucky (0.3.0)
|
23
|
+
mongo (~> 1.0.1)
|
24
|
+
rake (0.9.2)
|
25
|
+
rcov (0.9.10)
|
26
|
+
ruby-graphviz (1.0.0)
|
27
|
+
|
28
|
+
PLATFORMS
|
29
|
+
ruby
|
30
|
+
|
31
|
+
DEPENDENCIES
|
32
|
+
activesupport (= 2.3.11)
|
33
|
+
appraisal (~> 0.3.8)
|
34
|
+
mongo (= 1.0.1)
|
35
|
+
mongo_mapper (= 0.8.0)
|
36
|
+
plucky (= 0.3.0)
|
37
|
+
rake
|
38
|
+
rcov
|
39
|
+
ruby-graphviz (~> 1.0)
|
40
|
+
state_machine!
|
@@ -0,0 +1,40 @@
|
|
1
|
+
PATH
|
2
|
+
remote: /home/aaron/Projects/Personal/pluginaweek/state_machine
|
3
|
+
specs:
|
4
|
+
state_machine (1.0.1)
|
5
|
+
|
6
|
+
GEM
|
7
|
+
remote: http://www.rubygems.org/
|
8
|
+
specs:
|
9
|
+
activesupport (2.3.11)
|
10
|
+
appraisal (0.3.8)
|
11
|
+
bundler
|
12
|
+
rake
|
13
|
+
bson (1.0.1)
|
14
|
+
jnunemaker-validatable (1.8.4)
|
15
|
+
activesupport (>= 2.3.4)
|
16
|
+
mongo (1.0.1)
|
17
|
+
bson (= 1.0.1)
|
18
|
+
mongo_mapper (0.8.3)
|
19
|
+
activesupport (>= 2.3.4)
|
20
|
+
jnunemaker-validatable (~> 1.8.4)
|
21
|
+
plucky (~> 0.3.3)
|
22
|
+
plucky (0.3.3)
|
23
|
+
mongo (~> 1.0.1)
|
24
|
+
rake (0.9.2)
|
25
|
+
rcov (0.9.10)
|
26
|
+
ruby-graphviz (1.0.0)
|
27
|
+
|
28
|
+
PLATFORMS
|
29
|
+
ruby
|
30
|
+
|
31
|
+
DEPENDENCIES
|
32
|
+
activesupport (= 2.3.11)
|
33
|
+
appraisal (~> 0.3.8)
|
34
|
+
mongo (= 1.0.1)
|
35
|
+
mongo_mapper (= 0.8.3)
|
36
|
+
plucky (= 0.3.3)
|
37
|
+
rake
|
38
|
+
rcov
|
39
|
+
ruby-graphviz (~> 1.0)
|
40
|
+
state_machine!
|
@@ -0,0 +1,38 @@
|
|
1
|
+
PATH
|
2
|
+
remote: /home/aaron/Projects/Personal/pluginaweek/state_machine
|
3
|
+
specs:
|
4
|
+
state_machine (1.0.1)
|
5
|
+
|
6
|
+
GEM
|
7
|
+
remote: http://www.rubygems.org/
|
8
|
+
specs:
|
9
|
+
activesupport (2.3.11)
|
10
|
+
appraisal (0.3.8)
|
11
|
+
bundler
|
12
|
+
rake
|
13
|
+
bson (1.3.1)
|
14
|
+
jnunemaker-validatable (1.8.4)
|
15
|
+
activesupport (>= 2.3.4)
|
16
|
+
mongo (1.3.1)
|
17
|
+
bson (>= 1.3.1)
|
18
|
+
mongo_mapper (0.8.4)
|
19
|
+
activesupport (>= 2.3.4)
|
20
|
+
jnunemaker-validatable (~> 1.8.4)
|
21
|
+
plucky (~> 0.3.5)
|
22
|
+
plucky (0.3.8)
|
23
|
+
mongo (~> 1.3)
|
24
|
+
rake (0.9.2)
|
25
|
+
rcov (0.9.10)
|
26
|
+
ruby-graphviz (1.0.0)
|
27
|
+
|
28
|
+
PLATFORMS
|
29
|
+
ruby
|
30
|
+
|
31
|
+
DEPENDENCIES
|
32
|
+
activesupport (= 2.3.11)
|
33
|
+
appraisal (~> 0.3.8)
|
34
|
+
mongo_mapper (= 0.8.4)
|
35
|
+
rake
|
36
|
+
rcov
|
37
|
+
ruby-graphviz (~> 1.0)
|
38
|
+
state_machine!
|
@@ -0,0 +1,38 @@
|
|
1
|
+
PATH
|
2
|
+
remote: /home/aaron/Projects/Personal/pluginaweek/state_machine
|
3
|
+
specs:
|
4
|
+
state_machine (1.0.1)
|
5
|
+
|
6
|
+
GEM
|
7
|
+
remote: http://www.rubygems.org/
|
8
|
+
specs:
|
9
|
+
activesupport (2.3.11)
|
10
|
+
appraisal (0.3.8)
|
11
|
+
bundler
|
12
|
+
rake
|
13
|
+
bson (1.3.1)
|
14
|
+
jnunemaker-validatable (1.8.4)
|
15
|
+
activesupport (>= 2.3.4)
|
16
|
+
mongo (1.3.1)
|
17
|
+
bson (>= 1.3.1)
|
18
|
+
mongo_mapper (0.8.6)
|
19
|
+
activesupport (>= 2.3.4)
|
20
|
+
jnunemaker-validatable (~> 1.8.4)
|
21
|
+
plucky (~> 0.3.6)
|
22
|
+
plucky (0.3.8)
|
23
|
+
mongo (~> 1.3)
|
24
|
+
rake (0.9.2)
|
25
|
+
rcov (0.9.10)
|
26
|
+
ruby-graphviz (1.0.0)
|
27
|
+
|
28
|
+
PLATFORMS
|
29
|
+
ruby
|
30
|
+
|
31
|
+
DEPENDENCIES
|
32
|
+
activesupport (= 2.3.11)
|
33
|
+
appraisal (~> 0.3.8)
|
34
|
+
mongo_mapper (= 0.8.6)
|
35
|
+
rake
|
36
|
+
rcov
|
37
|
+
ruby-graphviz (~> 1.0)
|
38
|
+
state_machine!
|
@@ -0,0 +1,41 @@
|
|
1
|
+
PATH
|
2
|
+
remote: /home/aaron/Projects/Personal/pluginaweek/state_machine
|
3
|
+
specs:
|
4
|
+
state_machine (1.0.1)
|
5
|
+
|
6
|
+
GEM
|
7
|
+
remote: http://www.rubygems.org/
|
8
|
+
specs:
|
9
|
+
activemodel (3.0.9)
|
10
|
+
activesupport (= 3.0.9)
|
11
|
+
builder (~> 2.1.2)
|
12
|
+
i18n (~> 0.5.0)
|
13
|
+
activesupport (3.0.9)
|
14
|
+
appraisal (0.3.8)
|
15
|
+
bundler
|
16
|
+
rake
|
17
|
+
bson (1.3.1)
|
18
|
+
builder (2.1.2)
|
19
|
+
i18n (0.5.0)
|
20
|
+
mongo (1.3.1)
|
21
|
+
bson (>= 1.3.1)
|
22
|
+
mongo_mapper (0.9.0)
|
23
|
+
activemodel (~> 3.0.0)
|
24
|
+
activesupport (~> 3.0.0)
|
25
|
+
plucky (~> 0.3.6)
|
26
|
+
plucky (0.3.8)
|
27
|
+
mongo (~> 1.3)
|
28
|
+
rake (0.9.2)
|
29
|
+
rcov (0.9.10)
|
30
|
+
ruby-graphviz (1.0.0)
|
31
|
+
|
32
|
+
PLATFORMS
|
33
|
+
ruby
|
34
|
+
|
35
|
+
DEPENDENCIES
|
36
|
+
appraisal (~> 0.3.8)
|
37
|
+
mongo_mapper (= 0.9.0)
|
38
|
+
rake
|
39
|
+
rcov
|
40
|
+
ruby-graphviz (~> 1.0)
|
41
|
+
state_machine!
|
@@ -0,0 +1,42 @@
|
|
1
|
+
PATH
|
2
|
+
remote: /home/aaron/Projects/Personal/pluginaweek/state_machine
|
3
|
+
specs:
|
4
|
+
state_machine (1.0.1)
|
5
|
+
|
6
|
+
GEM
|
7
|
+
remote: http://www.rubygems.org/
|
8
|
+
specs:
|
9
|
+
activemodel (3.0.9)
|
10
|
+
activesupport (= 3.0.9)
|
11
|
+
builder (~> 2.1.2)
|
12
|
+
i18n (~> 0.5.0)
|
13
|
+
activesupport (3.0.9)
|
14
|
+
appraisal (0.3.8)
|
15
|
+
bundler
|
16
|
+
rake
|
17
|
+
bson (1.3.1)
|
18
|
+
builder (2.1.2)
|
19
|
+
i18n (0.5.0)
|
20
|
+
mongo (1.3.1)
|
21
|
+
bson (>= 1.3.1)
|
22
|
+
mongoid (2.0.0)
|
23
|
+
activemodel (~> 3.0)
|
24
|
+
mongo (~> 1.2)
|
25
|
+
tzinfo (~> 0.3.22)
|
26
|
+
will_paginate (~> 3.0.pre)
|
27
|
+
rake (0.9.2)
|
28
|
+
rcov (0.9.10)
|
29
|
+
ruby-graphviz (1.0.0)
|
30
|
+
tzinfo (0.3.29)
|
31
|
+
will_paginate (3.0.0)
|
32
|
+
|
33
|
+
PLATFORMS
|
34
|
+
ruby
|
35
|
+
|
36
|
+
DEPENDENCIES
|
37
|
+
appraisal (~> 0.3.8)
|
38
|
+
mongoid (= 2.0.0)
|
39
|
+
rake
|
40
|
+
rcov
|
41
|
+
ruby-graphviz (~> 1.0)
|
42
|
+
state_machine!
|
@@ -0,0 +1,40 @@
|
|
1
|
+
PATH
|
2
|
+
remote: /home/aaron/Projects/Personal/pluginaweek/state_machine
|
3
|
+
specs:
|
4
|
+
state_machine (1.0.1)
|
5
|
+
|
6
|
+
GEM
|
7
|
+
remote: http://www.rubygems.org/
|
8
|
+
specs:
|
9
|
+
activemodel (3.0.9)
|
10
|
+
activesupport (= 3.0.9)
|
11
|
+
builder (~> 2.1.2)
|
12
|
+
i18n (~> 0.5.0)
|
13
|
+
activesupport (3.0.9)
|
14
|
+
appraisal (0.3.8)
|
15
|
+
bundler
|
16
|
+
rake
|
17
|
+
bson (1.3.1)
|
18
|
+
builder (2.1.2)
|
19
|
+
i18n (0.5.0)
|
20
|
+
mongo (1.3.1)
|
21
|
+
bson (>= 1.3.1)
|
22
|
+
mongoid (2.1.4)
|
23
|
+
activemodel (~> 3.0)
|
24
|
+
mongo (~> 1.3)
|
25
|
+
tzinfo (~> 0.3.22)
|
26
|
+
rake (0.9.2)
|
27
|
+
rcov (0.9.10)
|
28
|
+
ruby-graphviz (1.0.0)
|
29
|
+
tzinfo (0.3.29)
|
30
|
+
|
31
|
+
PLATFORMS
|
32
|
+
ruby
|
33
|
+
|
34
|
+
DEPENDENCIES
|
35
|
+
appraisal (~> 0.3.8)
|
36
|
+
mongoid (= 2.1.4)
|
37
|
+
rake
|
38
|
+
rcov
|
39
|
+
ruby-graphviz (~> 1.0)
|
40
|
+
state_machine!
|
@@ -0,0 +1,28 @@
|
|
1
|
+
PATH
|
2
|
+
remote: /home/aaron/Projects/Personal/pluginaweek/state_machine
|
3
|
+
specs:
|
4
|
+
state_machine (1.0.1)
|
5
|
+
|
6
|
+
GEM
|
7
|
+
remote: http://www.rubygems.org/
|
8
|
+
specs:
|
9
|
+
appraisal (0.3.8)
|
10
|
+
bundler
|
11
|
+
rake
|
12
|
+
rake (0.9.2)
|
13
|
+
rcov (0.9.10)
|
14
|
+
ruby-graphviz (1.0.0)
|
15
|
+
sequel (2.11.0)
|
16
|
+
sqlite3-ruby (1.3.1)
|
17
|
+
|
18
|
+
PLATFORMS
|
19
|
+
ruby
|
20
|
+
|
21
|
+
DEPENDENCIES
|
22
|
+
appraisal (~> 0.3.8)
|
23
|
+
rake
|
24
|
+
rcov
|
25
|
+
ruby-graphviz (~> 1.0)
|
26
|
+
sequel (= 2.11.0)
|
27
|
+
sqlite3-ruby (= 1.3.1)
|
28
|
+
state_machine!
|