stateflow 0.3.0 → 0.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/CHANGELOG.rdoc +6 -0
- data/Rakefile +1 -1
- data/examples/robot.rb +4 -4
- data/lib/stateflow/event.rb +2 -2
- data/stateflow.gemspec +2 -2
- metadata +4 -4
data/CHANGELOG.rdoc
CHANGED
@@ -1,3 +1,9 @@
|
|
1
|
+
= Version 0.4.0
|
2
|
+
* Changed the order of the hooks, now runs in the following order:
|
3
|
+
- Exit on previous state
|
4
|
+
- Enter on new state
|
5
|
+
- Save to persistence
|
6
|
+
|
1
7
|
= Version 0.3.0
|
2
8
|
* Added a non bang method for events (Check README)
|
3
9
|
* Added tests to persistence layers (About time!)
|
data/Rakefile
CHANGED
@@ -2,7 +2,7 @@ require 'rubygems'
|
|
2
2
|
require 'rake'
|
3
3
|
require 'echoe'
|
4
4
|
|
5
|
-
Echoe.new('stateflow', '0.
|
5
|
+
Echoe.new('stateflow', '0.4.0') do |p|
|
6
6
|
p.description = "State machine that allows dynamic transitions for business workflows"
|
7
7
|
p.url = "http://github.com/ryanza/stateflow"
|
8
8
|
p.author = "Ryan Oberholzer"
|
data/examples/robot.rb
CHANGED
@@ -3,16 +3,16 @@ require 'stateflow'
|
|
3
3
|
|
4
4
|
class Robot
|
5
5
|
include Stateflow
|
6
|
-
|
6
|
+
|
7
7
|
stateflow do
|
8
8
|
initial :green
|
9
|
-
|
9
|
+
|
10
10
|
state :green, :yellow, :red
|
11
|
-
|
11
|
+
|
12
12
|
event :change_color do
|
13
13
|
transitions :from => :green, :to => :yellow
|
14
14
|
transitions :from => :yellow, :to => :red
|
15
15
|
transitions :from => :red, :to => :green
|
16
16
|
end
|
17
17
|
end
|
18
|
-
end
|
18
|
+
end
|
data/lib/stateflow/event.rb
CHANGED
@@ -20,10 +20,10 @@ module Stateflow
|
|
20
20
|
raise NoStateFound.new("Invalid state #{transition.to.to_s} for transition.") if new_state.nil?
|
21
21
|
|
22
22
|
current_state.execute_action(:exit, klass)
|
23
|
-
klass.set_current_state(new_state, options)
|
24
|
-
|
25
23
|
klass._previous_state = current_state.name.to_s
|
26
24
|
new_state.execute_action(:enter, klass)
|
25
|
+
|
26
|
+
klass.set_current_state(new_state, options)
|
27
27
|
true
|
28
28
|
end
|
29
29
|
|
data/stateflow.gemspec
CHANGED
@@ -2,11 +2,11 @@
|
|
2
2
|
|
3
3
|
Gem::Specification.new do |s|
|
4
4
|
s.name = %q{stateflow}
|
5
|
-
s.version = "0.
|
5
|
+
s.version = "0.4.0"
|
6
6
|
|
7
7
|
s.required_rubygems_version = Gem::Requirement.new(">= 1.2") if s.respond_to? :required_rubygems_version=
|
8
8
|
s.authors = ["Ryan Oberholzer"]
|
9
|
-
s.date = %q{2010-12-
|
9
|
+
s.date = %q{2010-12-09}
|
10
10
|
s.description = %q{State machine that allows dynamic transitions for business workflows}
|
11
11
|
s.email = %q{ryan@platform45.com}
|
12
12
|
s.extra_rdoc_files = ["CHANGELOG.rdoc", "README.rdoc", "lib/stateflow.rb", "lib/stateflow/event.rb", "lib/stateflow/exception.rb", "lib/stateflow/machine.rb", "lib/stateflow/persistence.rb", "lib/stateflow/persistence/active_record.rb", "lib/stateflow/persistence/mongo_mapper.rb", "lib/stateflow/persistence/mongoid.rb", "lib/stateflow/persistence/none.rb", "lib/stateflow/state.rb", "lib/stateflow/transition.rb"]
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: stateflow
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 15
|
5
5
|
prerelease: false
|
6
6
|
segments:
|
7
7
|
- 0
|
8
|
-
-
|
8
|
+
- 4
|
9
9
|
- 0
|
10
|
-
version: 0.
|
10
|
+
version: 0.4.0
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Ryan Oberholzer
|
@@ -15,7 +15,7 @@ autorequire:
|
|
15
15
|
bindir: bin
|
16
16
|
cert_chain: []
|
17
17
|
|
18
|
-
date: 2010-12-
|
18
|
+
date: 2010-12-09 00:00:00 +02:00
|
19
19
|
default_executable:
|
20
20
|
dependencies:
|
21
21
|
- !ruby/object:Gem::Dependency
|