state_manager 0.2.6 → 0.2.7
Sign up to get free protection for your applications and to get access to all the features.
- data/Gemfile.lock +1 -1
- data/VERSION +1 -1
- data/lib/state_manager/serialization.rb +25 -7
- data/state_manager.gemspec +2 -2
- metadata +3 -3
data/Gemfile.lock
CHANGED
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.2.
|
1
|
+
0.2.7
|
@@ -1,13 +1,31 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
1
|
+
require 'yaml'
|
2
|
+
if YAML.parser.class.name =~ /syck|yecht/i
|
3
|
+
module StateManager
|
4
|
+
class Base
|
5
|
+
yaml_as "tag:grouptalent.com,2012:StateManager"
|
4
6
|
|
5
|
-
|
6
|
-
|
7
|
+
def self.yaml_new(klass, tag, val)
|
8
|
+
klass.new(val['resource'], val['context'])
|
9
|
+
end
|
10
|
+
|
11
|
+
def to_yaml_properties
|
12
|
+
['@resource', '@context']
|
13
|
+
end
|
7
14
|
end
|
15
|
+
end
|
16
|
+
else
|
17
|
+
module StateManager
|
18
|
+
class Base
|
19
|
+
def encode_with(coder)
|
20
|
+
coder.map = {
|
21
|
+
"resource" => resource,
|
22
|
+
"context" => context
|
23
|
+
}
|
24
|
+
end
|
8
25
|
|
9
|
-
|
10
|
-
|
26
|
+
def init_with(coder)
|
27
|
+
initialize(coder["resource"], coder["context"])
|
28
|
+
end
|
11
29
|
end
|
12
30
|
end
|
13
31
|
end
|
data/state_manager.gemspec
CHANGED
@@ -5,11 +5,11 @@
|
|
5
5
|
|
6
6
|
Gem::Specification.new do |s|
|
7
7
|
s.name = "state_manager"
|
8
|
-
s.version = "0.2.
|
8
|
+
s.version = "0.2.7"
|
9
9
|
|
10
10
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
11
|
s.authors = ["Gordon Hempton"]
|
12
|
-
s.date = "2012-
|
12
|
+
s.date = "2012-07-03"
|
13
13
|
s.description = "Finite state machine implementation that keeps logic separate from model classes and supports sub-states."
|
14
14
|
s.email = "ghempton@gmail.com"
|
15
15
|
s.extra_rdoc_files = [
|
metadata
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
name: state_manager
|
3
3
|
version: !ruby/object:Gem::Version
|
4
4
|
prerelease:
|
5
|
-
version: 0.2.
|
5
|
+
version: 0.2.7
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
8
8
|
- Gordon Hempton
|
@@ -10,7 +10,7 @@ autorequire:
|
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
12
|
|
13
|
-
date: 2012-
|
13
|
+
date: 2012-07-03 00:00:00 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: activesupport
|
@@ -206,7 +206,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
206
206
|
requirements:
|
207
207
|
- - ">="
|
208
208
|
- !ruby/object:Gem::Version
|
209
|
-
hash:
|
209
|
+
hash: 29878923233174199
|
210
210
|
segments:
|
211
211
|
- 0
|
212
212
|
version: "0"
|