state_machine 1.1.2 → 1.2.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (240) hide show
  1. data/.gitignore +7 -11
  2. data/.travis.yml +49 -7
  3. data/Appraisals +255 -87
  4. data/CHANGELOG.md +30 -0
  5. data/README.md +142 -21
  6. data/Rakefile +1 -11
  7. data/examples/Gemfile +5 -0
  8. data/examples/Gemfile.lock +14 -0
  9. data/examples/auto_shop.rb +2 -0
  10. data/examples/car.rb +2 -0
  11. data/examples/doc/AutoShop.html +2856 -0
  12. data/examples/doc/AutoShop_state.png +0 -0
  13. data/examples/doc/Car.html +919 -0
  14. data/examples/doc/Car_state.png +0 -0
  15. data/examples/doc/TrafficLight.html +2230 -0
  16. data/examples/doc/TrafficLight_state.png +0 -0
  17. data/examples/doc/Vehicle.html +7921 -0
  18. data/examples/doc/Vehicle_state.png +0 -0
  19. data/examples/doc/_index.html +136 -0
  20. data/examples/doc/class_list.html +47 -0
  21. data/examples/doc/css/common.css +1 -0
  22. data/examples/doc/css/full_list.css +55 -0
  23. data/examples/doc/css/style.css +322 -0
  24. data/examples/doc/file_list.html +46 -0
  25. data/examples/doc/frames.html +13 -0
  26. data/examples/doc/index.html +136 -0
  27. data/examples/doc/js/app.js +205 -0
  28. data/examples/doc/js/full_list.js +173 -0
  29. data/examples/doc/js/jquery.js +16 -0
  30. data/examples/doc/method_list.html +734 -0
  31. data/examples/doc/top-level-namespace.html +105 -0
  32. data/examples/rails-rest/migration.rb +1 -5
  33. data/examples/rails-rest/view__form.html.erb +34 -0
  34. data/examples/rails-rest/view_edit.html.erb +2 -21
  35. data/examples/rails-rest/view_index.html.erb +6 -4
  36. data/examples/rails-rest/view_new.html.erb +2 -11
  37. data/examples/rails-rest/view_show.html.erb +5 -3
  38. data/examples/traffic_light.rb +2 -0
  39. data/examples/vehicle.rb +2 -0
  40. data/gemfiles/active_model-3.0.0.gemfile.lock +9 -6
  41. data/gemfiles/active_model-3.0.5.gemfile.lock +10 -7
  42. data/gemfiles/active_model-3.1.1.gemfile.lock +12 -10
  43. data/gemfiles/{active_model-3.2.0.gemfile → active_model-3.2.1.gemfile} +1 -1
  44. data/gemfiles/{graphviz-0.9.0.gemfile → active_model-3.2.12.gemfile} +1 -1
  45. data/gemfiles/active_model-3.2.12.gemfile.lock +36 -0
  46. data/gemfiles/{active_record-3.2.0.gemfile → active_model-3.2.13.rc1.gemfile} +1 -2
  47. data/gemfiles/active_model-3.2.13.rc1.gemfile.lock +36 -0
  48. data/gemfiles/active_model-4.0.0.gemfile +9 -0
  49. data/gemfiles/active_model-4.0.0.gemfile.lock +78 -0
  50. data/gemfiles/active_record-2.0.0.gemfile +2 -1
  51. data/gemfiles/active_record-2.0.0.gemfile.lock +15 -6
  52. data/gemfiles/active_record-2.0.5.gemfile +2 -1
  53. data/gemfiles/active_record-2.0.5.gemfile.lock +15 -6
  54. data/gemfiles/active_record-2.1.0.gemfile +2 -1
  55. data/gemfiles/active_record-2.1.0.gemfile.lock +15 -6
  56. data/gemfiles/active_record-2.1.2.gemfile +2 -1
  57. data/gemfiles/active_record-2.1.2.gemfile.lock +15 -6
  58. data/gemfiles/active_record-2.2.3.gemfile +2 -1
  59. data/gemfiles/active_record-2.2.3.gemfile.lock +15 -6
  60. data/gemfiles/active_record-2.3.12.gemfile +2 -1
  61. data/gemfiles/active_record-2.3.12.gemfile.lock +15 -6
  62. data/gemfiles/active_record-2.3.5.gemfile +9 -0
  63. data/gemfiles/active_record-2.3.5.gemfile.lock +39 -0
  64. data/gemfiles/active_record-3.0.0.gemfile +2 -1
  65. data/gemfiles/active_record-3.0.0.gemfile.lock +18 -11
  66. data/gemfiles/active_record-3.0.5.gemfile +2 -1
  67. data/gemfiles/active_record-3.0.5.gemfile.lock +19 -12
  68. data/gemfiles/active_record-3.1.1.gemfile +2 -1
  69. data/gemfiles/active_record-3.1.1.gemfile.lock +22 -16
  70. data/gemfiles/active_record-3.2.12.gemfile +9 -0
  71. data/gemfiles/active_record-3.2.12.gemfile.lock +51 -0
  72. data/gemfiles/active_record-3.2.13.rc1.gemfile +9 -0
  73. data/gemfiles/active_record-3.2.13.rc1.gemfile.lock +51 -0
  74. data/gemfiles/active_record-4.0.0.gemfile +11 -0
  75. data/gemfiles/active_record-4.0.0.gemfile.lock +83 -0
  76. data/gemfiles/data_mapper-0.10.2.gemfile +1 -0
  77. data/gemfiles/data_mapper-0.10.2.gemfile.lock +13 -9
  78. data/gemfiles/data_mapper-0.9.11.gemfile +1 -0
  79. data/gemfiles/data_mapper-0.9.11.gemfile.lock +31 -7
  80. data/gemfiles/data_mapper-0.9.4.gemfile.lock +25 -14
  81. data/gemfiles/data_mapper-0.9.7.gemfile +1 -0
  82. data/gemfiles/data_mapper-0.9.7.gemfile.lock +27 -15
  83. data/gemfiles/data_mapper-1.0.0.gemfile.lock +20 -17
  84. data/gemfiles/data_mapper-1.0.1.gemfile.lock +20 -17
  85. data/gemfiles/data_mapper-1.0.2.gemfile.lock +20 -17
  86. data/gemfiles/data_mapper-1.1.0.gemfile.lock +19 -16
  87. data/gemfiles/data_mapper-1.2.0.gemfile.lock +19 -16
  88. data/gemfiles/default.gemfile.lock +8 -5
  89. data/gemfiles/graphviz-0.9.17.gemfile +7 -0
  90. data/gemfiles/graphviz-0.9.17.gemfile.lock +29 -0
  91. data/gemfiles/graphviz-0.9.21.gemfile.lock +7 -4
  92. data/gemfiles/graphviz-1.0.0.gemfile.lock +7 -4
  93. data/gemfiles/graphviz-1.0.3.gemfile +7 -0
  94. data/gemfiles/graphviz-1.0.3.gemfile.lock +29 -0
  95. data/gemfiles/graphviz-1.0.8.gemfile +7 -0
  96. data/gemfiles/graphviz-1.0.8.gemfile.lock +29 -0
  97. data/gemfiles/mongo_mapper-0.10.0.gemfile +1 -0
  98. data/gemfiles/mongo_mapper-0.10.0.gemfile.lock +14 -11
  99. data/gemfiles/mongo_mapper-0.11.1.gemfile +7 -0
  100. data/gemfiles/mongo_mapper-0.11.1.gemfile.lock +44 -0
  101. data/gemfiles/mongo_mapper-0.11.2.gemfile +9 -0
  102. data/gemfiles/mongo_mapper-0.11.2.gemfile.lock +48 -0
  103. data/gemfiles/mongo_mapper-0.12.0.gemfile +9 -0
  104. data/gemfiles/mongo_mapper-0.12.0.gemfile.lock +48 -0
  105. data/gemfiles/mongo_mapper-0.5.5.gemfile.lock +7 -4
  106. data/gemfiles/mongo_mapper-0.5.8.gemfile.lock +7 -4
  107. data/gemfiles/mongo_mapper-0.6.0.gemfile.lock +7 -4
  108. data/gemfiles/mongo_mapper-0.6.10.gemfile.lock +7 -4
  109. data/gemfiles/mongo_mapper-0.7.0.gemfile.lock +7 -4
  110. data/gemfiles/mongo_mapper-0.7.5.gemfile.lock +7 -4
  111. data/gemfiles/mongo_mapper-0.8.0.gemfile.lock +7 -4
  112. data/gemfiles/mongo_mapper-0.8.3.gemfile.lock +7 -4
  113. data/gemfiles/mongo_mapper-0.8.4.gemfile.lock +7 -4
  114. data/gemfiles/mongo_mapper-0.8.6.gemfile.lock +7 -4
  115. data/gemfiles/mongo_mapper-0.9.0.gemfile.lock +7 -4
  116. data/gemfiles/mongoid-2.0.0.gemfile +2 -0
  117. data/gemfiles/mongoid-2.0.0.gemfile.lock +22 -18
  118. data/gemfiles/mongoid-2.1.4.gemfile +2 -0
  119. data/gemfiles/mongoid-2.1.4.gemfile.lock +21 -17
  120. data/gemfiles/mongoid-2.2.4.gemfile +2 -0
  121. data/gemfiles/mongoid-2.2.4.gemfile.lock +21 -17
  122. data/gemfiles/mongoid-2.3.3.gemfile +2 -0
  123. data/gemfiles/mongoid-2.3.3.gemfile.lock +21 -17
  124. data/gemfiles/mongoid-2.4.0.gemfile +9 -0
  125. data/gemfiles/mongoid-2.4.0.gemfile.lock +47 -0
  126. data/gemfiles/mongoid-2.4.10.gemfile +9 -0
  127. data/gemfiles/mongoid-2.4.10.gemfile.lock +47 -0
  128. data/gemfiles/mongoid-2.5.2.gemfile +9 -0
  129. data/gemfiles/mongoid-2.5.2.gemfile.lock +47 -0
  130. data/gemfiles/mongoid-2.6.0.gemfile +9 -0
  131. data/gemfiles/mongoid-2.6.0.gemfile.lock +47 -0
  132. data/gemfiles/mongoid-3.0.0.gemfile +8 -0
  133. data/gemfiles/mongoid-3.0.0.gemfile.lock +45 -0
  134. data/gemfiles/mongoid-3.0.22.gemfile +8 -0
  135. data/gemfiles/mongoid-3.0.22.gemfile.lock +45 -0
  136. data/gemfiles/mongoid-3.1.0.gemfile +8 -0
  137. data/gemfiles/mongoid-3.1.0.gemfile.lock +45 -0
  138. data/gemfiles/sequel-2.11.0.gemfile +2 -1
  139. data/gemfiles/sequel-2.11.0.gemfile.lock +11 -6
  140. data/gemfiles/sequel-2.12.0.gemfile +2 -1
  141. data/gemfiles/sequel-2.12.0.gemfile.lock +11 -6
  142. data/gemfiles/sequel-2.8.0.gemfile +2 -1
  143. data/gemfiles/sequel-2.8.0.gemfile.lock +11 -6
  144. data/gemfiles/sequel-3.0.0.gemfile +2 -1
  145. data/gemfiles/sequel-3.0.0.gemfile.lock +11 -6
  146. data/gemfiles/sequel-3.10.0.gemfile +9 -0
  147. data/gemfiles/sequel-3.10.0.gemfile.lock +33 -0
  148. data/gemfiles/sequel-3.13.0.gemfile +2 -1
  149. data/gemfiles/sequel-3.13.0.gemfile.lock +11 -6
  150. data/gemfiles/sequel-3.14.0.gemfile +2 -1
  151. data/gemfiles/sequel-3.14.0.gemfile.lock +11 -6
  152. data/gemfiles/sequel-3.23.0.gemfile +2 -1
  153. data/gemfiles/sequel-3.23.0.gemfile.lock +11 -6
  154. data/gemfiles/sequel-3.24.0.gemfile +2 -1
  155. data/gemfiles/sequel-3.24.0.gemfile.lock +11 -6
  156. data/gemfiles/sequel-3.29.0.gemfile +2 -1
  157. data/gemfiles/sequel-3.29.0.gemfile.lock +11 -6
  158. data/gemfiles/sequel-3.34.0.gemfile +9 -0
  159. data/gemfiles/sequel-3.34.0.gemfile.lock +33 -0
  160. data/gemfiles/sequel-3.35.0.gemfile +9 -0
  161. data/gemfiles/sequel-3.35.0.gemfile.lock +33 -0
  162. data/gemfiles/sequel-3.4.0.gemfile +9 -0
  163. data/gemfiles/sequel-3.4.0.gemfile.lock +33 -0
  164. data/gemfiles/sequel-3.44.0.gemfile +9 -0
  165. data/gemfiles/sequel-3.44.0.gemfile.lock +33 -0
  166. data/lib/state_machine.rb +6 -0
  167. data/lib/state_machine/branch.rb +9 -8
  168. data/lib/state_machine/callback.rb +2 -2
  169. data/lib/state_machine/core.rb +10 -0
  170. data/lib/state_machine/core_ext.rb +1 -0
  171. data/lib/state_machine/eval_helpers.rb +5 -3
  172. data/lib/state_machine/event.rb +17 -6
  173. data/lib/state_machine/graph.rb +92 -0
  174. data/lib/state_machine/integrations.rb +13 -1
  175. data/lib/state_machine/integrations/active_model.rb +14 -20
  176. data/lib/state_machine/integrations/active_model/observer.rb +3 -3
  177. data/lib/state_machine/integrations/active_model/observer_update.rb +42 -0
  178. data/lib/state_machine/integrations/active_record.rb +52 -25
  179. data/lib/state_machine/integrations/active_record/locale.rb +1 -1
  180. data/lib/state_machine/integrations/active_record/versions.rb +1 -17
  181. data/lib/state_machine/integrations/base.rb +15 -6
  182. data/lib/state_machine/integrations/data_mapper.rb +98 -35
  183. data/lib/state_machine/integrations/data_mapper/versions.rb +46 -8
  184. data/lib/state_machine/integrations/mongo_mapper.rb +39 -12
  185. data/lib/state_machine/integrations/mongo_mapper/locale.rb +1 -1
  186. data/lib/state_machine/integrations/mongo_mapper/versions.rb +3 -20
  187. data/lib/state_machine/integrations/mongoid.rb +52 -14
  188. data/lib/state_machine/integrations/mongoid/locale.rb +1 -1
  189. data/lib/state_machine/integrations/mongoid/versions.rb +52 -26
  190. data/lib/state_machine/integrations/sequel.rb +82 -33
  191. data/lib/state_machine/integrations/sequel/versions.rb +19 -44
  192. data/lib/state_machine/machine.rb +99 -59
  193. data/lib/state_machine/machine_collection.rb +1 -2
  194. data/lib/state_machine/macro_methods.rb +29 -0
  195. data/lib/state_machine/node_collection.rb +1 -1
  196. data/lib/state_machine/state.rb +18 -10
  197. data/lib/state_machine/state_context.rb +2 -2
  198. data/lib/state_machine/transition.rb +8 -1
  199. data/lib/state_machine/transition_collection.rb +2 -1
  200. data/lib/state_machine/version.rb +1 -1
  201. data/lib/state_machine/yard.rb +8 -0
  202. data/lib/state_machine/yard/handlers.rb +12 -0
  203. data/lib/state_machine/yard/handlers/base.rb +32 -0
  204. data/lib/state_machine/yard/handlers/event.rb +25 -0
  205. data/lib/state_machine/yard/handlers/machine.rb +344 -0
  206. data/lib/state_machine/yard/handlers/state.rb +25 -0
  207. data/lib/state_machine/yard/handlers/transition.rb +47 -0
  208. data/lib/state_machine/yard/templates.rb +3 -0
  209. data/lib/state_machine/yard/templates/default/class/html/setup.rb +30 -0
  210. data/lib/state_machine/yard/templates/default/class/html/state_machines.erb +12 -0
  211. data/lib/tasks/state_machine.rb +2 -1
  212. data/lib/yard-state_machine.rb +2 -0
  213. data/state_machine.gemspec +4 -3
  214. data/test/files/switch.rb +4 -0
  215. data/test/test_helper.rb +5 -0
  216. data/test/unit/branch_test.rb +117 -36
  217. data/test/unit/callback_test.rb +5 -2
  218. data/test/unit/eval_helpers_test.rb +49 -1
  219. data/test/unit/event_collection_test.rb +3 -1
  220. data/test/unit/event_test.rb +182 -12
  221. data/test/unit/graph_test.rb +98 -0
  222. data/test/unit/integrations/active_model_test.rb +82 -12
  223. data/test/unit/integrations/active_record_test.rb +393 -37
  224. data/test/unit/integrations/base_test.rb +7 -2
  225. data/test/unit/integrations/data_mapper_test.rb +326 -72
  226. data/test/unit/integrations/mongo_mapper_test.rb +338 -44
  227. data/test/unit/integrations/mongoid_test.rb +606 -98
  228. data/test/unit/integrations/sequel_test.rb +429 -102
  229. data/test/unit/integrations_test.rb +28 -6
  230. data/test/unit/machine_collection_test.rb +6 -2
  231. data/test/unit/machine_test.rb +134 -82
  232. data/test/unit/node_collection_test.rb +2 -2
  233. data/test/unit/path_test.rb +1 -1
  234. data/test/unit/state_test.rb +65 -21
  235. data/test/unit/transition_collection_test.rb +43 -23
  236. data/test/unit/transition_test.rb +8 -2
  237. metadata +303 -221
  238. data/gemfiles/active_model-3.2.0.gemfile.lock +0 -32
  239. data/gemfiles/active_record-3.2.0.gemfile.lock +0 -43
  240. data/gemfiles/graphviz-0.9.0.gemfile.lock +0 -26
