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.
Files changed (120) hide show
  1. data/.gitignore +11 -0
  2. data/.travis.yml +16 -0
  3. data/.yardopts +5 -0
  4. data/Appraisals +260 -0
  5. data/CHANGELOG.rdoc +15 -0
  6. data/Gemfile +3 -0
  7. data/README.rdoc +156 -29
  8. data/Rakefile +31 -57
  9. data/gemfiles/active_model-3.0.0.gemfile +7 -0
  10. data/gemfiles/active_model-3.0.0.gemfile.lock +32 -0
  11. data/gemfiles/active_model-3.0.5.gemfile +7 -0
  12. data/gemfiles/active_model-3.0.5.gemfile.lock +32 -0
  13. data/gemfiles/active_record-2.0.0.gemfile +8 -0
  14. data/gemfiles/active_record-2.0.0.gemfile.lock +30 -0
  15. data/gemfiles/active_record-2.0.5.gemfile +8 -0
  16. data/gemfiles/active_record-2.0.5.gemfile.lock +30 -0
  17. data/gemfiles/active_record-2.1.0.gemfile +8 -0
  18. data/gemfiles/active_record-2.1.0.gemfile.lock +30 -0
  19. data/gemfiles/active_record-2.1.2.gemfile +8 -0
  20. data/gemfiles/active_record-2.1.2.gemfile.lock +30 -0
  21. data/gemfiles/active_record-2.2.3.gemfile +8 -0
  22. data/gemfiles/active_record-2.2.3.gemfile.lock +30 -0
  23. data/gemfiles/active_record-2.3.12.gemfile +8 -0
  24. data/gemfiles/active_record-2.3.12.gemfile.lock +30 -0
  25. data/gemfiles/active_record-3.0.0.gemfile +8 -0
  26. data/gemfiles/active_record-3.0.0.gemfile.lock +44 -0
  27. data/gemfiles/active_record-3.0.5.gemfile +8 -0
  28. data/gemfiles/active_record-3.0.5.gemfile.lock +43 -0
  29. data/gemfiles/data_mapper-0.10.2.gemfile +12 -0
  30. data/gemfiles/data_mapper-0.10.2.gemfile.lock +45 -0
  31. data/gemfiles/data_mapper-0.9.11.gemfile +12 -0
  32. data/gemfiles/data_mapper-0.9.11.gemfile.lock +47 -0
  33. data/gemfiles/data_mapper-0.9.4.gemfile +12 -0
  34. data/gemfiles/data_mapper-0.9.4.gemfile.lock +61 -0
  35. data/gemfiles/data_mapper-0.9.7.gemfile +12 -0
  36. data/gemfiles/data_mapper-0.9.7.gemfile.lock +57 -0
  37. data/gemfiles/data_mapper-1.0.0.gemfile +12 -0
  38. data/gemfiles/data_mapper-1.0.0.gemfile.lock +53 -0
  39. data/gemfiles/data_mapper-1.0.1.gemfile +12 -0
  40. data/gemfiles/data_mapper-1.0.1.gemfile.lock +53 -0
  41. data/gemfiles/data_mapper-1.0.2.gemfile +12 -0
  42. data/gemfiles/data_mapper-1.0.2.gemfile.lock +53 -0
  43. data/gemfiles/data_mapper-1.1.0.gemfile +12 -0
  44. data/gemfiles/data_mapper-1.1.0.gemfile.lock +51 -0
  45. data/gemfiles/default.gemfile +7 -0
  46. data/gemfiles/default.gemfile.lock +24 -0
  47. data/gemfiles/mongo_mapper-0.5.5.gemfile +8 -0
  48. data/gemfiles/mongo_mapper-0.5.5.gemfile.lock +33 -0
  49. data/gemfiles/mongo_mapper-0.5.8.gemfile +8 -0
  50. data/gemfiles/mongo_mapper-0.5.8.gemfile.lock +33 -0
  51. data/gemfiles/mongo_mapper-0.6.0.gemfile +8 -0
  52. data/gemfiles/mongo_mapper-0.6.0.gemfile.lock +33 -0
  53. data/gemfiles/mongo_mapper-0.6.10.gemfile +8 -0
  54. data/gemfiles/mongo_mapper-0.6.10.gemfile.lock +33 -0
  55. data/gemfiles/mongo_mapper-0.7.0.gemfile +8 -0
  56. data/gemfiles/mongo_mapper-0.7.0.gemfile.lock +33 -0
  57. data/gemfiles/mongo_mapper-0.7.5.gemfile +8 -0
  58. data/gemfiles/mongo_mapper-0.7.5.gemfile.lock +36 -0
  59. data/gemfiles/mongo_mapper-0.8.0.gemfile +10 -0
  60. data/gemfiles/mongo_mapper-0.8.0.gemfile.lock +40 -0
  61. data/gemfiles/mongo_mapper-0.8.3.gemfile +10 -0
  62. data/gemfiles/mongo_mapper-0.8.3.gemfile.lock +40 -0
  63. data/gemfiles/mongo_mapper-0.8.4.gemfile +8 -0
  64. data/gemfiles/mongo_mapper-0.8.4.gemfile.lock +38 -0
  65. data/gemfiles/mongo_mapper-0.8.6.gemfile +8 -0
  66. data/gemfiles/mongo_mapper-0.8.6.gemfile.lock +38 -0
  67. data/gemfiles/mongo_mapper-0.9.0.gemfile +7 -0
  68. data/gemfiles/mongo_mapper-0.9.0.gemfile.lock +41 -0
  69. data/gemfiles/mongoid-2.0.0.gemfile +7 -0
  70. data/gemfiles/mongoid-2.0.0.gemfile.lock +42 -0
  71. data/gemfiles/mongoid-2.1.4.gemfile +7 -0
  72. data/gemfiles/mongoid-2.1.4.gemfile.lock +40 -0
  73. data/gemfiles/sequel-2.11.0.gemfile +8 -0
  74. data/gemfiles/sequel-2.11.0.gemfile.lock +28 -0
  75. data/gemfiles/sequel-2.12.0.gemfile +8 -0
  76. data/gemfiles/sequel-2.12.0.gemfile.lock +28 -0
  77. data/gemfiles/sequel-2.8.0.gemfile +8 -0
  78. data/gemfiles/sequel-2.8.0.gemfile.lock +28 -0
  79. data/gemfiles/sequel-3.0.0.gemfile +8 -0
  80. data/gemfiles/sequel-3.0.0.gemfile.lock +28 -0
  81. data/gemfiles/sequel-3.13.0.gemfile +8 -0
  82. data/gemfiles/sequel-3.13.0.gemfile.lock +28 -0
  83. data/gemfiles/sequel-3.14.0.gemfile +8 -0
  84. data/gemfiles/sequel-3.14.0.gemfile.lock +28 -0
  85. data/gemfiles/sequel-3.23.0.gemfile +8 -0
  86. data/gemfiles/sequel-3.23.0.gemfile.lock +28 -0
  87. data/gemfiles/sequel-3.24.0.gemfile +8 -0
  88. data/gemfiles/sequel-3.24.0.gemfile.lock +28 -0
  89. data/lib/state_machine/event.rb +13 -90
  90. data/lib/state_machine/helper_module.rb +17 -0
  91. data/lib/state_machine/integrations/active_model.rb +35 -0
  92. data/lib/state_machine/integrations/active_record.rb +41 -2
  93. data/lib/state_machine/integrations/data_mapper.rb +17 -2
  94. data/lib/state_machine/integrations/mongo_mapper.rb +34 -7
  95. data/lib/state_machine/integrations/mongoid.rb +34 -26
  96. data/lib/state_machine/integrations/mongoid/versions.rb +29 -3
  97. data/lib/state_machine/integrations/sequel.rb +22 -72
  98. data/lib/state_machine/integrations/sequel/versions.rb +87 -6
  99. data/lib/state_machine/machine.rb +279 -19
  100. data/lib/state_machine/state.rb +2 -2
  101. data/lib/state_machine/state_context.rb +133 -0
  102. data/lib/state_machine/version.rb +3 -0
  103. data/state_machine.gemspec +22 -0
  104. data/test/test_helper.rb +1 -3
  105. data/test/unit/branch_test.rb +1 -3
  106. data/test/unit/event_collection_test.rb +3 -3
  107. data/test/unit/event_test.rb +1 -3
  108. data/test/unit/helper_module_test.rb +17 -0
  109. data/test/unit/integrations/active_model_test.rb +0 -4
  110. data/test/unit/integrations/active_record_test.rb +50 -9
  111. data/test/unit/integrations/data_mapper_test.rb +267 -253
  112. data/test/unit/integrations/mongo_mapper_test.rb +47 -15
  113. data/test/unit/integrations/mongoid_test.rb +50 -8
  114. data/test/unit/integrations/sequel_test.rb +10 -6
  115. data/test/unit/machine_test.rb +206 -25
  116. data/test/unit/state_context_test.rb +421 -0
  117. data/test/unit/state_test.rb +20 -3
  118. metadata +303 -128
  119. data/lib/state_machine/condition_proxy.rb +0 -94
  120. data/test/unit/condition_proxy_test.rb +0 -328
