stateflow 0.4.1 → 0.4.2
Sign up to get free protection for your applications and to get access to all the features.
- data/CHANGELOG.rdoc +4 -0
- data/Rakefile +1 -1
- data/lib/stateflow/machine.rb +2 -2
- data/lib/stateflow/persistence/active_record.rb +5 -5
- data/lib/stateflow/persistence/mongo_mapper.rb +5 -5
- data/lib/stateflow/persistence/mongoid.rb +4 -4
- data/lib/stateflow/state.rb +1 -1
- data/lib/stateflow/transition.rb +2 -1
- data/stateflow.gemspec +3 -4
- metadata +4 -27
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.4.
|
5
|
+
Echoe.new('stateflow', '0.4.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/machine.rb
CHANGED
@@ -10,16 +10,16 @@ module Stateflow
|
|
10
10
|
|
11
11
|
module InstanceMethods
|
12
12
|
def load_from_persistence
|
13
|
-
|
13
|
+
send machine.state_column.to_sym
|
14
14
|
end
|
15
15
|
|
16
|
-
def save_to_persistence(new_state, options)
|
17
|
-
|
18
|
-
|
16
|
+
def save_to_persistence(new_state, options = {})
|
17
|
+
send("#{machine.state_column}=".to_sym, new_state)
|
18
|
+
save if options[:save]
|
19
19
|
end
|
20
20
|
|
21
21
|
def ensure_initial_state
|
22
|
-
send("#{
|
22
|
+
send("#{machine.state_column.to_s}=", current_state.name.to_s) if send(machine.state_column.to_s).blank?
|
23
23
|
end
|
24
24
|
end
|
25
25
|
end
|
@@ -10,16 +10,16 @@ module Stateflow
|
|
10
10
|
|
11
11
|
module InstanceMethods
|
12
12
|
def load_from_persistence
|
13
|
-
|
13
|
+
send machine.state_column.to_sym
|
14
14
|
end
|
15
15
|
|
16
|
-
def save_to_persistence(new_state, options)
|
17
|
-
|
18
|
-
|
16
|
+
def save_to_persistence(new_state, options = {})
|
17
|
+
send("#{machine.state_column}=".to_sym, new_state)
|
18
|
+
save if options[:save]
|
19
19
|
end
|
20
20
|
|
21
21
|
def ensure_initial_state
|
22
|
-
send("#{
|
22
|
+
send("#{machine.state_column.to_s}=", current_state.name.to_s) if send(machine.state_column.to_s).blank?
|
23
23
|
end
|
24
24
|
end
|
25
25
|
end
|
@@ -10,16 +10,16 @@ module Stateflow
|
|
10
10
|
|
11
11
|
module InstanceMethods
|
12
12
|
def load_from_persistence
|
13
|
-
|
13
|
+
send machine.state_column.to_sym
|
14
14
|
end
|
15
15
|
|
16
16
|
def save_to_persistence(new_state, options = {})
|
17
|
-
|
18
|
-
|
17
|
+
send("#{machine.state_column}=".to_sym, new_state)
|
18
|
+
save if options[:save]
|
19
19
|
end
|
20
20
|
|
21
21
|
def ensure_initial_state
|
22
|
-
send("#{
|
22
|
+
send("#{machine.state_column.to_s}=", current_state.name.to_s) if send(machine.state_column.to_s).blank?
|
23
23
|
end
|
24
24
|
end
|
25
25
|
end
|
data/lib/stateflow/state.rb
CHANGED
data/lib/stateflow/transition.rb
CHANGED
@@ -22,7 +22,8 @@ module Stateflow
|
|
22
22
|
|
23
23
|
to = execute_action(@decide, base)
|
24
24
|
|
25
|
-
|
25
|
+
raise NoStateFound.new("Decision did not return a state that was set in the 'to' argument") unless @to.include?(to)
|
26
|
+
to
|
26
27
|
end
|
27
28
|
|
28
29
|
private
|
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.4.
|
5
|
+
s.version = "0.4.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{2011-
|
9
|
+
s.date = %q{2011-04-07}
|
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"]
|
@@ -15,11 +15,10 @@ Gem::Specification.new do |s|
|
|
15
15
|
s.rdoc_options = ["--line-numbers", "--inline-source", "--title", "Stateflow", "--main", "README.rdoc"]
|
16
16
|
s.require_paths = ["lib"]
|
17
17
|
s.rubyforge_project = %q{stateflow}
|
18
|
-
s.rubygems_version = %q{1.
|
18
|
+
s.rubygems_version = %q{1.6.2}
|
19
19
|
s.summary = %q{State machine that allows dynamic transitions for business workflows}
|
20
20
|
|
21
21
|
if s.respond_to? :specification_version then
|
22
|
-
current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
|
23
22
|
s.specification_version = 3
|
24
23
|
|
25
24
|
if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
|
metadata
CHANGED
@@ -1,12 +1,8 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: stateflow
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
prerelease:
|
5
|
-
|
6
|
-
- 0
|
7
|
-
- 4
|
8
|
-
- 1
|
9
|
-
version: 0.4.1
|
4
|
+
prerelease:
|
5
|
+
version: 0.4.2
|
10
6
|
platform: ruby
|
11
7
|
authors:
|
12
8
|
- Ryan Oberholzer
|
@@ -14,7 +10,7 @@ autorequire:
|
|
14
10
|
bindir: bin
|
15
11
|
cert_chain: []
|
16
12
|
|
17
|
-
date: 2011-
|
13
|
+
date: 2011-04-07 00:00:00 +02:00
|
18
14
|
default_executable:
|
19
15
|
dependencies:
|
20
16
|
- !ruby/object:Gem::Dependency
|
@@ -25,10 +21,6 @@ dependencies:
|
|
25
21
|
requirements:
|
26
22
|
- - ">="
|
27
23
|
- !ruby/object:Gem::Version
|
28
|
-
segments:
|
29
|
-
- 2
|
30
|
-
- 0
|
31
|
-
- 0
|
32
24
|
version: 2.0.0
|
33
25
|
type: :development
|
34
26
|
version_requirements: *id001
|
@@ -40,8 +32,6 @@ dependencies:
|
|
40
32
|
requirements:
|
41
33
|
- - ">="
|
42
34
|
- !ruby/object:Gem::Version
|
43
|
-
segments:
|
44
|
-
- 0
|
45
35
|
version: "0"
|
46
36
|
type: :development
|
47
37
|
version_requirements: *id002
|
@@ -53,12 +43,6 @@ dependencies:
|
|
53
43
|
requirements:
|
54
44
|
- - ">="
|
55
45
|
- !ruby/object:Gem::Version
|
56
|
-
segments:
|
57
|
-
- 2
|
58
|
-
- 0
|
59
|
-
- 0
|
60
|
-
- beta
|
61
|
-
- 20
|
62
46
|
version: 2.0.0.beta.20
|
63
47
|
type: :development
|
64
48
|
version_requirements: *id003
|
@@ -70,8 +54,6 @@ dependencies:
|
|
70
54
|
requirements:
|
71
55
|
- - ">="
|
72
56
|
- !ruby/object:Gem::Version
|
73
|
-
segments:
|
74
|
-
- 0
|
75
57
|
version: "0"
|
76
58
|
type: :development
|
77
59
|
version_requirements: *id004
|
@@ -141,22 +123,17 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
141
123
|
requirements:
|
142
124
|
- - ">="
|
143
125
|
- !ruby/object:Gem::Version
|
144
|
-
segments:
|
145
|
-
- 0
|
146
126
|
version: "0"
|
147
127
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
148
128
|
none: false
|
149
129
|
requirements:
|
150
130
|
- - ">="
|
151
131
|
- !ruby/object:Gem::Version
|
152
|
-
segments:
|
153
|
-
- 1
|
154
|
-
- 2
|
155
132
|
version: "1.2"
|
156
133
|
requirements: []
|
157
134
|
|
158
135
|
rubyforge_project: stateflow
|
159
|
-
rubygems_version: 1.
|
136
|
+
rubygems_version: 1.6.2
|
160
137
|
signing_key:
|
161
138
|
specification_version: 3
|
162
139
|
summary: State machine that allows dynamic transitions for business workflows
|