@@ -0,0 +1,105 @@
1
+ <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
2
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
3
+ <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
4
+ <head>
5
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
6
+ <title>
7
+ Top Level Namespace
8
+
9
+ &mdash; Documentation by YARD 0.7.5
10
+
11
+ </title>
12
+
13
+ <link rel="stylesheet" href="css/style.css" type="text/css" media="screen" charset="utf-8" />
14
+
15
+ <link rel="stylesheet" href="css/common.css" type="text/css" media="screen" charset="utf-8" />
16
+
17
+ <script type="text/javascript" charset="utf-8">
18
+ relpath = '';
19
+ if (relpath != '') relpath += '/';
20
+ </script>
21
+
22
+ <script type="text/javascript" charset="utf-8" src="js/jquery.js"></script>
23
+
24
+ <script type="text/javascript" charset="utf-8" src="js/app.js"></script>
25
+
26
+
27
+ </head>
28
+ <body>
29
+ <script type="text/javascript" charset="utf-8">
30
+ if (window.top.frames.main) document.body.className = 'frames';
31
+ </script>
32
+
33
+ <div id="header">
34
+ <div id="menu">
35
+
36
+ <a href="_index.html">Index</a> &raquo;
37
+
38
+
39
+ <span class="title">Top Level Namespace</span>
40
+
41
+
42
+ <div class="noframes"><span class="title">(</span><a href="." target="_top">no frames</a><span class="title">)</span></div>
43
+ </div>
44
+
45
+ <div id="search">
46
+
47
+ <a id="class_list_link" href="#">Class List</a>
48
+
49
+ <a id="method_list_link" href="#">Method List</a>
50
+
51
+ <a id="file_list_link" href="#">File List</a>
52
+
53
+ </div>
54
+ <div class="clear"></div>
55
+ </div>
56
+
57
+ <iframe id="search_frame"></iframe>
58
+
59
+ <div id="content"><h1>Top Level Namespace
60
+
61
+
62
+
63
+ </h1>
64
+
65
+ <dl class="box">
66
+
67
+
68
+
69
+
70
+
71
+
72
+
73
+
74
+ </dl>
75
+ <div class="clear"></div>
76
+
77
+ <h2>Defined Under Namespace</h2>
78
+ <p class="children">
79
+
80
+
81
+
82
+
83
+ <strong class="classes">Classes:</strong> <span class='object_link'><a href="AutoShop.html" title="AutoShop (class)">AutoShop</a></span>, <span class='object_link'><a href="Car.html" title="Car (class)">Car</a></span>, <span class='object_link'><a href="TrafficLight.html" title="TrafficLight (class)">TrafficLight</a></span>, <span class='object_link'><a href="Vehicle.html" title="Vehicle (class)">Vehicle</a></span>
84
+
85
+
86
+ </p>
87
+
88
+
89
+
90
+
91
+
92
+
93
+
94
+
95
+
96
+ </div>
97
+
98
+ <div id="footer">
99
+ Generated on Fri Feb 17 08:30:35 2012 by
100
+ <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
101
+ 0.7.5 (ruby-1.9.2).
102
+ </div>
103
+
104
+ </body>
105
+ </html>
@@ -1,11 +1,7 @@
1
1
  class CreateUsers < ActiveRecord::Migration
