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.
- data/.gitignore +7 -11
- data/.travis.yml +49 -7
- data/Appraisals +255 -87
- data/CHANGELOG.md +30 -0
- data/README.md +142 -21
- data/Rakefile +1 -11
- data/examples/Gemfile +5 -0
- data/examples/Gemfile.lock +14 -0
- data/examples/auto_shop.rb +2 -0
- data/examples/car.rb +2 -0
- data/examples/doc/AutoShop.html +2856 -0
- data/examples/doc/AutoShop_state.png +0 -0
- data/examples/doc/Car.html +919 -0
- data/examples/doc/Car_state.png +0 -0
- data/examples/doc/TrafficLight.html +2230 -0
- data/examples/doc/TrafficLight_state.png +0 -0
- data/examples/doc/Vehicle.html +7921 -0
- data/examples/doc/Vehicle_state.png +0 -0
- data/examples/doc/_index.html +136 -0
- data/examples/doc/class_list.html +47 -0
- data/examples/doc/css/common.css +1 -0
- data/examples/doc/css/full_list.css +55 -0
- data/examples/doc/css/style.css +322 -0
- data/examples/doc/file_list.html +46 -0
- data/examples/doc/frames.html +13 -0
- data/examples/doc/index.html +136 -0
- data/examples/doc/js/app.js +205 -0
- data/examples/doc/js/full_list.js +173 -0
- data/examples/doc/js/jquery.js +16 -0
- data/examples/doc/method_list.html +734 -0
- data/examples/doc/top-level-namespace.html +105 -0
- data/examples/rails-rest/migration.rb +1 -5
- data/examples/rails-rest/view__form.html.erb +34 -0
- data/examples/rails-rest/view_edit.html.erb +2 -21
- data/examples/rails-rest/view_index.html.erb +6 -4
- data/examples/rails-rest/view_new.html.erb +2 -11
- data/examples/rails-rest/view_show.html.erb +5 -3
- data/examples/traffic_light.rb +2 -0
- data/examples/vehicle.rb +2 -0
- data/gemfiles/active_model-3.0.0.gemfile.lock +9 -6
- data/gemfiles/active_model-3.0.5.gemfile.lock +10 -7
- data/gemfiles/active_model-3.1.1.gemfile.lock +12 -10
- data/gemfiles/{active_model-3.2.0.gemfile → active_model-3.2.1.gemfile} +1 -1
- data/gemfiles/{graphviz-0.9.0.gemfile → active_model-3.2.12.gemfile} +1 -1
- data/gemfiles/active_model-3.2.12.gemfile.lock +36 -0
- data/gemfiles/{active_record-3.2.0.gemfile → active_model-3.2.13.rc1.gemfile} +1 -2
- data/gemfiles/active_model-3.2.13.rc1.gemfile.lock +36 -0
- data/gemfiles/active_model-4.0.0.gemfile +9 -0
- data/gemfiles/active_model-4.0.0.gemfile.lock +78 -0
- data/gemfiles/active_record-2.0.0.gemfile +2 -1
- data/gemfiles/active_record-2.0.0.gemfile.lock +15 -6
- data/gemfiles/active_record-2.0.5.gemfile +2 -1
- data/gemfiles/active_record-2.0.5.gemfile.lock +15 -6
- data/gemfiles/active_record-2.1.0.gemfile +2 -1
- data/gemfiles/active_record-2.1.0.gemfile.lock +15 -6
- data/gemfiles/active_record-2.1.2.gemfile +2 -1
- data/gemfiles/active_record-2.1.2.gemfile.lock +15 -6
- data/gemfiles/active_record-2.2.3.gemfile +2 -1
- data/gemfiles/active_record-2.2.3.gemfile.lock +15 -6
- data/gemfiles/active_record-2.3.12.gemfile +2 -1
- data/gemfiles/active_record-2.3.12.gemfile.lock +15 -6
- data/gemfiles/active_record-2.3.5.gemfile +9 -0
- data/gemfiles/active_record-2.3.5.gemfile.lock +39 -0
- data/gemfiles/active_record-3.0.0.gemfile +2 -1
- data/gemfiles/active_record-3.0.0.gemfile.lock +18 -11
- data/gemfiles/active_record-3.0.5.gemfile +2 -1
- data/gemfiles/active_record-3.0.5.gemfile.lock +19 -12
- data/gemfiles/active_record-3.1.1.gemfile +2 -1
- data/gemfiles/active_record-3.1.1.gemfile.lock +22 -16
- data/gemfiles/active_record-3.2.12.gemfile +9 -0
- data/gemfiles/active_record-3.2.12.gemfile.lock +51 -0
- data/gemfiles/active_record-3.2.13.rc1.gemfile +9 -0
- data/gemfiles/active_record-3.2.13.rc1.gemfile.lock +51 -0
- data/gemfiles/active_record-4.0.0.gemfile +11 -0
- data/gemfiles/active_record-4.0.0.gemfile.lock +83 -0
- data/gemfiles/data_mapper-0.10.2.gemfile +1 -0
- data/gemfiles/data_mapper-0.10.2.gemfile.lock +13 -9
- data/gemfiles/data_mapper-0.9.11.gemfile +1 -0
- data/gemfiles/data_mapper-0.9.11.gemfile.lock +31 -7
- data/gemfiles/data_mapper-0.9.4.gemfile.lock +25 -14
- data/gemfiles/data_mapper-0.9.7.gemfile +1 -0
- data/gemfiles/data_mapper-0.9.7.gemfile.lock +27 -15
- data/gemfiles/data_mapper-1.0.0.gemfile.lock +20 -17
- data/gemfiles/data_mapper-1.0.1.gemfile.lock +20 -17
- data/gemfiles/data_mapper-1.0.2.gemfile.lock +20 -17
- data/gemfiles/data_mapper-1.1.0.gemfile.lock +19 -16
- data/gemfiles/data_mapper-1.2.0.gemfile.lock +19 -16
- data/gemfiles/default.gemfile.lock +8 -5
- data/gemfiles/graphviz-0.9.17.gemfile +7 -0
- data/gemfiles/graphviz-0.9.17.gemfile.lock +29 -0
- data/gemfiles/graphviz-0.9.21.gemfile.lock +7 -4
- data/gemfiles/graphviz-1.0.0.gemfile.lock +7 -4
- data/gemfiles/graphviz-1.0.3.gemfile +7 -0
- data/gemfiles/graphviz-1.0.3.gemfile.lock +29 -0
- data/gemfiles/graphviz-1.0.8.gemfile +7 -0
- data/gemfiles/graphviz-1.0.8.gemfile.lock +29 -0
- data/gemfiles/mongo_mapper-0.10.0.gemfile +1 -0
- data/gemfiles/mongo_mapper-0.10.0.gemfile.lock +14 -11
- data/gemfiles/mongo_mapper-0.11.1.gemfile +7 -0
- data/gemfiles/mongo_mapper-0.11.1.gemfile.lock +44 -0
- data/gemfiles/mongo_mapper-0.11.2.gemfile +9 -0
- data/gemfiles/mongo_mapper-0.11.2.gemfile.lock +48 -0
- data/gemfiles/mongo_mapper-0.12.0.gemfile +9 -0
- data/gemfiles/mongo_mapper-0.12.0.gemfile.lock +48 -0
- data/gemfiles/mongo_mapper-0.5.5.gemfile.lock +7 -4
- data/gemfiles/mongo_mapper-0.5.8.gemfile.lock +7 -4
- data/gemfiles/mongo_mapper-0.6.0.gemfile.lock +7 -4
- data/gemfiles/mongo_mapper-0.6.10.gemfile.lock +7 -4
- data/gemfiles/mongo_mapper-0.7.0.gemfile.lock +7 -4
- data/gemfiles/mongo_mapper-0.7.5.gemfile.lock +7 -4
- data/gemfiles/mongo_mapper-0.8.0.gemfile.lock +7 -4
- data/gemfiles/mongo_mapper-0.8.3.gemfile.lock +7 -4
- data/gemfiles/mongo_mapper-0.8.4.gemfile.lock +7 -4
- data/gemfiles/mongo_mapper-0.8.6.gemfile.lock +7 -4
- data/gemfiles/mongo_mapper-0.9.0.gemfile.lock +7 -4
- data/gemfiles/mongoid-2.0.0.gemfile +2 -0
- data/gemfiles/mongoid-2.0.0.gemfile.lock +22 -18
- data/gemfiles/mongoid-2.1.4.gemfile +2 -0
- data/gemfiles/mongoid-2.1.4.gemfile.lock +21 -17
- data/gemfiles/mongoid-2.2.4.gemfile +2 -0
- data/gemfiles/mongoid-2.2.4.gemfile.lock +21 -17
- data/gemfiles/mongoid-2.3.3.gemfile +2 -0
- data/gemfiles/mongoid-2.3.3.gemfile.lock +21 -17
- data/gemfiles/mongoid-2.4.0.gemfile +9 -0
- data/gemfiles/mongoid-2.4.0.gemfile.lock +47 -0
- data/gemfiles/mongoid-2.4.10.gemfile +9 -0
- data/gemfiles/mongoid-2.4.10.gemfile.lock +47 -0
- data/gemfiles/mongoid-2.5.2.gemfile +9 -0
- data/gemfiles/mongoid-2.5.2.gemfile.lock +47 -0
- data/gemfiles/mongoid-2.6.0.gemfile +9 -0
- data/gemfiles/mongoid-2.6.0.gemfile.lock +47 -0
- data/gemfiles/mongoid-3.0.0.gemfile +8 -0
- data/gemfiles/mongoid-3.0.0.gemfile.lock +45 -0
- data/gemfiles/mongoid-3.0.22.gemfile +8 -0
- data/gemfiles/mongoid-3.0.22.gemfile.lock +45 -0
- data/gemfiles/mongoid-3.1.0.gemfile +8 -0
- data/gemfiles/mongoid-3.1.0.gemfile.lock +45 -0
- data/gemfiles/sequel-2.11.0.gemfile +2 -1
- data/gemfiles/sequel-2.11.0.gemfile.lock +11 -6
- data/gemfiles/sequel-2.12.0.gemfile +2 -1
- data/gemfiles/sequel-2.12.0.gemfile.lock +11 -6
- data/gemfiles/sequel-2.8.0.gemfile +2 -1
- data/gemfiles/sequel-2.8.0.gemfile.lock +11 -6
- data/gemfiles/sequel-3.0.0.gemfile +2 -1
- data/gemfiles/sequel-3.0.0.gemfile.lock +11 -6
- data/gemfiles/sequel-3.10.0.gemfile +9 -0
- data/gemfiles/sequel-3.10.0.gemfile.lock +33 -0
- data/gemfiles/sequel-3.13.0.gemfile +2 -1
- data/gemfiles/sequel-3.13.0.gemfile.lock +11 -6
- data/gemfiles/sequel-3.14.0.gemfile +2 -1
- data/gemfiles/sequel-3.14.0.gemfile.lock +11 -6
- data/gemfiles/sequel-3.23.0.gemfile +2 -1
- data/gemfiles/sequel-3.23.0.gemfile.lock +11 -6
- data/gemfiles/sequel-3.24.0.gemfile +2 -1
- data/gemfiles/sequel-3.24.0.gemfile.lock +11 -6
- data/gemfiles/sequel-3.29.0.gemfile +2 -1
- data/gemfiles/sequel-3.29.0.gemfile.lock +11 -6
- data/gemfiles/sequel-3.34.0.gemfile +9 -0
- data/gemfiles/sequel-3.34.0.gemfile.lock +33 -0
- data/gemfiles/sequel-3.35.0.gemfile +9 -0
- data/gemfiles/sequel-3.35.0.gemfile.lock +33 -0
- data/gemfiles/sequel-3.4.0.gemfile +9 -0
- data/gemfiles/sequel-3.4.0.gemfile.lock +33 -0
- data/gemfiles/sequel-3.44.0.gemfile +9 -0
- data/gemfiles/sequel-3.44.0.gemfile.lock +33 -0
- data/lib/state_machine.rb +6 -0
- data/lib/state_machine/branch.rb +9 -8
- data/lib/state_machine/callback.rb +2 -2
- data/lib/state_machine/core.rb +10 -0
- data/lib/state_machine/core_ext.rb +1 -0
- data/lib/state_machine/eval_helpers.rb +5 -3
- data/lib/state_machine/event.rb +17 -6
- data/lib/state_machine/graph.rb +92 -0
- data/lib/state_machine/integrations.rb +13 -1
- data/lib/state_machine/integrations/active_model.rb +14 -20
- data/lib/state_machine/integrations/active_model/observer.rb +3 -3
- data/lib/state_machine/integrations/active_model/observer_update.rb +42 -0
- data/lib/state_machine/integrations/active_record.rb +52 -25
- data/lib/state_machine/integrations/active_record/locale.rb +1 -1
- data/lib/state_machine/integrations/active_record/versions.rb +1 -17
- data/lib/state_machine/integrations/base.rb +15 -6
- data/lib/state_machine/integrations/data_mapper.rb +98 -35
- data/lib/state_machine/integrations/data_mapper/versions.rb +46 -8
- data/lib/state_machine/integrations/mongo_mapper.rb +39 -12
- data/lib/state_machine/integrations/mongo_mapper/locale.rb +1 -1
- data/lib/state_machine/integrations/mongo_mapper/versions.rb +3 -20
- data/lib/state_machine/integrations/mongoid.rb +52 -14
- data/lib/state_machine/integrations/mongoid/locale.rb +1 -1
- data/lib/state_machine/integrations/mongoid/versions.rb +52 -26
- data/lib/state_machine/integrations/sequel.rb +82 -33
- data/lib/state_machine/integrations/sequel/versions.rb +19 -44
- data/lib/state_machine/machine.rb +99 -59
- data/lib/state_machine/machine_collection.rb +1 -2
- data/lib/state_machine/macro_methods.rb +29 -0
- data/lib/state_machine/node_collection.rb +1 -1
- data/lib/state_machine/state.rb +18 -10
- data/lib/state_machine/state_context.rb +2 -2
- data/lib/state_machine/transition.rb +8 -1
- data/lib/state_machine/transition_collection.rb +2 -1
- data/lib/state_machine/version.rb +1 -1
- data/lib/state_machine/yard.rb +8 -0
- data/lib/state_machine/yard/handlers.rb +12 -0
- data/lib/state_machine/yard/handlers/base.rb +32 -0
- data/lib/state_machine/yard/handlers/event.rb +25 -0
- data/lib/state_machine/yard/handlers/machine.rb +344 -0
- data/lib/state_machine/yard/handlers/state.rb +25 -0
- data/lib/state_machine/yard/handlers/transition.rb +47 -0
- data/lib/state_machine/yard/templates.rb +3 -0
- data/lib/state_machine/yard/templates/default/class/html/setup.rb +30 -0
- data/lib/state_machine/yard/templates/default/class/html/state_machines.erb +12 -0
- data/lib/tasks/state_machine.rb +2 -1
- data/lib/yard-state_machine.rb +2 -0
- data/state_machine.gemspec +4 -3
- data/test/files/switch.rb +4 -0
- data/test/test_helper.rb +5 -0
- data/test/unit/branch_test.rb +117 -36
- data/test/unit/callback_test.rb +5 -2
- data/test/unit/eval_helpers_test.rb +49 -1
- data/test/unit/event_collection_test.rb +3 -1
- data/test/unit/event_test.rb +182 -12
- data/test/unit/graph_test.rb +98 -0
- data/test/unit/integrations/active_model_test.rb +82 -12
- data/test/unit/integrations/active_record_test.rb +393 -37
- data/test/unit/integrations/base_test.rb +7 -2
- data/test/unit/integrations/data_mapper_test.rb +326 -72
- data/test/unit/integrations/mongo_mapper_test.rb +338 -44
- data/test/unit/integrations/mongoid_test.rb +606 -98
- data/test/unit/integrations/sequel_test.rb +429 -102
- data/test/unit/integrations_test.rb +28 -6
- data/test/unit/machine_collection_test.rb +6 -2
- data/test/unit/machine_test.rb +134 -82
- data/test/unit/node_collection_test.rb +2 -2
- data/test/unit/path_test.rb +1 -1
- data/test/unit/state_test.rb +65 -21
- data/test/unit/transition_collection_test.rb +43 -23
- data/test/unit/transition_test.rb +8 -2
- metadata +303 -221
- data/gemfiles/active_model-3.2.0.gemfile.lock +0 -32
- data/gemfiles/active_record-3.2.0.gemfile.lock +0 -43
- 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
|
+
— 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> »
|
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>
|
@@ -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
|
1
|
+
<h1>Editing user</h1>
|
2
2
|
|
3
|
-
|
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
|
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><%=
|
13
|
-
<td><%=
|
14
|
-
<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
|
1
|
+
<h1>New user</h1>
|
2
2
|
|
3
|
-
|
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
|
-
<%=
|
5
|
+
<%= @user.name %>
|
4
6
|
</p>
|
5
7
|
|
6
8
|
<p>
|
7
9
|
<b>State:</b>
|
8
|
-
<%=
|
10
|
+
<%= @user.human_state_name %>
|
9
11
|
</p>
|
10
12
|
|
11
13
|
<p>
|
12
14
|
<b>Access State:</b>
|
13
|
-
<%=
|
15
|
+
<%= @user.human_access_state_name %>
|
14
16
|
</p>
|
15
17
|
|
16
18
|
<%= link_to 'Edit', edit_user_path(@user) %> |
|
data/examples/traffic_light.rb
CHANGED
data/examples/vehicle.rb
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: /home/aaron/Projects/Personal/pluginaweek/state_machine
|
3
3
|
specs:
|
4
|
-
state_machine (1.
|
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.
|
14
|
+
appraisal (0.4.1)
|
15
15
|
bundler
|
16
16
|
rake
|
17
17
|
builder (2.1.2)
|
18
18
|
i18n (0.4.2)
|
19
|
-
|
20
|
-
|
21
|
-
|
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
|
-
|
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.
|
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.
|
14
|
+
appraisal (0.4.1)
|
15
15
|
bundler
|
16
16
|
rake
|
17
17
|
builder (2.1.2)
|
18
|
-
i18n (0.6.
|
19
|
-
|
20
|
-
|
21
|
-
|
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
|
-
|
34
|
+
simplecov
|
32
35
|
state_machine!
|
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
|
-
remote: /home/aaron/Projects/
|
2
|
+
remote: /home/aaron/Projects/Personal/pluginaweek/state_machine
|
3
3
|
specs:
|
4
|
-
state_machine (1.
|
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.
|
15
|
+
appraisal (0.4.1)
|
16
16
|
bundler
|
17
17
|
rake
|
18
|
-
builder (3.0.
|
19
|
-
i18n (0.6.
|
20
|
-
multi_json (1.
|
21
|
-
rake (0.
|
22
|
-
|
23
|
-
|
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
|
-
|
35
|
+
simplecov
|
34
36
|
state_machine!
|
@@ -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!
|
@@ -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!
|