state_manager 0.2.4 → 0.2.5
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/dsl.rb +3 -3
- data/state_manager.gemspec +2 -2
- data/test/plugins/delayed_job_test.rb +5 -0
- metadata +3 -3
data/Gemfile.lock
CHANGED
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.2.
|
1
|
+
0.2.5
|
data/lib/state_manager/dsl.rb
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
require 'active_support/
|
1
|
+
require 'active_support/all'
|
2
2
|
|
3
3
|
module StateManager
|
4
4
|
module DSL
|
@@ -8,9 +8,9 @@ module StateManager
|
|
8
8
|
def state(name, klass=nil, &block)
|
9
9
|
# If no base class is specified we look for a class inside the current
|
10
10
|
# state's class which has the same name as the state
|
11
|
-
const_name = name.
|
11
|
+
const_name = name.to_s.classify
|
12
12
|
klass ||= if const_defined?(const_name)
|
13
|
-
self.const_get(
|
13
|
+
self.const_get(const_name)
|
14
14
|
else
|
15
15
|
Class.new(StateManager::State)
|
16
16
|
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.5"
|
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
|
+
s.date = "2012-06-09"
|
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 = [
|
@@ -74,6 +74,11 @@ class DelayedJobTest < Test::Unit::TestCase
|
|
74
74
|
def time_warp(duration)
|
75
75
|
Timecop.travel(duration.from_now)
|
76
76
|
Delayed::Worker.new.work_off
|
77
|
+
|
78
|
+
# Check for any errors inside the delayed job
|
79
|
+
jobs = Delayed::Job.where('last_error IS NOT NULL')
|
80
|
+
error = jobs.last && jobs.last.last_error
|
81
|
+
raise "Delayed job error: #{error}" if error
|
77
82
|
end
|
78
83
|
|
79
84
|
def test_delayed_event
|
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.5
|
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-
|
13
|
+
date: 2012-06-09 00:00:00 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: activesupport
|
@@ -205,7 +205,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
205
205
|
requirements:
|
206
206
|
- - ">="
|
207
207
|
- !ruby/object:Gem::Version
|
208
|
-
hash:
|
208
|
+
hash: 696568598486714476
|
209
209
|
segments:
|
210
210
|
- 0
|
211
211
|
version: "0"
|