2
- def self.up
2
+ def change
3
3
  create_table :users do |t|
4
4
  t.string :name, :state, :access_state
5
5
  end
6
6
  end
7
-
8
- def self.down
9
- drop_table :users
10
- end
11
7
  end
@@ -0,0 +1,34 @@
1
+ <%= form_for(@user) do |f| %>
2
+ <% if @user.errors.any? %>
3
+ <div id="error_explanation">
4
+ <h2><%= pluralize(@user.errors.count, "error") %> prohibited this user from being saved:</h2>
5
+
6
+ <ul>
7
+ <% @user.errors.full_messages.each do |msg| %>
8
+ <li><%= msg %></li>
9
+ <% end %>
10
+ </ul>
11
+ </div>
12
+ <% end %>
13
+
14
+ <div class="field">
15
+ <%= f.label :name %><br />
16
+ <%= f.text_field :name %>
17
+ </div>
18
+
19
+ <% unless @user.new_record? %>
20
+ <div class="field">
21
+ <%= f.label :state %><br />
22
+ <%= f.collection_select :state_event, @user.state_transitions, :event, :human_to_name, :include_blank => @user.human_state_name %>
23
+ </div>
24
+
25
+ <div class="field">
26
+ <%= f.label :access_state %><br />
27
+ <%= f.collection_select :access_state_event, @user.access_state_transitions, :event, :human_event, :include_blank => "don't change" %>
28
+ </div>
29
+ <% end %>
30
+
31
+ <div class="actions">
32
+ <%= f.submit %>
33
+ </div>
34
+ <% end %>
@@ -1,25 +1,6 @@
1
- <h1>Editing User</h1>
1
+ <h1>Editing user</h1>
2
2
 
