dm-is-state_machine 0.9.10 → 0.9.11
Sign up to get free protection for your applications and to get access to all the features.
- data/History.txt +5 -1
- data/README.markdown +6 -6
- data/Rakefile +1 -1
- data/lib/dm-is-state_machine.rb +1 -1
- data/lib/dm-is-state_machine/is/version.rb +1 -1
- data/spec/spec_helper.rb +1 -1
- data/tasks/spec.rb +1 -1
- metadata +4 -4
data/History.txt
CHANGED
data/README.markdown
CHANGED
@@ -45,7 +45,7 @@ Add this line to your init.rb:
|
|
45
45
|
transition :from => :red, :to => :green
|
46
46
|
end
|
47
47
|
end
|
48
|
-
|
48
|
+
|
49
49
|
def red_hook
|
50
50
|
# Do something
|
51
51
|
end
|
@@ -65,16 +65,16 @@ The above DSL (domain specific language) does these things "behind the scenes":
|
|
65
65
|
appropriate transition based on the current state and comparing it against
|
66
66
|
the various :from states. It will raise an error if you attempt to call
|
67
67
|
it with an invalid state (such as :broken, see above). After the method
|
68
|
-
runs successfully, the state machine will be left in the :to state.
|
69
|
-
|
68
|
+
runs successfully, the state machine will be left in the :to state.
|
69
|
+
|
70
70
|
### Explained with some code examples ###
|
71
71
|
|
72
72
|
# Somewhere in your controller, perhaps
|
73
73
|
light = TrafficLight.new
|
74
|
-
|
74
|
+
|
75
75
|
# Move to the next state
|
76
76
|
light.forward!
|
77
|
-
|
77
|
+
|
78
78
|
# Do something based on the current state
|
79
79
|
case light.color
|
80
80
|
when "green"
|
@@ -84,7 +84,7 @@ The above DSL (domain specific language) does these things "behind the scenes":
|
|
84
84
|
when "red"
|
85
85
|
# do something red-related
|
86
86
|
end
|
87
|
-
|
87
|
+
|
88
88
|
## Specific examples ##
|
89
89
|
|
90
90
|
We would also like to hear how *you* are using state machines in your code.
|
data/Rakefile
CHANGED
@@ -12,7 +12,7 @@ AUTHOR = 'David James'
|
|
12
12
|
EMAIL = 'djwonk [a] collectiveinsight [d] net'
|
13
13
|
GEM_NAME = 'dm-is-state_machine'
|
14
14
|
GEM_VERSION = DataMapper::Is::StateMachine::VERSION
|
15
|
-
GEM_DEPENDENCIES = [['dm-core',
|
15
|
+
GEM_DEPENDENCIES = [['dm-core', GEM_VERSION]]
|
16
16
|
GEM_CLEAN = %w[ log pkg coverage ]
|
17
17
|
GEM_EXTRAS = { :has_rdoc => true, :extra_rdoc_files => %w[ README.txt README.markdown LICENSE TODO History.txt] }
|
18
18
|
|
data/lib/dm-is-state_machine.rb
CHANGED
data/spec/spec_helper.rb
CHANGED
data/tasks/spec.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: dm-is-state_machine
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.9.
|
4
|
+
version: 0.9.11
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- David James
|
@@ -9,7 +9,7 @@ autorequire:
|
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
11
|
|
12
|
-
date: 2009-
|
12
|
+
date: 2009-03-29 00:00:00 -07:00
|
13
13
|
default_executable:
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
@@ -18,9 +18,9 @@ dependencies:
|
|
18
18
|
version_requirement:
|
19
19
|
version_requirements: !ruby/object:Gem::Requirement
|
20
20
|
requirements:
|
21
|
-
- -
|
21
|
+
- - "="
|
22
22
|
- !ruby/object:Gem::Version
|
23
|
-
version: 0.9.
|
23
|
+
version: 0.9.11
|
24
24
|
version:
|
25
25
|
description: DataMapper plugin for creating state machines
|
26
26
|
email:
|