state_machine_updated_for_ruby_3_2 2.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (308) hide show
  1. checksums.yaml +7 -0
  2. data/.gitignore +10 -0
  3. data/.travis.yml +72 -0
  4. data/.yardopts +5 -0
  5. data/Appraisals +491 -0
  6. data/CHANGELOG.md +506 -0
  7. data/Dockerfile +13 -0
  8. data/Gemfile +4 -0
  9. data/LICENSE +20 -0
  10. data/README.md +1244 -0
  11. data/Rakefile +41 -0
  12. data/examples/AutoShop_state.png +0 -0
  13. data/examples/Car_state.png +0 -0
  14. data/examples/Gemfile +5 -0
  15. data/examples/Gemfile.lock +14 -0
  16. data/examples/TrafficLight_state.png +0 -0
  17. data/examples/Vehicle_state.png +0 -0
  18. data/examples/auto_shop.rb +13 -0
  19. data/examples/car.rb +21 -0
  20. data/examples/doc/AutoShop.html +2856 -0
  21. data/examples/doc/AutoShop_state.png +0 -0
  22. data/examples/doc/Car.html +919 -0
  23. data/examples/doc/Car_state.png +0 -0
  24. data/examples/doc/TrafficLight.html +2230 -0
  25. data/examples/doc/TrafficLight_state.png +0 -0
  26. data/examples/doc/Vehicle.html +7921 -0
  27. data/examples/doc/Vehicle_state.png +0 -0
  28. data/examples/doc/_index.html +136 -0
  29. data/examples/doc/class_list.html +47 -0
  30. data/examples/doc/css/common.css +1 -0
  31. data/examples/doc/css/full_list.css +55 -0
  32. data/examples/doc/css/style.css +322 -0
  33. data/examples/doc/file_list.html +46 -0
  34. data/examples/doc/frames.html +13 -0
  35. data/examples/doc/index.html +136 -0
  36. data/examples/doc/js/app.js +205 -0
  37. data/examples/doc/js/full_list.js +173 -0
  38. data/examples/doc/js/jquery.js +16 -0
  39. data/examples/doc/method_list.html +734 -0
  40. data/examples/doc/top-level-namespace.html +105 -0
  41. data/examples/merb-rest/controller.rb +51 -0
  42. data/examples/merb-rest/model.rb +28 -0
  43. data/examples/merb-rest/view_edit.html.erb +24 -0
  44. data/examples/merb-rest/view_index.html.erb +23 -0
  45. data/examples/merb-rest/view_new.html.erb +13 -0
  46. data/examples/merb-rest/view_show.html.erb +17 -0
  47. data/examples/rails-rest/controller.rb +43 -0
  48. data/examples/rails-rest/migration.rb +7 -0
  49. data/examples/rails-rest/model.rb +23 -0
  50. data/examples/rails-rest/view__form.html.erb +34 -0
  51. data/examples/rails-rest/view_edit.html.erb +6 -0
  52. data/examples/rails-rest/view_index.html.erb +25 -0
  53. data/examples/rails-rest/view_new.html.erb +5 -0
  54. data/examples/rails-rest/view_show.html.erb +19 -0
  55. data/examples/traffic_light.rb +9 -0
  56. data/examples/vehicle.rb +33 -0
  57. data/gemfiles/active_model_3.0.0.gemfile +7 -0
  58. data/gemfiles/active_model_3.0.0.gemfile.lock +35 -0
  59. data/gemfiles/active_model_3.0.5.gemfile +7 -0
  60. data/gemfiles/active_model_3.0.5.gemfile.lock +35 -0
  61. data/gemfiles/active_model_3.1.1.gemfile +7 -0
  62. data/gemfiles/active_model_3.1.1.gemfile.lock +36 -0
  63. data/gemfiles/active_model_3.2.1.gemfile +7 -0
  64. data/gemfiles/active_model_3.2.12.gemfile +7 -0
  65. data/gemfiles/active_model_3.2.12.gemfile.lock +36 -0
  66. data/gemfiles/active_model_3.2.13.rc1.gemfile +7 -0
  67. data/gemfiles/active_model_3.2.13.rc1.gemfile.lock +36 -0
  68. data/gemfiles/active_model_4.0.0.gemfile +9 -0
  69. data/gemfiles/active_model_4.0.0.gemfile.lock +78 -0
  70. data/gemfiles/active_record_2.0.0.gemfile +9 -0
  71. data/gemfiles/active_record_2.0.0.gemfile.lock +39 -0
  72. data/gemfiles/active_record_2.0.5.gemfile +9 -0
  73. data/gemfiles/active_record_2.0.5.gemfile.lock +39 -0
  74. data/gemfiles/active_record_2.1.0.gemfile +9 -0
  75. data/gemfiles/active_record_2.1.0.gemfile.lock +39 -0
  76. data/gemfiles/active_record_2.1.2.gemfile +9 -0
  77. data/gemfiles/active_record_2.1.2.gemfile.lock +39 -0
  78. data/gemfiles/active_record_2.2.3.gemfile +9 -0
  79. data/gemfiles/active_record_2.2.3.gemfile.lock +39 -0
  80. data/gemfiles/active_record_2.3.12.gemfile +9 -0
  81. data/gemfiles/active_record_2.3.12.gemfile.lock +39 -0
  82. data/gemfiles/active_record_2.3.5.gemfile +9 -0
  83. data/gemfiles/active_record_2.3.5.gemfile.lock +39 -0
  84. data/gemfiles/active_record_3.0.0.gemfile +9 -0
  85. data/gemfiles/active_record_3.0.0.gemfile.lock +51 -0
  86. data/gemfiles/active_record_3.0.5.gemfile +9 -0
  87. data/gemfiles/active_record_3.0.5.gemfile.lock +50 -0
  88. data/gemfiles/active_record_3.1.1.gemfile +9 -0
  89. data/gemfiles/active_record_3.1.1.gemfile.lock +51 -0
  90. data/gemfiles/active_record_3.2.12.gemfile +9 -0
  91. data/gemfiles/active_record_3.2.12.gemfile.lock +51 -0
  92. data/gemfiles/active_record_3.2.13.rc1.gemfile +9 -0
  93. data/gemfiles/active_record_3.2.13.rc1.gemfile.lock +51 -0
  94. data/gemfiles/active_record_4.0.0.gemfile +11 -0
  95. data/gemfiles/active_record_4.0.0.gemfile.lock +83 -0
  96. data/gemfiles/data_mapper_0.10.2.gemfile +13 -0
  97. data/gemfiles/data_mapper_0.10.2.gemfile.lock +56 -0
  98. data/gemfiles/data_mapper_0.9.11.gemfile +13 -0
  99. data/gemfiles/data_mapper_0.9.11.gemfile.lock +71 -0
  100. data/gemfiles/data_mapper_0.9.4.gemfile +12 -0
  101. data/gemfiles/data_mapper_0.9.4.gemfile.lock +70 -0
  102. data/gemfiles/data_mapper_0.9.7.gemfile +13 -0
  103. data/gemfiles/data_mapper_0.9.7.gemfile.lock +67 -0
  104. data/gemfiles/data_mapper_1.0.0.gemfile +12 -0
  105. data/gemfiles/data_mapper_1.0.0.gemfile.lock +63 -0
  106. data/gemfiles/data_mapper_1.0.1.gemfile +12 -0
  107. data/gemfiles/data_mapper_1.0.1.gemfile.lock +63 -0
  108. data/gemfiles/data_mapper_1.0.2.gemfile +12 -0
  109. data/gemfiles/data_mapper_1.0.2.gemfile.lock +63 -0
  110. data/gemfiles/data_mapper_1.1.0.gemfile +12 -0
  111. data/gemfiles/data_mapper_1.1.0.gemfile.lock +61 -0
  112. data/gemfiles/data_mapper_1.2.0.gemfile +12 -0
  113. data/gemfiles/data_mapper_1.2.0.gemfile.lock +61 -0
  114. data/gemfiles/default.gemfile +7 -0
  115. data/gemfiles/default.gemfile.lock +27 -0
  116. data/gemfiles/graphviz_0.9.17.gemfile +7 -0
  117. data/gemfiles/graphviz_0.9.17.gemfile.lock +29 -0
  118. data/gemfiles/graphviz_0.9.21.gemfile +7 -0
  119. data/gemfiles/graphviz_0.9.21.gemfile.lock +29 -0
  120. data/gemfiles/graphviz_1.0.0.gemfile +7 -0
  121. data/gemfiles/graphviz_1.0.0.gemfile.lock +29 -0
  122. data/gemfiles/graphviz_1.0.3.gemfile +7 -0
  123. data/gemfiles/graphviz_1.0.3.gemfile.lock +29 -0
  124. data/gemfiles/graphviz_1.0.8.gemfile +7 -0
  125. data/gemfiles/graphviz_1.0.8.gemfile.lock +29 -0
  126. data/gemfiles/mongo_mapper_0.10.0.gemfile +8 -0
  127. data/gemfiles/mongo_mapper_0.10.0.gemfile.lock +47 -0
  128. data/gemfiles/mongo_mapper_0.11.2.gemfile +9 -0
  129. data/gemfiles/mongo_mapper_0.11.2.gemfile.lock +48 -0
  130. data/gemfiles/mongo_mapper_0.12.0.gemfile +9 -0
  131. data/gemfiles/mongo_mapper_0.12.0.gemfile.lock +48 -0
  132. data/gemfiles/mongo_mapper_0.5.5.gemfile +8 -0
  133. data/gemfiles/mongo_mapper_0.5.5.gemfile.lock +36 -0
  134. data/gemfiles/mongo_mapper_0.5.8.gemfile +8 -0
  135. data/gemfiles/mongo_mapper_0.5.8.gemfile.lock +36 -0
  136. data/gemfiles/mongo_mapper_0.6.0.gemfile +8 -0
  137. data/gemfiles/mongo_mapper_0.6.0.gemfile.lock +36 -0
  138. data/gemfiles/mongo_mapper_0.6.10.gemfile +8 -0
  139. data/gemfiles/mongo_mapper_0.6.10.gemfile.lock +36 -0
  140. data/gemfiles/mongo_mapper_0.7.0.gemfile +8 -0
  141. data/gemfiles/mongo_mapper_0.7.0.gemfile.lock +36 -0
  142. data/gemfiles/mongo_mapper_0.7.5.gemfile +8 -0
  143. data/gemfiles/mongo_mapper_0.7.5.gemfile.lock +39 -0
  144. data/gemfiles/mongo_mapper_0.8.0.gemfile +10 -0
  145. data/gemfiles/mongo_mapper_0.8.0.gemfile.lock +43 -0
  146. data/gemfiles/mongo_mapper_0.8.3.gemfile +10 -0
  147. data/gemfiles/mongo_mapper_0.8.3.gemfile.lock +43 -0
  148. data/gemfiles/mongo_mapper_0.8.4.gemfile +8 -0
  149. data/gemfiles/mongo_mapper_0.8.4.gemfile.lock +42 -0
  150. data/gemfiles/mongo_mapper_0.8.6.gemfile +8 -0
  151. data/gemfiles/mongo_mapper_0.8.6.gemfile.lock +42 -0
  152. data/gemfiles/mongo_mapper_0.9.0.gemfile +7 -0
  153. data/gemfiles/mongo_mapper_0.9.0.gemfile.lock +45 -0
  154. data/gemfiles/mongoid_2.0.0.gemfile +9 -0
  155. data/gemfiles/mongoid_2.0.0.gemfile.lock +49 -0
  156. data/gemfiles/mongoid_2.1.4.gemfile +9 -0
  157. data/gemfiles/mongoid_2.1.4.gemfile.lock +47 -0
  158. data/gemfiles/mongoid_2.2.4.gemfile +9 -0
  159. data/gemfiles/mongoid_2.2.4.gemfile.lock +47 -0
  160. data/gemfiles/mongoid_2.3.3.gemfile +9 -0
  161. data/gemfiles/mongoid_2.3.3.gemfile.lock +47 -0
  162. data/gemfiles/mongoid_2.4.0.gemfile +9 -0
  163. data/gemfiles/mongoid_2.4.0.gemfile.lock +47 -0
  164. data/gemfiles/mongoid_2.4.10.gemfile +9 -0
  165. data/gemfiles/mongoid_2.4.10.gemfile.lock +47 -0
  166. data/gemfiles/mongoid_2.5.2.gemfile +9 -0
  167. data/gemfiles/mongoid_2.5.2.gemfile.lock +47 -0
  168. data/gemfiles/mongoid_2.6.0.gemfile +9 -0
  169. data/gemfiles/mongoid_2.6.0.gemfile.lock +47 -0
  170. data/gemfiles/mongoid_3.0.0.gemfile +8 -0
  171. data/gemfiles/mongoid_3.0.0.gemfile.lock +45 -0
  172. data/gemfiles/mongoid_3.0.22.gemfile +8 -0
  173. data/gemfiles/mongoid_3.0.22.gemfile.lock +45 -0
  174. data/gemfiles/mongoid_3.1.0.gemfile +8 -0
  175. data/gemfiles/mongoid_3.1.0.gemfile.lock +45 -0
  176. data/gemfiles/sequel_2.11.0.gemfile +9 -0
  177. data/gemfiles/sequel_2.11.0.gemfile.lock +33 -0
  178. data/gemfiles/sequel_2.12.0.gemfile +9 -0
  179. data/gemfiles/sequel_2.12.0.gemfile.lock +33 -0
  180. data/gemfiles/sequel_2.8.0.gemfile +9 -0
  181. data/gemfiles/sequel_2.8.0.gemfile.lock +33 -0
  182. data/gemfiles/sequel_3.0.0.gemfile +9 -0
  183. data/gemfiles/sequel_3.0.0.gemfile.lock +33 -0
  184. data/gemfiles/sequel_3.10.0.gemfile +9 -0
  185. data/gemfiles/sequel_3.10.0.gemfile.lock +33 -0
  186. data/gemfiles/sequel_3.13.0.gemfile +9 -0
  187. data/gemfiles/sequel_3.13.0.gemfile.lock +33 -0
  188. data/gemfiles/sequel_3.14.0.gemfile +9 -0
  189. data/gemfiles/sequel_3.14.0.gemfile.lock +33 -0
  190. data/gemfiles/sequel_3.23.0.gemfile +9 -0
  191. data/gemfiles/sequel_3.23.0.gemfile.lock +33 -0
  192. data/gemfiles/sequel_3.24.0.gemfile +9 -0
  193. data/gemfiles/sequel_3.24.0.gemfile.lock +33 -0
  194. data/gemfiles/sequel_3.29.0.gemfile +9 -0
  195. data/gemfiles/sequel_3.29.0.gemfile.lock +33 -0
  196. data/gemfiles/sequel_3.34.0.gemfile +9 -0
  197. data/gemfiles/sequel_3.34.0.gemfile.lock +33 -0
  198. data/gemfiles/sequel_3.35.0.gemfile +9 -0
  199. data/gemfiles/sequel_3.35.0.gemfile.lock +33 -0
  200. data/gemfiles/sequel_3.4.0.gemfile +9 -0
  201. data/gemfiles/sequel_3.4.0.gemfile.lock +33 -0
  202. data/gemfiles/sequel_3.44.0.gemfile +9 -0
  203. data/gemfiles/sequel_3.44.0.gemfile.lock +33 -0
  204. data/init.rb +1 -0
  205. data/lib/state_machine/assertions.rb +36 -0
  206. data/lib/state_machine/branch.rb +225 -0
  207. data/lib/state_machine/callback.rb +236 -0
  208. data/lib/state_machine/core.rb +12 -0
  209. data/lib/state_machine/core_ext/class/state_machine.rb +5 -0
  210. data/lib/state_machine/core_ext.rb +2 -0
  211. data/lib/state_machine/error.rb +13 -0
  212. data/lib/state_machine/eval_helpers.rb +87 -0
  213. data/lib/state_machine/event.rb +257 -0
  214. data/lib/state_machine/event_collection.rb +141 -0
  215. data/lib/state_machine/extensions.rb +149 -0
  216. data/lib/state_machine/graph.rb +92 -0
  217. data/lib/state_machine/helper_module.rb +17 -0
  218. data/lib/state_machine/initializers/merb.rb +1 -0
  219. data/lib/state_machine/initializers/rails.rb +25 -0
  220. data/lib/state_machine/initializers.rb +4 -0
  221. data/lib/state_machine/integrations/active_model/locale.rb +11 -0
  222. data/lib/state_machine/integrations/active_model/observer.rb +33 -0
  223. data/lib/state_machine/integrations/active_model/observer_update.rb +42 -0
  224. data/lib/state_machine/integrations/active_model/versions.rb +31 -0
  225. data/lib/state_machine/integrations/active_model.rb +585 -0
  226. data/lib/state_machine/integrations/active_record/locale.rb +20 -0
  227. data/lib/state_machine/integrations/active_record/versions.rb +123 -0
  228. data/lib/state_machine/integrations/active_record.rb +548 -0
  229. data/lib/state_machine/integrations/base.rb +100 -0
  230. data/lib/state_machine/integrations/data_mapper/observer.rb +210 -0
  231. data/lib/state_machine/integrations/data_mapper/versions.rb +85 -0
  232. data/lib/state_machine/integrations/data_mapper.rb +511 -0
  233. data/lib/state_machine/integrations/mongo_mapper/locale.rb +4 -0
  234. data/lib/state_machine/integrations/mongo_mapper/versions.rb +89 -0
  235. data/lib/state_machine/integrations/mongo_mapper.rb +389 -0
  236. data/lib/state_machine/integrations/mongoid/locale.rb +4 -0
  237. data/lib/state_machine/integrations/mongoid/versions.rb +81 -0
  238. data/lib/state_machine/integrations/mongoid.rb +461 -0
  239. data/lib/state_machine/integrations/sequel/versions.rb +95 -0
  240. data/lib/state_machine/integrations/sequel.rb +486 -0
  241. data/lib/state_machine/integrations.rb +121 -0
  242. data/lib/state_machine/machine.rb +2292 -0
  243. data/lib/state_machine/machine_collection.rb +86 -0
  244. data/lib/state_machine/macro_methods.rb +522 -0
  245. data/lib/state_machine/matcher.rb +123 -0
  246. data/lib/state_machine/matcher_helpers.rb +54 -0
  247. data/lib/state_machine/node_collection.rb +222 -0
  248. data/lib/state_machine/path.rb +120 -0
  249. data/lib/state_machine/path_collection.rb +90 -0
  250. data/lib/state_machine/state.rb +297 -0
  251. data/lib/state_machine/state_collection.rb +112 -0
  252. data/lib/state_machine/state_context.rb +138 -0
  253. data/lib/state_machine/transition.rb +470 -0
  254. data/lib/state_machine/transition_collection.rb +245 -0
  255. data/lib/state_machine/version.rb +3 -0
  256. data/lib/state_machine/yard/handlers/base.rb +32 -0
  257. data/lib/state_machine/yard/handlers/event.rb +25 -0
  258. data/lib/state_machine/yard/handlers/machine.rb +344 -0
  259. data/lib/state_machine/yard/handlers/state.rb +25 -0
  260. data/lib/state_machine/yard/handlers/transition.rb +47 -0
  261. data/lib/state_machine/yard/handlers.rb +12 -0
  262. data/lib/state_machine/yard/templates/default/class/html/setup.rb +30 -0
  263. data/lib/state_machine/yard/templates/default/class/html/state_machines.erb +12 -0
  264. data/lib/state_machine/yard/templates.rb +3 -0
  265. data/lib/state_machine/yard.rb +8 -0
  266. data/lib/state_machine.rb +8 -0
  267. data/lib/tasks/state_machine.rake +1 -0
  268. data/lib/tasks/state_machine.rb +30 -0
  269. data/lib/yard-state_machine.rb +2 -0
  270. data/state_machine.gemspec +23 -0
  271. data/test/files/en.yml +17 -0
  272. data/test/files/switch.rb +15 -0
  273. data/test/functional/state_machine_test.rb +1066 -0
  274. data/test/test_helper.rb +7 -0
  275. data/test/unit/assertions_test.rb +40 -0
  276. data/test/unit/branch_test.rb +969 -0
  277. data/test/unit/callback_test.rb +704 -0
  278. data/test/unit/error_test.rb +43 -0
  279. data/test/unit/eval_helpers_test.rb +272 -0
  280. data/test/unit/event_collection_test.rb +398 -0
  281. data/test/unit/event_test.rb +1196 -0
  282. data/test/unit/graph_test.rb +98 -0
  283. data/test/unit/helper_module_test.rb +17 -0
  284. data/test/unit/integrations/active_model_test.rb +1245 -0
  285. data/test/unit/integrations/active_record_test.rb +2551 -0
  286. data/test/unit/integrations/base_test.rb +104 -0
  287. data/test/unit/integrations/data_mapper_test.rb +2194 -0
  288. data/test/unit/integrations/mongo_mapper_test.rb +2026 -0
  289. data/test/unit/integrations/mongoid_test.rb +2309 -0
  290. data/test/unit/integrations/sequel_test.rb +1896 -0
  291. data/test/unit/integrations_test.rb +83 -0
  292. data/test/unit/invalid_event_test.rb +20 -0
  293. data/test/unit/invalid_parallel_transition_test.rb +18 -0
  294. data/test/unit/invalid_transition_test.rb +115 -0
  295. data/test/unit/machine_collection_test.rb +603 -0
  296. data/test/unit/machine_test.rb +3407 -0
  297. data/test/unit/matcher_helpers_test.rb +37 -0
  298. data/test/unit/matcher_test.rb +155 -0
  299. data/test/unit/node_collection_test.rb +362 -0
  300. data/test/unit/path_collection_test.rb +266 -0
  301. data/test/unit/path_test.rb +485 -0
  302. data/test/unit/state_collection_test.rb +352 -0
  303. data/test/unit/state_context_test.rb +441 -0
  304. data/test/unit/state_machine_test.rb +31 -0
  305. data/test/unit/state_test.rb +1101 -0
  306. data/test/unit/transition_collection_test.rb +2168 -0
  307. data/test/unit/transition_test.rb +1558 -0
  308. metadata +450 -0