3
- <% form_for(@user) do |f| %>
4
- <%= f.error_messages %>
5
-
6
- <p>
7
- <%= f.label :name %><br />
8
- <%= f.text_field :name %>
9
- </p>
10
-
11
- <p>
12
- <%= f.label :state %><br />
13
- <%= f.collection_select :state_event, @user.state_transitions, :event, :human_to_name, :include_blank => @user.human_state_name %>
14
- </p>
15
-
16
- <p>
17
- <%= f.label :access_state %><br />
18
- <%= f.collection_select :access_state_event, @user.access_state_transitions, :event, :human_event, :include_blank => "don't change" %>
19
- </p>
20
-
21
- <p><%= f.submit 'Update' %></p>
22
- <% end %>
3
+ <%= render 'form' %>
23
4
 
24
5
  <%= link_to 'Show', @user %> |
25
6
  <%= link_to 'Back', users_path %>
@@ -1,17 +1,19 @@
1
- <h1>Listing Users</h1>
1
+ <h1>Listing users</h1>
2
2
 
3
3
  <table>
4
4
  <tr>
5
5
  <th>Name</th>
6
6
  <th>State</th>
7
7
  <th>Access State</th>
8
+ <th></th>
9
+ <th></th>
8
10
  </tr>
9
11
 