@@ -0,0 +1,8 @@
1
+ # This file was generated by Appraisal
2
+
3
+ source "http://www.rubygems.org"
4
+
5
+ gem "mongo_mapper", "0.7.5"
6
+ gem "activesupport", "2.3.11"
7
+
8
+ gemspec :path=>"../"
@@ -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,10 @@
1
+ # This file was generated by Appraisal
2
+
3
+ source "http://www.rubygems.org"
4
+
5
+ gem "mongo", "1.0.1"
6
+ gem "mongo_mapper", "0.8.0"
7
+ gem "plucky", "0.3.0"
8
+ gem "activesupport", "2.3.11"
9
+
10
+ gemspec :path=>"../"
@@ -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,10 @@
1
+ # This file was generated by Appraisal
2
+
3
+ source "http://www.rubygems.org"
4
+
5
+ gem "mongo", "1.0.1"
6
+ gem "mongo_mapper", "0.8.3"
7
+ gem "plucky", "0.3.3"
8
+ gem "activesupport", "2.3.11"
9
+
10
+ gemspec :path=>"../"
@@ -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,8 @@
1
+ # This file was generated by Appraisal
2
+
3
+ source "http://www.rubygems.org"
4
+
5
+ gem "mongo_mapper", "0.8.4"
6
+ gem "activesupport", "2.3.11"
7
+
8
+ gemspec :path=>"../"
@@ -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,8 @@
1
+ # This file was generated by Appraisal
2
+
3
+ source "http://www.rubygems.org"
4
+
5
+ gem "mongo_mapper", "0.8.6"
6
+ gem "activesupport", "2.3.11"
7
+
8
+ gemspec :path=>"../"
@@ -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,7 @@
1
+ # This file was generated by Appraisal
2
+
3
+ source "http://www.rubygems.org"
4
+
5
+ gem "mongo_mapper", "0.9.0"
6
+
7
+ gemspec :path=>"../"
@@ -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,7 @@
1
+ # This file was generated by Appraisal
2
+
3
+ source "http://www.rubygems.org"
4
+
5
+ gem "mongoid", "2.0.0"
6
+
7
+ gemspec :path=>"../"
@@ -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,7 @@
1
+ # This file was generated by Appraisal
2
+
3
+ source "http://www.rubygems.org"
4
+
5
+ gem "mongoid", "2.1.4"
6
+
7
+ gemspec :path=>"../"
@@ -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,8 @@
1
+ # This file was generated by Appraisal
2
+
3
+ source "http://www.rubygems.org"
4
+
5
+ gem "sqlite3-ruby", "1.3.1"
6
+ gem "sequel", "2.11.0"
7
+
8
+ gemspec :path=>"../"
@@ -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!