simple_state_machine 0.3.0 → 0.3.1
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/README.rdoc +1 -3
- data/VERSION +1 -1
- data/simple_state_machine.gemspec +2 -2
- metadata +4 -4
data/README.rdoc
CHANGED
@@ -3,7 +3,6 @@
|
|
3
3
|
A simple DSL to decorate existing methods with state transition guards.
|
4
4
|
|
5
5
|
SimpleStateMachine helps you to encapsulate state and guard state transitions.
|
6
|
-
Adding state transitions to a method is trivial.
|
7
6
|
|
8
7
|
Instead of using a DSL to define events, SimpleStateMachine decorates existing methods with logic that guards
|
9
8
|
state transitions.
|
@@ -19,9 +18,8 @@ state transitions.
|
|
19
18
|
|
20
19
|
|
21
20
|
Decorating methods has a couple of advantages:
|
22
|
-
- No need for defining
|
21
|
+
- No need for defining callbacks or other methods to add logic
|
23
22
|
- Arguments can be passed to events
|
24
|
-
- State transitions are encapsulated. No need for :guards
|
25
23
|
- Validation errors can be set on the model if you are using ActiveRecord / ActiveModel
|
26
24
|
|
27
25
|
== Example
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.3.
|
1
|
+
0.3.1
|
@@ -5,11 +5,11 @@
|
|
5
5
|
|
6
6
|
Gem::Specification.new do |s|
|
7
7
|
s.name = %q{simple_state_machine}
|
8
|
-
s.version = "0.3.
|
8
|
+
s.version = "0.3.1"
|
9
9
|
|
10
10
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
11
|
s.authors = ["Marek de Heus", "Petrik de Heus"]
|
12
|
-
s.date = %q{2010-08-
|
12
|
+
s.date = %q{2010-08-30}
|
13
13
|
s.description = %q{A simple DSL to decorate existing methods with logic that guards state transitions.}
|
14
14
|
s.email = ["FIX@example.com"]
|
15
15
|
s.extra_rdoc_files = [
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: simple_state_machine
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 17
|
5
5
|
prerelease: false
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 3
|
9
|
-
-
|
10
|
-
version: 0.3.
|
9
|
+
- 1
|
10
|
+
version: 0.3.1
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Marek de Heus
|
@@ -16,7 +16,7 @@ autorequire:
|
|
16
16
|
bindir: bin
|
17
17
|
cert_chain: []
|
18
18
|
|
19
|
-
date: 2010-08-
|
19
|
+
date: 2010-08-30 00:00:00 +02:00
|
20
20
|
default_executable:
|
21
21
|
dependencies:
|
22
22
|
- !ruby/object:Gem::Dependency
|