10
12
  <% @users.each do |user| %>
11
13
  <tr>
12
- <td><%=h user.name %></td>
13
- <td><%=h user.human_state_name %></td>
14
- <td><%=h user.human_access_state_name %></td>
14
+ <td><%= user.name %></td>
15
+ <td><%= user.human_state_name %></td>
16
+ <td><%= user.human_access_state_name %></td>
15
17
  <td><%= link_to 'Show', user %></td>
16
18
  <td><%= link_to 'Edit', edit_user_path(user) %></td>
17
19
  </tr>
@@ -1,14 +1,5 @@
1
- <h1>New User</h1>
1
+ <h1>New user</h1>
2
2
 
3
- <% form_for @user do |f| %>
4
- <%= f.error_messages %>
5
-
6
- <p>
7
- <%= f.label :name %><br />
8
- <%= f.text_field :name %>
9
- </p>
10
-
11
- <p><%= f.submit 'Create' %></p>
12
- <% end %>
3
+ <%= render 'form' %>
13
4
 
14
5
  <%= link_to 'Back', users_path %>
@@ -1,16 +1,18 @@
1
+ <p id="notice"><%= notice %></p>
2
+
1
3
  <p>
2
4
  <b>Name:</b>
3
- <%=h @user.name %>
5
+ <%= @user.name %>
4
6
  </p>
