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 CHANGED
@@ -16,7 +16,7 @@ GEM
16
16
  binding_of_caller (0.6.7)
17
17
  builder (3.0.0)
18
18
  coderay (1.0.6)
19
- delayed_job (3.0.1)
19
+ delayed_job (3.0.3)
20
20
  activesupport (~> 3.0)
21
21
  delayed_job_active_record (0.3.2)
22
22
  activerecord (> 2.1.0)
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.2.6
1
+ 0.2.7
@@ -1,13 +1,31 @@
1
- module StateManager
2
- class Base
3
- yaml_as "tag:grouptalent.com,2012:StateManager"
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
- def self.yaml_new(klass, tag, val)
6
- klass.new(val['resource'], val['context'])
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
- def to_yaml_properties
10
- ['@resource', '@context']
26
+ def init_with(coder)
27
+ initialize(coder["resource"], coder["context"])
28
+ end
11
29
  end
12
30
  end
13
31
  end
@@ -5,11 +5,11 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = "state_manager"
8
- s.version = "0.2.6"
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-06-12"
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.6
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-06-12 00:00:00 Z
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: -3482260086007933081
209
+ hash: 29878923233174199
210
210
  segments:
211
211
  - 0
212
212
  version: "0"