data/CHANGELOG.md ADDED
@@ -0,0 +1,506 @@
1
+ # master
2
+
3
+ * Raise InvalidContext error when the current state does not define a state-driven behavior
4
+ * Fix target state being indeterminate for transitions that use blacklists
5
+ * Allow super to be called within state-driven behaviors
6
+
7
+ ## 2.0.0 - 2025-03-04
8
+
9
+ * Added Ruby 3.2 support for legacy projects, a very few changes such as `File.exists` and `Object#taint` fixes
10
+
11
+ ## 1.2.0 / 2013-03-30
12
+
13
+ * Allow multiple whitelisted / blacklisted :to states when definining transitions
14
+ * Fix event attributes not being processed when saved via association autosaving
15
+ * Fix Mongoid integration not setting initial state attributes properly for associations
16
+ * Completely rewrite ORM action hooks to behave more consistently across the board
17
+ * Change transitions to be executed the same whether using ORM save actions or not
18
+ * Fix around_transition callbacks not being executed properly in ORM integrations
19
+ * Fix additional transitions not being able to be fired in transition callbacks
20
+ * Add documentation on the order in which transition callbacks run within ORM integrations
21
+ * Update README to include a topic on explicit vs. implicit event transitions [Nathan Long]
22
+ * Fix around_transition pausing not being marked as unsupported for rubinius [Daniel Huckstep]
23
+ * Fix all / any / same matchers not being able to be used in :from / :to options in transitions and callbacks
24
+ * Fix ActiveModel locale paths not being loaded properly under certain JRuby environments [Brad Heller]
25
+ * Remove dependency on the validation_class_methods plugin for Sequel 2.12.0+ [Casey Howard]
26
+ * Remove dependency on command-line git binaries from within the gemspec
27
+ * Fix deprecation warnings on ruby-graphviz 1.0.3+
28
+ * Update minimum required ruby-graphviz version to 0.9.17
29
+ * Fix aliased fields in Mongoid 2.4.0+ not being automatically detected
30
+ * Add Mongoid 3.0.0+ support
31
+ * Fix scopes getting generated multiple times when the singular / plural machine names are the same but of a different type (symbol vs. string)
32
+ * Add initial support for ActiveRecord / ActiveModel 4.0.0 beta
33
+ * Fix static initial states always being set even when the state has already been initialized in non-ORM integrations
34
+ * Generate a warning when the ORM's backend and state_machine define conflicting initial states for an attribute
35
+ * Fix all Ruby warnings
36
+ * Fix callbacks not working for methods that respond via method_missing [Balwant Kane]
37
+ * Fix observer callbacks being run when disabled in ActiveModel / ActiveRecord integrations
38
+ * Add YARD integration for autogenerating documentation / embedding visualizations of state machines
39
+ * Allow states / events to be drawn with their human name instead of their internal name
40
+
41
+ ## 1.1.2 / 2012-01-20
42
+
43
+ * Fix states not being initialized properly on ActiveRecord 3.2+
44
+
45
+ ## 1.1.1 / 2011-12-31
46
+
47
+ * Fix fields being defined for Mongoid / MongoMapper state attributes even if they're already defined in the model
48
+ * Raise error when states / events are referenced in a definition with different types (e.g. both Strings and Symbols)
49
+ * Allow all states / events to be looked up by their string / symbol equivalent
50
+ * Allow state_machine to be loaded without extensions to the Ruby core
51
+
52
+ ## 1.1.0 / 2011-11-13
53
+
54
+ * Allow the transitions / known states for an event to be reset
55
+ * Add fire_#{name}_event instance method for firing an arbitrary event on a state machine
56
+ * Improve InvalidTransition exception messages to include the failure reason(s) in ORM integrations
57
+ * Don't allow around_transitions to attempt to be called in multiple execution contexts when run in jruby
58
+ * Allow :from option to be used in transitions defined within state contexts
59
+ * Fix arguments / block not being preserved when chaining methods defined in state contexts
60
+ * Fix super not being allowed when a method is defined for multiple state contexts
61
+ * Change loopbacks to only cause objects to be persisted when the ORM decides it's necessary, instead of always forcing persistence
62
+ * Fix Mongoid 2.3.x integrations not initializing dynamic states in the same manner as other integrations with initialize callbacks
63
+
64
+ ## 1.0.3 / 2011-11-03
65
+
66
+ * Fix MongoMapper 0.10.0+ integrations not matching versions properly
67
+ * Update warnings for method conflicts to include instructions on how to ignore conflicts
68
+ * Fix state initialization in Mongoid 2.3.x integrations [Durran Jordan]
69
+ * Fix after_transition callbacks sometimes not running in Mongoid 2.2.x integrations
70
+ * Automatically load the plugins required in Sequel integrations
71
+ * Allow all / any matcher helpers to be used when defining states / events
72
+ * Allow states / events to be referenced by the string equivalent of their name
73
+ * Fix observer callbacks being run incorrectly when using nil states in ActiveModel-based integrations
74
+ * Remove ActiveModel Observer method chains in order to better ensure compatibility
75
+ * Update DataMapper integration for 1.2.0+ support [Markus Schirp]
76
+ * Provide access to the human state name in invalid_transition translations
77
+ * Add support for i18n keys in the form of #{i18n_scope}.state_machines.#{model_name}.states/events.#{value}
78
+ * Clarify documentation on writing to state machine attributes, using factory_girl and can_#{event} / #{event}_transition helpers
79
+ * Add documentation for dynmically generating state machines
80
+
81
+ ## 1.0.2 / 2011-08-09
82
+
83
+ * Allow transitions to be defined within a state, event, or machine context
84
+ * Use supported framework hooks for integrating Sequel 3.24.0+
85
+ * Use appraisal for testing integrations
86
+ * Improve documentation on the handling of method conflicts
87
+ * Update Mongoid integration for 2.1.0+ support
88
+ * Fix ActiveRecord machine state predicates incorrectly calling superclass implementation when using targeted attributes
89
+ * Fix error when defining states with the same name as the state's machine in ActiveRecord, MongoMapper, and Mongoid integrations
90
+ * Fix machine state predicate not calling superclass implementation if defined after machine definition
91
+ * Generate warnings when defining a helper method more than once
92
+ * Fix multiple machines not being able to target the same attribute if all possible states aren't defined in each
93
+ * Fix ActiveModel / DataMapper integrations not overriding StateMachine::Machine#after_initialize properly
94
+ * Improve documentation for overriding states and integration transactions
95
+
96
+ ## 1.0.1 / 2011-05-30
97
+
98
+ * Add the ability to ignore method conflicts for helpers
99
+ * Generate warnings for any helper, not just state helpers, that has a conflicting method defined in the class
100
+ * Fix scopes in Sequel not working if the table name contains double underscores or is not a string/symbol
101
+ * Add full support for chaining state scopes within Sequel integrations
102
+ * Fix Rails 3.1 deprecation warnings for configuring engine locales [Stefan Penner]
103
+
104
+ ## 1.0.0 / 2011-05-12
105
+
106
+ * Celebrate
107
+
108
+ ## 0.10.4 / 2011-04-14
109
+
110
+ * Fix translations not being available under certain environments in Rails applications
111
+
112
+ ## 0.10.3 / 2011-04-07
113
+
114
+ * Fix state initialization failing in ActiveRecord 3.0.2+ when using with_state scopes for the default scope
115
+
116
+ ## 0.10.2 / 2011-03-31
117
+
118
+ * Use more integrated state initialization hooks for ActiveRecord, Mongoid, and Sequel
119
+ * Remove mass-assignment filtering usage in all ORM integrations
120
+ * Only support official Mongoid 2.0.0 release and up (no more RC support)
121
+ * Fix attributes getting initialized more than once if different state machines use the same attribute
122
+ * Only initialize states if state is blank and blank is not a valid state
123
+ * Fix instance / class helpers failing when used with certain libraries (such as Thin)
124
+
125
+ ## 0.10.1 / 2011-03-22
126
+
127
+ * Fix classes with multiple state machines failing to initialize in ActiveRecord / Mongoid / Sequel integrations
128
+
129
+ ## 0.10.0 / 2011-03-19
130
+
131
+ * Support callback terminators in MongoMapper 0.9.0+
132
+ * Fix pluralization integration on DataMapper 1.0.0 and 1.1.0
133
+ * Allow transition guards to be bypassed for event / transition / path helpers
134
+ * Allow state / condition requirements to be specified for all event / transition / path helpers
135
+ * Add the ability to skip automatically initializing state machines on #initialize
136
+ * Add #{name}_paths for walking the available paths in a state machine
137
+ * Add Mongoid 2.0.0+ support
138
+ * Use around hooks to improve compatibility with other libraries in ActiveModel / ActiveRecord / MongoMapper integrations
139
+ * Add support for MassAssignmentSecurity feature in ActiveModel integrations
140
+ * Add support for more observer hooks within MongoMapper integrations
141
+ * Add i18n support for MongoMapper validation errors
142
+ * Update support for MongoMapper integration based on rails3 branch
143
+ * Fix objects not getting marked as dirty in all integrations when #{name}_event is set
144
+ * Generate warnings when conflicting state / event names are detected
145
+ * Allow fallback to generic state predicates when individual predicates are already defined in the owner class
146
+ * Replace :include_failures after_transition option with new after_failure callback
147
+ * Provide access to transition context when raising InvalidEvent / InvalidTransition exceptions
148
+
149
+ ## 0.9.4 / 2010-08-01
150
+
151
+ * Fix validation / save hooks in Sequel 3.14.0+
152
+ * Fix integration with dirty attribute tracking on DataMapper 1.0.1+
153
+ * Fix DataMapper 1.0.1+ tests producing warnings
154
+ * Fix validation error warnings in ActiveModel / ActiveRecord 3.0.0 beta5+
155
+ * Fix mass-assignment sanitization breaking in ActiveRecord 3.0.0 beta5+ [Akira Matsuda]
156
+
157
+ ## 0.9.3 / 2010-06-26
158
+
159
+ * Allow access to human state / event names in transitions and for the current state
160
+ * Use human state / event names in error messages
161
+ * Fix event names being used inconsistently in error messages
162
+ * Allow access to the humanized version of state / event names via human_state_name / human_state_event_name
163
+ * Allow MongoMapper 0.8.0+ scopes to be chainable
164
+ * Fix i18n deprecation warnings in ActiveModel / ActiveRecord 3.0.0.beta4
165
+ * Fix default error message translations overriding existing locales in ActiveModel / ActiveRecord
166
+
167
+ ## 0.9.2 / 2010-05-24
168
+
169
+ * Fix MongoMapper integration failing in Ruby 1.9.2
170
+ * Fix Rakefile not loading in Ruby 1.9.2 [Andrea Longhi]
171
+ * Fix nil / false :integration configuration not being respected
172
+
173
+ ## 0.9.1 / 2010-05-02
174
+
175
+ * Fix ActiveRecord 2.0.0 - 2.2.3 integrations failing if version info isn't already loaded
176
+ * Fix integration with dirty attribute tracking on DataMapper 0.10.3
177
+ * Fix observers failing in ActiveRecord 3.0.0.beta4+ integrations
178
+ * Fix deprecation warning in Rails 3 railtie [Chris Yuan]
179
+
180
+ ## 0.9.0 / 2010-04-12
181
+
182
+ * Use attribute-based event transitions whenever possible to ensure consistency
183
+ * Fix action helpers being defined when the action is **only** defined in the machine's owner class
184
+ * Disable attribute-based event transitions in DataMapper 0.9.4 - 0.9.6 when dm-validations is being used
185
+ * Add support for DataMapper 0.10.3+
186
+ * Add around_transition callbacks
187
+ * Fix transition failures during save not being handled correctly in Sequel 2.12.0+
188
+ * Fix attribute-based event transitions not hooking in properly in DataMapper 0.10.0+ and Sequel 2.12.0+
189
+ * Fix dynamic initial states causing errors in Ruby 1.9+ if no arguments are defined in the block
190
+ * Add MongoMapper 0.5.5+ support
191
+ * Add ActiveModel 3.0+ support for use with integrations that implement its interface
192
+ * Fix DataMapper integration failing when ActiveSupport is loaded in place of Extlib
193
+ * Add version dependencies for ruby-graphviz
194
+ * Remove app-specific rails / merb rake tasks in favor of always running state_machine:draw
195
+ * Add Rails 3 railtie for automatically loading rake tasks when installed as a gem
196
+
197
+ ## 0.8.1 / 2010-03-14
198
+
199
+ * Release gems via rake-gemcutter instead of rubyforge
200
+ * Move rake tasks to lib/tasks
201
+ * Dispatch state behavior to the superclass if it's undefined for a particular state [Sandro Turriate and Tim Pope]
202
+ * Fix state / event names not supporting i18n in ActiveRecord
203
+ * Fix original ActiveRecord::Observer#update not being used for non-state_machine callbacks [Jeremy Wells]
204
+ * Add support for ActiveRecord 3.0
205
+ * Fix without_{name} scopes not quoting columns in ActiveRecord [Jon Evans]
206
+ * Fix without_{name} scopes not scoping columns to the table in ActiveRecord and Sequel [Jon Evans]
207
+ * Fix custom state attributes not being marked properly as changed in ActiveRecord
208
+ * Fix tracked attributes changes in ActiveRecord / DataMapper integrations not working correctly for non-loopbacks [Joe Lind]
209
+ * Fix plural scope names being incorrect for DataMapper 0.9.4 - 0.9.6
210
+ * Fix deprecation warnings for ruby-graphviz 0.9.0+
211
+ * Add support for ActiveRecord 2.0.*
212
+ * Fix nil states being overwritten when they're explicitly set in ORM integrations
213
+ * Fix default states not getting set in ORM integrations if the column has a default
214
+ * Fix event transitions being kept around while running actions/callbacks, sometimes preventing object marshalling
215
+
216
+ ## 0.8.0 / 2009-08-15
217
+
218
+ * Add support for DataMapper 0.10.0
219
+ * Always interpet nil return values from actions as failed attempts
220
+ * Fix loopbacks not causing records to save in ORM integrations if no other fields were changed
221
+ * Fix events not failing with useful errors when an object's state is invalid
222
+ * Use more friendly NoMethodError messages for state-driven behaviors
223
+ * Fix before_transition callbacks getting run twice when using event attributes in ORM integrations
224
+ * Add the ability to query for the availability of specific transitions on an object
225
+ * Allow after_transition callbacks to be explicitly run on failed attempts
226
+ * By default, don't run after_transition callbacks on failed attempts
227
+ * Fix not allowing multiple methods to be specified as arguments in callbacks
228
+ * Fix initial states being set when loading records from the database in Sequel integration
229
+ * Allow static initial states to be set earlier in the initialization of an object
230
+ * Use friendly validation errors for nil states
231
+ * Fix states not being validated properly when using custom names in ActiveRecord / DataMapper integrations
232
+
233
+ ## 0.7.6 / 2009-06-17
234
+
235
+ * Allow multiple state machines on the same class to target the same attribute
236
+ * Add support for :attribute to customize the attribute target, assuming the name is the first argument of #state_machine
237
+ * Simplify reading from / writing to machine-related attributes on objects
238
+ * Fix locale for ActiveRecord getting added to the i18n load path multiple times [Reiner Dieterich]
239
+ * Fix callbacks, guards, and state-driven behaviors not always working on tainted classes [Brandon Dimcheff]
240
+ * Use Ruby 1.9's built-in Object#instance_exec for bound callbacks when it's available
241
+ * Improve performance of cached dynamic state lookups by 25%
242
+
243
+ ## 0.7.5 / 2009-05-25
244
+
245
+ * Add built-in caching for dynamic state values when the value only needs to be generated once
246
+ * Fix flawed example for using record ids as state values
247
+ * Don't evaluate state values until they're actually used in an object instance
248
+ * Make it easier to use event attributes for actions defined in the same class as the state machine
249
+ * Fix #save/save! running transitions in ActiveRecord integrations even when a machine's action is not :save
250
+
251
+ ## 0.7.4 / 2009-05-23
252
+
253
+ * Fix #save! not firing event attributes properly in ActiveRecord integrations
254
+ * Fix log files being included in gems
255
+
256
+ ## 0.7.3 / 2009-04-25
257
+
258
+ * Require DataMapper version be >= 0.9.4
259
+ * Explicitly load Sequel's built-in inflector (>= 2.12.0) for scope names
260
+ * Don't use qualified name for event attributes
261
+ * Fix #valid? being defined for DataMapper resources when dm-validations isn't loaded
262
+ * Add auto-validation of values allowed for the state attribute in ORM integrations
263
+
264
+ ## 0.7.2 / 2009-04-08
265
+
266
+ * Add support for running multiple methods in a callback without using blocks
267
+ * Add more flexibility around how callbacks are defined
268
+ * Add security documentation around mass-assignment in ORM integrations
269
+ * Fix event attribute transitions being publicly accessible
270
+
271
+ ## 0.7.1 / 2009-04-05
272
+
273
+ * Fix machines failing to generate graphs when run from Merb tasks
274
+
275
+ ## 0.7.0 / 2009-04-04
276
+
277
+ * Add #{attribute}_event for automatically firing events when the object's action is called
278
+ * Make it easier to override state-driven behaviors
279
+ * Rollback state changes when the action fails during transitions
280
+ * Use :messages instead of :invalid_message for customizing validation errors
281
+ * Use more human-readable validation errors
282
+ * Add support for more ActiveRecord observer hooks
283
+ * Add support for targeting multiple specific state machines in DataMapper observer hooks
284
+ * Don't pass the result of the action as an argument to callbacks (access via Transition#result)
285
+ * Fix incorrect results being used when running transitions in parallel
286
+ * Fix transition args not being set when run in parallel
287
+ * Allow callback terminators to be set on an application-wide basis
288
+ * Only catch :halt during before / after transition callbacks
289
+ * Fix ActiveRecord predicates being overwritten if they're already defined in the class
290
+ * Allow machine options to be set on an integration-wide basis
291
+ * Turn transactions off by default in DataMapper integrations
292
+ * Add support for configuring the use of transactions
293
+ * Simplify reading/writing of attributes
294
+ * Simplify access to state machines via #state_machine(:attribute) without generating dupes
295
+ * Fix assumptions that dm-validations is always available in DataMapper integration
296
+ * Automatically define DataMapper properties for machine attributes if they don't exist
297
+ * Add Transition#qualified_event, #qualified_from_name, and #qualified_to_name
298
+ * Add #fire_events / #fire_events! for running events on multiple state machines in parallel
299
+ * Rename next_#{event}_transition to #{event}_transition
300
+ * Add #{attribute}_transitions for getting the list of transitions that can be run on an object
301
+ * Add #{attribute}_events for getting the list of events that can be fired on an object
302
+ * Use generated non-bang event when running bang version so that overriding one affects the other
303
+ * Provide access to arguments passed into an event from transition callbacks via Transition#args
304
+
305
+ ## 0.6.3 / 2009-03-10
306
+
307
+ * Add support for customizing the graph's orientation
308
+ * Use the standard visualizations for initial (open arrow) and final (double circle) states
309
+ * Highlight final states in GraphViz drawings
310
+
311
+ ## 0.6.2 / 2009-03-08
312
+
313
+ * Make it easier to override generated instance / class methods
314
+
315
+ ## 0.6.1 / 2009-03-07
316
+
317
+ * Add i18n support for ActiveRecord validation errors
318
+ * Add a validation error when failing to transition for ActiveRecord / DataMapper / Sequel integrations
319
+
320
+ ## 0.6.0 / 2009-03-03
321
+
322
+ * Allow multiple conditions for callbacks / class behaviors
323
+ * Add support for state-driven class behavior with :if/:unless options
324
+ * Alias Machine#event as Machine#on
325
+ * Fix nil from/to states not being handled properly
326
+ * Simplify hooking callbacks into loopbacks
327
+ * Add simplified transition/callback requirement syntax
328
+
329
+ ## 0.5.2 / 2009-02-17
330
+
331
+ * Improve pretty-print of events
332
+ * Simplify state/event matching design, improving guard performance by 30%
333
+ * Add better error notification when conflicting guard options are defined
334
+ * Fix scope name pluralization not being applied correctly
335
+
336
+ ## 0.5.1 / 2009-02-11
337
+
338
+ * Allow states to be drawn as ellipses to accommodate long names
339
+ * Fix rake tasks not being registered in Rails/Merb applications
340
+ * Never automatically define machine attribute accessors when using an integration
341
+
342
+ ## 0.5.0 / 2009-01-11
343
+
344
+ * Add to_name and from_name to transition objects
345
+ * Add nicely formatted #inspect for transitions
346
+ * Fix ActiveRecord integrations failing when the database doesn't exist yet
347
+ * Fix states not being drawn in GraphViz graphs in the correct order
348
+ * Add nicely formatted #inspect for states and events
349
+ * Simplify machine context-switching
350
+ * Store events/states in enumerable node collections
351
+ * No longer allow subclasses to change the integration
352
+ * Move fire! action logic into the Event class (no longer calls fire action on the object)
353
+ * Allow states in subclasses to have different values
354
+ * Recommend that all states be referenced as symbols instead of strings
355
+ * All states must now be named (and can be associated with other value types)
356
+ * Add support for customizing the actual stored value for a state
357
+ * Add compatibility with Ruby 1.9+
358
+
359
+ ## 0.4.3 / 2008-12-28
360
+
361
+ * Allow dm-observer integration to be optional
362
+ * Fix non-lambda callbacks not working for DataMapper/Sequel
363
+
364
+ ## 0.4.2 / 2008-12-28
365
+
366
+ * Fix graphs not being drawn the same way consistently
367
+ * Add support for sharing transitions across multiple events
368
+ * Add support for state-driven behavior
369
+ * Simplify initialize hooks, requiring super to be called instead
370
+ * Add :namespace option for generated state predicates / event methods
371
+
372
+ ## 0.4.1 / 2008-12-16
373
+
374
+ * Fix nil states not being handled properly in guards, known states, or visualizations
375
+ * Fix the same node being used for different dynamic states in GraphViz output
376
+ * Always include initial state in the list of known states even if it's dynamic
377
+ * Use consistent naming scheme for dynamic states in GraphViz output
378
+ * Allow blocks to be directly passed into machine class
379
+ * Fix attribute predicates not working on attributes that represent columns in ActiveRecord
380
+
381
+ ## 0.4.0 / 2008-12-14
382
+
383
+ * Remove the PluginAWeek namespace
384
+ * Add generic attribute predicate (e.g. "#{attribute}?(state_name)") and state predicates (e.g. "#{state}?")
385
+ * Add Sequel support
386
+ * Fix aliasing :initialize on ActiveRecord models causing warnings when the environment is reloaded
387
+ * Fix ActiveRecord state machines trying to query the database on unmigrated models
388
+ * Fix initial states not getting set when the current value is an empty string [Aaron Gibralter]
389
+ * Add rake tasks for generating graphviz files for state machines [Nate Murray]
390
+ * Fix initial state not being included in list of known states
391
+ * Add other_states directive for defining additional states not referenced in transitions or callbacks [Pete Forde]
392
+ * Add next_#{event}_transition for getting the next transition that would be performed if the event were invoked
393
+ * Add the ability to override the pluralized name of an attribute for creating scopes
394
+ * Add the ability to halt callback chains by: throw :halt
395
+ * Add support for dynamic to states in transitions (e.g. :to => lambda {Time.now})
396
+ * Add support for using real blocks in before_transition/after_transition calls instead of using the :do option
397
+ * Add DataMapper support
398
+ * Include states referenced in transition callbacks in the list of a machine's known states
399
+ * Only generate the known states for a machine on demand, rather than calculating beforehand
400
+ * Add the ability to skip state change actions during a transition (e.g. vehicle.ignite(false))
401
+ * Add the ability for the state change action (e.g. `save` for ActiveRecord) to be configurable
402
+ * Allow state machines to be defined on **any** Ruby class, not just ActiveRecord (removes all external dependencies)
403
+ * Refactor transitions, guards, and callbacks for better organization/design
404
+ * Use a class containing the transition context in callbacks, rather than an ordered list of each individual attribute
405
+ * Add without_#{attribute} named scopes (opposite of the existing with_#{attribute} named scopes) [Sean O'Brien]
406
+
407
+ ## 0.3.1 / 2008-10-26
408
+
409
+ * Fix the initial state not getting set when the state attribute is mass-assigned but protected
410
+ * Change how the base module is included to prevent namespacing conflicts
411
+
412
+ ## 0.3.0 / 2008-09-07
413
+
414
+ * No longer allow additional arguments to be passed into event actions
415
+ * Add support for can_#{event}? for checking whether an event can be fired based on the current state of the record
416
+ * Don't use callbacks for performing transitions
417
+ * Fix state machines in subclasses not knowing what states/events/transitions were defined by superclasses
418
+ * Replace all before/after_exit/enter/loopback callback hooks and :before/:after options for events with before_transition/after_transition callbacks, e.g.
419
+
420
+ before_transition :from => 'parked', :do => :lock_doors # was before_exit :parked, :lock_doors
421
+ after_transition :on => 'ignite', :do => :turn_on_radio # was event :ignite, :after => :turn_on_radio do
422
+
423
+ * Always save when an event is fired even if it results in a loopback [Jürgen Strobel]
424
+ * Ensure initial state callbacks are invoked in the proper order when an event is fired on a new record
425
+ * Add before_loopback and after_loopback hooks [Jürgen Strobel]
426
+
427
+ ## 0.2.1 / 2008-07-05
428
+
429
+ * Add more descriptive exceptions
430
+ * Assume the default state attribute is "state" if one is not provided
431
+ * Add :except_from option for transitions if you want to blacklist states
432
+ * Add PluginAWeek::StateMachine::Machine#states
433
+ * Add PluginAWeek::StateMachine::Event#transitions
434
+ * Allow creating transitions with no from state (effectively allowing the transition for **any** from state)
435
+ * Reduce the number of objects created for each transition
436
+
437
+ ## 0.2.0 / 2008-06-29
438
+
439
+ * Add a non-bang version of events (e.g. park) that will return a boolean value for success
440
+ * Raise an exception if the bang version of events are used (e.g. park!) and no transition is successful
441
+ * Change callbacks to act a little more like ActiveRecord
442
+ * Avoid using string evaluation for dynamic methods
443
+
444
+ ## 0.1.1 / 2008-06-22
445
+
446
+ * Remove log files from gems
447
+
448
+ ## 0.1.0 / 2008-05-05
449
+
450
+ * Completely rewritten from scratch
451
+ * Renamed to state_machine
452
+ * Removed database dependencies
453
+ * Removed models in favor of an attribute-agnostic design
454
+ * Use ActiveSupport::Callbacks instead of eval_call
455
+ * Remove dry_transaction_rollbacks dependencies
456
+ * Added functional tests
457
+ * Updated documentation
458
+
459
+ ## 0.0.1 / 2007-09-26
460
+
461
+ * Add dependency on custom_callbacks
462
+ * Move test fixtures out of the test application root directory
463
+ * Improve documentation
464
+ * Remove the StateExtension module in favor of adding singleton methods to the stateful class
465
+ * Convert dos newlines to unix newlines
466
+ * Fix error message when a given event can't be found in the database
467
+ * Add before_#{action} and #{action} callbacks when an event is performed
468
+ * All state and event callbacks can now explicitly return false in order to cancel the action
469
+ * Refactor ActiveState callback creation
470
+ * Refactor unit tests so that they use mock classes instead of themselves
471
+ * Allow force_reload option to be set in the state association
472
+ * Don't save the entire model when updating the state_id
473
+ * Raise exception if a class tries to define a state more than once
474
+ * Add tests for PluginAWeek::Has::States::ActiveState
475
+ * Refactor active state/active event creation
476
+ * Fix owner_type not being set correctly in active states/events of subclasses
477
+ * Allow subclasses to override the initial state
478
+ * Fix problem with migrations using default null when column cannot be null
479
+ * Moved deadline support into a separate plugin (has_state_deadlines).
480
+ * Added many more unit tests.
481
+ * Simplified many of the interfaces for maintainability.
482
+ * Added support for turning off recording state changes.
483
+ * Removed the short_description and long_description columns, in favor of an optional human_name column.
484
+ * Fixed not overriding the correct equality methods in the StateTransition class.
485
+ * Added to_sym to State and Event.
486
+ * State#name and Event#name now return the string version of the name instead of the symbol version.
487
+ * Added State#human_name and Event#human_name to automatically figure out what the human name is if it isn't specified in the table.
488
+ * Updated manual rollbacks to use the new Rails edge api (ActiveRecord::Rollback exception).
489
+ * Moved StateExtension class into a separate file in order to help keep the has_state files clean.
490
+ * Renamed InvalidState and InvalidEvent exceptions to StateNotFound and EventNotFound in order to follow the ActiveRecord convention (i.e. RecordNotFound).
491
+ * Added StateNotActive and EventNotActive exceptions to help differentiate between states which don't exist and states which weren't defined in the class.
492
+ * Added support for defining callbacks like so:
493
+
494
+ def before_exit_parked
495
+ end
496
+
497
+ def after_enter_idling
498
+ end
499
+
500
+ * Added support for defining callbacks using class methods:
501
+
502
+ before_exit_parked :fasten_seatbelt
503
+
504
+ * Added event callbacks after the transition has occurred (e.g. after_park)
505
+ * State callbacks no longer receive any of the arguments that were provided in the event action
506
+ * Updated license to include our names.
data/Dockerfile ADDED
@@ -0,0 +1,13 @@
1
+ # This file is used to compare changes with "original" version of this gem.
2
+ FROM ruby:1.9.3
3
+
4
+ RUN mkdir /app
5
+ COPY . /app
6
+ WORKDIR /app
7
+
8
+ RUN bundle install
9
+ RUN gem install appraisal -v 0.5.2
10
+ RUN bundle exec rake test
11
+ #RUN bundle exec rake appraisal:install
12
+ #CMD bundle exec rake appraisal test
13
+
data/Gemfile ADDED
@@ -0,0 +1,4 @@
1
+ source "http://www.rubygems.org"
2
+
3
+ gem 'test-unit'
4
+ gemspec
data/LICENSE ADDED
@@ -0,0 +1,20 @@
1
+ Copyright (c) 2006-2012 Aaron Pfeifer
2
+
3
+ Permission is hereby granted, free of charge, to any person obtaining
4
+ a copy of this software and associated documentation files (the
5
+ "Software"), to deal in the Software without restriction, including
6
+ without limitation the rights to use, copy, modify, merge, publish,
7
+ distribute, sublicense, and/or sell copies of the Software, and to
8
+ permit persons to whom the Software is furnished to do so, subject to
9
+ the following conditions:
10
+
11
+ The above copyright notice and this permission notice shall be
12
+ included in all copies or substantial portions of the Software.
13
+
14
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
15
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
17
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
18
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
19
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
20
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.