5
7
 
6
8
  <p>
7
9
  <b>State:</b>
8
- <%=h @user.human_state_name %>
10
+ <%= @user.human_state_name %>
9
11
  </p>
10
12
 
11
13
  <p>
12
14
  <b>Access State:</b>
13
- <%=h @user.human_access_state_name %>
15
+ <%= @user.human_access_state_name %>
14
16
  </p>
15
17
 
16
18
  <%= link_to 'Edit', edit_user_path(@user) %> |
@@ -1,3 +1,5 @@
1
+ require 'state_machine'
2
+
1
3
  class TrafficLight
2
4
  state_machine :initial => :stop do
3
5
  event :cycle do
@@ -1,3 +1,5 @@
1
+ require 'state_machine'
2
+
1
3
  class Vehicle
2
4
  state_machine :initial => :parked do
3
5
  event :park do
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: /home/aaron/Projects/Personal/pluginaweek/state_machine
3
3
  specs:
4
- state_machine (1.1.2)
4
+ state_machine (1.2.0)
5
5
 
6
6
  GEM
7
7
  remote: http://www.rubygems.org/
@@ -11,14 +11,17 @@ GEM
11
11
  builder (~> 2.1.2)
12
12
  i18n (~> 0.4.1)
13
13
  activesupport (3.0.0)
