stateflow 0.2.1 → 0.2.2
Sign up to get free protection for your applications and to get access to all the features.
- data/CHANGELOG.rdoc +3 -0
- data/Rakefile +1 -1
- data/lib/stateflow/event.rb +2 -0
- data/lib/stateflow/machine.rb +1 -1
- data/lib/stateflow.rb +2 -0
- data/spec/stateflow_spec.rb +25 -0
- data/stateflow.gemspec +2 -2
- metadata +4 -4
data/CHANGELOG.rdoc
CHANGED
data/Rakefile
CHANGED
@@ -2,7 +2,7 @@ require 'rubygems'
|
|
2
2
|
require 'rake'
|
3
3
|
require 'echoe'
|
4
4
|
|
5
|
-
Echoe.new('stateflow', '0.2.
|
5
|
+
Echoe.new('stateflow', '0.2.2') 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/lib/stateflow/event.rb
CHANGED
data/lib/stateflow/machine.rb
CHANGED
data/lib/stateflow.rb
CHANGED
data/spec/stateflow_spec.rb
CHANGED
@@ -110,6 +110,21 @@ class Priority
|
|
110
110
|
end
|
111
111
|
end
|
112
112
|
|
113
|
+
class Stater
|
114
|
+
include Stateflow
|
115
|
+
|
116
|
+
stateflow do
|
117
|
+
initial :bill
|
118
|
+
|
119
|
+
state :bob, :bill
|
120
|
+
|
121
|
+
event :lolcats do
|
122
|
+
transitions :from => :bill, :to => :bob
|
123
|
+
end
|
124
|
+
end
|
125
|
+
end
|
126
|
+
|
127
|
+
|
113
128
|
describe Stateflow do
|
114
129
|
describe "class methods" do
|
115
130
|
it "should respond to stateflow block to setup the intial stateflow" do
|
@@ -306,5 +321,15 @@ describe Stateflow do
|
|
306
321
|
priority.should be_high
|
307
322
|
end
|
308
323
|
end
|
324
|
+
|
325
|
+
describe "previous state" do
|
326
|
+
it "should display the previous state" do
|
327
|
+
stater = Stater.new
|
328
|
+
stater.lolcats!
|
329
|
+
|
330
|
+
stater._previous_state.should == "bill"
|
331
|
+
stater.current_state == "bob"
|
332
|
+
end
|
333
|
+
end
|
309
334
|
end
|
310
335
|
|
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.2.
|
5
|
+
s.version = "0.2.2"
|
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-10-
|
9
|
+
s.date = %q{2010-10-19}
|
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: 19
|
5
5
|
prerelease: false
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 2
|
9
|
-
-
|
10
|
-
version: 0.2.
|
9
|
+
- 2
|
10
|
+
version: 0.2.2
|
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-10-
|
18
|
+
date: 2010-10-19 00:00:00 +02:00
|
19
19
|
default_executable:
|
20
20
|
dependencies:
|
21
21
|
- !ruby/object:Gem::Dependency
|