14
- appraisal (0.4.0)
14
+ appraisal (0.4.1)
15
15
  bundler
16
16
  rake
17
17
  builder (2.1.2)
18
18
  i18n (0.4.2)
19
- rake (0.9.2.2)
20
- rcov (0.9.11)
21
- rcov (0.9.11-java)
19
+ multi_json (1.6.1)
20
+ rake (10.0.3)
21
+ simplecov (0.7.1)
22
+ multi_json (~> 1.0)
23
+ simplecov-html (~> 0.7.1)
24
+ simplecov-html (0.7.1)
22
25
 
23
26
  PLATFORMS
24
27
  java
@@ -28,5 +31,5 @@ DEPENDENCIES
28
31
  activemodel (= 3.0.0)
29
32
  appraisal (~> 0.4.0)
30
33
  rake
31
- rcov
34
+ simplecov
32
35
  state_machine!
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: /home/aaron/Projects/Personal/pluginaweek/state_machine
3
3
  specs:
4
- state_machine (1.1.2)
4
+ state_machine (1.2.0)
5
5
 
6
6
  GEM
7
7
  remote: http://www.rubygems.org/
@@ -11,14 +11,17 @@ GEM
11
11
  builder (~> 2.1.2)
12
12
  i18n (~> 0.4)
13
13
  activesupport (3.0.5)
14
- appraisal (0.4.0)
14
+ appraisal (0.4.1)
15
15
  bundler
16
16
  rake
17
17
  builder (2.1.2)
18
- i18n (0.6.0)
19
- rake (0.9.2.2)
20
- rcov (0.9.11)
21
- rcov (0.9.11-java)
18
+ i18n (0.6.1)
19
+ multi_json (1.6.1)
20
+ rake (10.0.3)
21
+ simplecov (0.7.1)
22
+ multi_json (~> 1.0)
23
+ simplecov-html (~> 0.7.1)
24
+ simplecov-html (0.7.1)
22
25
 
23
26
  PLATFORMS
24
27
  java
@@ -28,5 +31,5 @@ DEPENDENCIES
28
31
  activemodel (= 3.0.5)
29
32
  appraisal (~> 0.4.0)
30
33
  rake
31
- rcov
34
+ simplecov
32
35
  state_machine!
@@ -1,7 +1,7 @@
1
1
  PATH
2
- remote: /home/aaron/Projects/Vendor/state_machine
2
+ remote: /home/aaron/Projects/Personal/pluginaweek/state_machine
3
3
  specs:
4
- state_machine (1.1.2)
4
+ state_machine (1.2.0)
5
5
 
6
6
  GEM
7
7
  remote: http://www.rubygems.org/
@@ -12,15 +12,17 @@ GEM
12
12
  i18n (~> 0.6)
13
13
  activesupport (3.1.1)
14
14
  multi_json (~> 1.0)
15
- appraisal (0.4.0)
15
+ appraisal (0.4.1)
16
16
  bundler
17
17
  rake
18
- builder (3.0.0)
19
- i18n (0.6.0)
20
- multi_json (1.0.3)
21
- rake (0.9.2.2)
22
- rcov (0.9.11)
23
- rcov (0.9.11-java)
18
+ builder (3.0.4)
19
+ i18n (0.6.1)
20
+ multi_json (1.6.1)
21
+ rake (10.0.3)
22
+ simplecov (0.7.1)
23
+ multi_json (~> 1.0)
24
+ simplecov-html (~> 0.7.1)
25
+ simplecov-html (0.7.1)
24
26
 
25
27
  PLATFORMS
26
28
  java
@@ -30,5 +32,5 @@ DEPENDENCIES
30
32
  activemodel (= 3.1.1)
31
33
  appraisal (~> 0.4.0)
32
34
  rake
33
- rcov
35
+ simplecov
34
36
  state_machine!
@@ -2,6 +2,6 @@
2
2
 
3
3
  source "http://www.rubygems.org"
4
4
 
5
- gem "activemodel", "3.2.0"
5
+ gem "activemodel", "3.2.1"
6
6
 
7
7
  gemspec :path=>"../"
@@ -2,6 +2,6 @@
2
2
 
3
3
  source "http://www.rubygems.org"
4
4
 
5
- gem "ruby-graphviz", "0.9.0"
5
+ gem "activemodel", "3.2.12"
6
6
 
7
7
  gemspec :path=>"../"
@@ -0,0 +1,36 @@
1
+ PATH
2
+ remote: /home/aaron/Projects/Personal/pluginaweek/state_machine
3
+ specs:
4
+ state_machine (1.2.0)
5
+
6
+ GEM
7
+ remote: http://www.rubygems.org/
8
+ specs:
9
+ activemodel (3.2.12)
10
+ activesupport (= 3.2.12)
11
+ builder (~> 3.0.0)
12
+ activesupport (3.2.12)
13
+ i18n (~> 0.6)
14
+ multi_json (~> 1.0)
15
+ appraisal (0.4.1)
16
+ bundler
17
+ rake
18
+ builder (3.0.4)
19
+ i18n (0.6.1)
20
+ multi_json (1.6.1)
21
+ rake (10.0.3)
22
+ simplecov (0.7.1)
23
+ multi_json (~> 1.0)
24
+ simplecov-html (~> 0.7.1)
25
+ simplecov-html (0.7.1)
26
+
27
+ PLATFORMS
28
+ java
29
+ ruby
30
+
31
+ DEPENDENCIES
32
+ activemodel (= 3.2.12)
33
+ appraisal (~> 0.4.0)
34
+ rake
35
+ simplecov
36
+ state_machine!
@@ -2,7 +2,6 @@
2
2
 
3
3
  source "http://www.rubygems.org"
4
4
 
5
- gem "sqlite3-ruby"
6
- gem "activerecord", "3.2.0"
5
+ gem "activemodel", "3.2.13.rc1"
7
6
 
8
7
  gemspec :path=>"../"
@@ -0,0 +1,36 @@
1
+ PATH
2
+ remote: /home/aaron/Projects/Personal/pluginaweek/state_machine
3
+ specs:
4
+ state_machine (1.2.0)
5
+
6
+ GEM
7
+ remote: http://www.rubygems.org/
8
+ specs:
9
+ activemodel (3.2.13.rc1)
10
+ activesupport (= 3.2.13.rc1)
11
+ builder (~> 3.0.0)
12
+ activesupport (3.2.13.rc1)
13
+ i18n (= 0.6.1)
14
+ multi_json (~> 1.0)
15
+ appraisal (0.4.1)
16
+ bundler
17
+ rake
18
+ builder (3.0.4)
19
+ i18n (0.6.1)
20
+ multi_json (1.6.1)
21
+ rake (10.0.3)
22
+ simplecov (0.7.1)
23
+ multi_json (~> 1.0)
24
+ simplecov-html (~> 0.7.1)
25
+ simplecov-html (0.7.1)
26
+
27
+ PLATFORMS
28
+ java
29
+ ruby
30
+
31
+ DEPENDENCIES
32
+ activemodel (= 3.2.13.rc1)
33
+ appraisal (~> 0.4.0)
34
+ rake
35
+ simplecov
36
+ state_machine!