celluloid-fsm 0.9.0.pre10 → 0.9.0.pre11
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile +7 -7
- data/Rakefile +4 -4
- data/celluloid-fsm.gemspec +11 -11
- data/lib/celluloid/fsm.rb +11 -11
- data/tasks/benchmarks.rake +2 -2
- data/tasks/rspec.rake +2 -2
- data/tasks/rubocop.rake +2 -2
- metadata +55 -55
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: eaee072807b20444a0b56afc301edfd52bc798be
|
4
|
+
data.tar.gz: 8d1b92e61779e561cba04d2107604d2ec390ed10
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a1d700a5b13a332133e35aab959724c5396c637786781aeb6bf4fdd2444b4c1827fef08cc1ea8c67cfc19667588befeb0f191739fb0cdb802d7d1cb8beb62db0
|
7
|
+
data.tar.gz: c88645716ed87be193cd8a7f74cfa36be084603f65e36482999ce0a275514b4fd456068686a6c4c812046333312d786eb9ab3f22f95779fcae9551f494ec7d90
|
data/Gemfile
CHANGED
@@ -1,24 +1,24 @@
|
|
1
1
|
require File.expand_path("../culture/sync", __FILE__)
|
2
|
-
source
|
2
|
+
source "https://rubygems.org"
|
3
3
|
|
4
4
|
gemspec development_group: :gem_build_tools
|
5
5
|
|
6
6
|
group :development do
|
7
|
-
gem
|
7
|
+
gem "pry"
|
8
8
|
# gem 'guard'
|
9
9
|
# gem 'guard-rspec'
|
10
10
|
# gem 'rb-fsevent', '~> 0.9.1' if RUBY_PLATFORM =~ /darwin/
|
11
11
|
end
|
12
12
|
|
13
13
|
group :test do
|
14
|
-
gem
|
15
|
-
gem
|
16
|
-
gem
|
17
|
-
gem
|
14
|
+
gem "dotenv", "~> 2.0"
|
15
|
+
gem "nenv"
|
16
|
+
gem "benchmark_suite"
|
17
|
+
gem "rspec", "~> 3.2"
|
18
18
|
end
|
19
19
|
|
20
20
|
group :gem_build_tools do
|
21
|
-
gem
|
21
|
+
gem "rake"
|
22
22
|
end
|
23
23
|
|
24
24
|
Celluloid::Sync.gems(self)
|
data/Rakefile
CHANGED
@@ -1,9 +1,9 @@
|
|
1
|
-
require
|
1
|
+
require "bundler/gem_tasks"
|
2
2
|
|
3
|
-
Dir[
|
3
|
+
Dir["tasks/**/*.rake"].each { |task| load task }
|
4
4
|
|
5
|
-
default_tasks = [
|
6
|
-
default_tasks <<
|
5
|
+
default_tasks = ["spec"]
|
6
|
+
default_tasks << "rubocop" unless ENV["CI"]
|
7
7
|
task default: default_tasks
|
8
8
|
|
9
9
|
task ci: %w(spec benchmark)
|
data/celluloid-fsm.gemspec
CHANGED
@@ -2,22 +2,22 @@
|
|
2
2
|
require File.expand_path("../culture/sync", __FILE__)
|
3
3
|
|
4
4
|
Gem::Specification.new do |gem|
|
5
|
-
gem.name =
|
6
|
-
gem.version =
|
5
|
+
gem.name = "celluloid-fsm"
|
6
|
+
gem.version = "0.9.0.pre11"
|
7
7
|
gem.platform = Gem::Platform::RUBY
|
8
|
-
gem.summary =
|
9
|
-
gem.description =
|
10
|
-
gem.licenses = [
|
11
|
-
|
8
|
+
gem.summary = "Celluloid Finite State Machines"
|
9
|
+
gem.description = "Simple finite state machines with integrated Celluloid timeout support."
|
10
|
+
gem.licenses = ["MIT"]
|
11
|
+
|
12
12
|
gem.authors = ["Tony Arcieri", "Tim Carey-Smith", "digitalextremist //"]
|
13
|
-
gem.email = [
|
14
|
-
gem.homepage =
|
13
|
+
gem.email = ["tony.arcieri@gmail.com", "code@extremist.digital"]
|
14
|
+
gem.homepage = "https://github.com/celluloid/celluloid-fsm"
|
15
15
|
|
16
|
-
gem.required_ruby_version =
|
17
|
-
gem.required_rubygems_version =
|
16
|
+
gem.required_ruby_version = ">= 1.9.2"
|
17
|
+
gem.required_rubygems_version = ">= 1.3.6"
|
18
18
|
|
19
19
|
gem.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|examples|spec|features)/}) }
|
20
|
-
gem.require_path =
|
20
|
+
gem.require_path = "lib"
|
21
21
|
|
22
22
|
Celluloid::Sync.gems(gem)
|
23
23
|
end
|
data/lib/celluloid/fsm.rb
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
require
|
1
|
+
require "celluloid" unless defined? Celluloid
|
2
2
|
|
3
3
|
module Celluloid
|
4
4
|
# Simple finite state machines with integrated Celluloid timeout support
|
@@ -46,15 +46,15 @@ module Celluloid
|
|
46
46
|
def state(*args, &block)
|
47
47
|
if args.last.is_a? Hash
|
48
48
|
# Stringify keys :/
|
49
|
-
options = args.pop.each_with_object({}) { |(k,v), h| h[k.to_s] = v }
|
49
|
+
options = args.pop.each_with_object({}) { |(k, v), h| h[k.to_s] = v }
|
50
50
|
else
|
51
51
|
options = {}
|
52
52
|
end
|
53
53
|
|
54
54
|
args.each do |name|
|
55
55
|
name = name.to_sym
|
56
|
-
default_state name if options[
|
57
|
-
states[name] = State.new(name, options[
|
56
|
+
default_state name if options["default"]
|
57
|
+
states[name] = State.new(name, options["to"], &block)
|
58
58
|
end
|
59
59
|
end
|
60
60
|
end
|
@@ -109,16 +109,16 @@ module Celluloid
|
|
109
109
|
|
110
110
|
return if current_state_name == state_name
|
111
111
|
|
112
|
-
if current_state and
|
112
|
+
if current_state and !current_state.valid_transition? state_name
|
113
113
|
valid = current_state.transitions.map(&:to_s).join(", ")
|
114
|
-
|
114
|
+
fail ArgumentError, "#{self.class} can't change state from '#{@state}' to '#{state_name}', only to: #{valid}"
|
115
115
|
end
|
116
116
|
|
117
117
|
new_state = states[state_name]
|
118
118
|
|
119
119
|
unless new_state
|
120
120
|
return if state_name == default_state
|
121
|
-
|
121
|
+
fail ArgumentError, "invalid state for #{self.class}: #{state_name}"
|
122
122
|
end
|
123
123
|
|
124
124
|
new_state
|
@@ -142,12 +142,12 @@ module Celluloid
|
|
142
142
|
end
|
143
143
|
|
144
144
|
def current_state_name
|
145
|
-
current_state && current_state.name ||
|
145
|
+
current_state && current_state.name || ""
|
146
146
|
end
|
147
147
|
|
148
148
|
def handle_delayed_transitions(new_state, delay)
|
149
149
|
if delay
|
150
|
-
|
150
|
+
fail UnattachedError, "can't delay unless attached" unless @actor
|
151
151
|
@delayed_transition.cancel if @delayed_transition
|
152
152
|
|
153
153
|
@delayed_transition = @actor.after(delay) do
|
@@ -157,7 +157,7 @@ module Celluloid
|
|
157
157
|
return @delayed_transition
|
158
158
|
end
|
159
159
|
|
160
|
-
return unless defined?(@delayed_transition)
|
160
|
+
return unless defined?(@delayed_transition) && @delayed_transition
|
161
161
|
@delayed_transition.cancel
|
162
162
|
@delayed_transition = nil
|
163
163
|
end
|
@@ -184,4 +184,4 @@ module Celluloid
|
|
184
184
|
end
|
185
185
|
end
|
186
186
|
end
|
187
|
-
end
|
187
|
+
end
|
data/tasks/benchmarks.rake
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
require
|
1
|
+
require "timeout"
|
2
2
|
|
3
3
|
desc "Run Celluloid benchmarks"
|
4
4
|
task :benchmark do
|
@@ -11,6 +11,6 @@ task :benchmark do
|
|
11
11
|
puts "ERROR: Couldn't complete benchmark: #{ex.class}: #{ex}"
|
12
12
|
puts " #{ex.backtrace.join("\n ")}"
|
13
13
|
|
14
|
-
exit 1 unless ENV[
|
14
|
+
exit 1 unless ENV["CI"] # Hax for running benchmarks on Travis
|
15
15
|
end
|
16
16
|
end
|
data/tasks/rspec.rake
CHANGED
data/tasks/rubocop.rake
CHANGED
metadata
CHANGED
@@ -1,155 +1,155 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: celluloid-fsm
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.9.0.
|
4
|
+
version: 0.9.0.pre11
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Tony Arcieri
|
8
8
|
- Tim Carey-Smith
|
9
9
|
- digitalextremist //
|
10
|
-
autorequire:
|
10
|
+
autorequire:
|
11
11
|
bindir: bin
|
12
12
|
cert_chain: []
|
13
|
-
date: 2015-04
|
13
|
+
date: 2015-05-04 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
|
+
name: bundler
|
16
17
|
requirement: !ruby/object:Gem::Requirement
|
17
18
|
requirements:
|
18
|
-
- -
|
19
|
+
- - ">="
|
19
20
|
- !ruby/object:Gem::Version
|
20
21
|
version: '0'
|
21
|
-
|
22
|
+
type: :runtime
|
22
23
|
prerelease: false
|
23
|
-
type: :development
|
24
24
|
version_requirements: !ruby/object:Gem::Requirement
|
25
25
|
requirements:
|
26
|
-
- -
|
26
|
+
- - ">="
|
27
27
|
- !ruby/object:Gem::Version
|
28
28
|
version: '0'
|
29
29
|
- !ruby/object:Gem::Dependency
|
30
|
+
name: rubocop
|
30
31
|
requirement: !ruby/object:Gem::Requirement
|
31
32
|
requirements:
|
32
|
-
- -
|
33
|
+
- - ">="
|
33
34
|
- !ruby/object:Gem::Version
|
34
35
|
version: '0'
|
35
|
-
name: coveralls
|
36
|
-
prerelease: false
|
37
36
|
type: :development
|
37
|
+
prerelease: false
|
38
38
|
version_requirements: !ruby/object:Gem::Requirement
|
39
39
|
requirements:
|
40
|
-
- -
|
40
|
+
- - ">="
|
41
41
|
- !ruby/object:Gem::Version
|
42
42
|
version: '0'
|
43
43
|
- !ruby/object:Gem::Dependency
|
44
|
+
name: coveralls
|
44
45
|
requirement: !ruby/object:Gem::Requirement
|
45
46
|
requirements:
|
46
|
-
- -
|
47
|
+
- - ">="
|
47
48
|
- !ruby/object:Gem::Version
|
48
49
|
version: '0'
|
49
|
-
name: celluloid
|
50
|
-
prerelease: false
|
51
50
|
type: :development
|
51
|
+
prerelease: false
|
52
52
|
version_requirements: !ruby/object:Gem::Requirement
|
53
53
|
requirements:
|
54
|
-
- -
|
54
|
+
- - ">="
|
55
55
|
- !ruby/object:Gem::Version
|
56
56
|
version: '0'
|
57
57
|
- !ruby/object:Gem::Dependency
|
58
|
+
name: celluloid
|
58
59
|
requirement: !ruby/object:Gem::Requirement
|
59
60
|
requirements:
|
60
|
-
- -
|
61
|
+
- - ">="
|
61
62
|
- !ruby/object:Gem::Version
|
62
63
|
version: '0'
|
63
|
-
name: celluloid-essentials
|
64
|
-
prerelease: false
|
65
64
|
type: :development
|
65
|
+
prerelease: false
|
66
66
|
version_requirements: !ruby/object:Gem::Requirement
|
67
67
|
requirements:
|
68
|
-
- -
|
68
|
+
- - ">="
|
69
69
|
- !ruby/object:Gem::Version
|
70
70
|
version: '0'
|
71
71
|
- !ruby/object:Gem::Dependency
|
72
|
+
name: celluloid-essentials
|
72
73
|
requirement: !ruby/object:Gem::Requirement
|
73
74
|
requirements:
|
74
|
-
- -
|
75
|
+
- - ">="
|
75
76
|
- !ruby/object:Gem::Version
|
76
77
|
version: '0'
|
77
|
-
|
78
|
+
type: :runtime
|
78
79
|
prerelease: false
|
79
|
-
type: :development
|
80
80
|
version_requirements: !ruby/object:Gem::Requirement
|
81
81
|
requirements:
|
82
|
-
- -
|
82
|
+
- - ">="
|
83
83
|
- !ruby/object:Gem::Version
|
84
84
|
version: '0'
|
85
85
|
- !ruby/object:Gem::Dependency
|
86
|
+
name: celluloid-supervision
|
86
87
|
requirement: !ruby/object:Gem::Requirement
|
87
88
|
requirements:
|
88
|
-
- -
|
89
|
+
- - ">="
|
89
90
|
- !ruby/object:Gem::Version
|
90
91
|
version: '0'
|
91
|
-
|
92
|
+
type: :runtime
|
92
93
|
prerelease: false
|
93
|
-
type: :development
|
94
94
|
version_requirements: !ruby/object:Gem::Requirement
|
95
95
|
requirements:
|
96
|
-
- -
|
96
|
+
- - ">="
|
97
97
|
- !ruby/object:Gem::Version
|
98
98
|
version: '0'
|
99
99
|
- !ruby/object:Gem::Dependency
|
100
|
+
name: celluloid-pool
|
100
101
|
requirement: !ruby/object:Gem::Requirement
|
101
102
|
requirements:
|
102
|
-
- -
|
103
|
+
- - ">="
|
103
104
|
- !ruby/object:Gem::Version
|
104
105
|
version: '0'
|
105
|
-
|
106
|
+
type: :runtime
|
106
107
|
prerelease: false
|
107
|
-
type: :development
|
108
108
|
version_requirements: !ruby/object:Gem::Requirement
|
109
109
|
requirements:
|
110
|
-
- -
|
110
|
+
- - ">="
|
111
111
|
- !ruby/object:Gem::Version
|
112
112
|
version: '0'
|
113
113
|
- !ruby/object:Gem::Dependency
|
114
|
+
name: celluloid-extras
|
114
115
|
requirement: !ruby/object:Gem::Requirement
|
115
116
|
requirements:
|
116
|
-
- -
|
117
|
+
- - ">="
|
117
118
|
- !ruby/object:Gem::Version
|
118
119
|
version: '0'
|
119
|
-
|
120
|
+
type: :runtime
|
120
121
|
prerelease: false
|
121
|
-
type: :development
|
122
122
|
version_requirements: !ruby/object:Gem::Requirement
|
123
123
|
requirements:
|
124
|
-
- -
|
124
|
+
- - ">="
|
125
125
|
- !ruby/object:Gem::Version
|
126
126
|
version: '0'
|
127
127
|
- !ruby/object:Gem::Dependency
|
128
|
+
name: timers
|
128
129
|
requirement: !ruby/object:Gem::Requirement
|
129
130
|
requirements:
|
130
|
-
- -
|
131
|
+
- - ">="
|
131
132
|
- !ruby/object:Gem::Version
|
132
133
|
version: '0'
|
133
|
-
|
134
|
+
type: :runtime
|
134
135
|
prerelease: false
|
135
|
-
type: :development
|
136
136
|
version_requirements: !ruby/object:Gem::Requirement
|
137
137
|
requirements:
|
138
|
-
- -
|
138
|
+
- - ">="
|
139
139
|
- !ruby/object:Gem::Version
|
140
140
|
version: '0'
|
141
141
|
- !ruby/object:Gem::Dependency
|
142
|
+
name: rspec-logsplit
|
142
143
|
requirement: !ruby/object:Gem::Requirement
|
143
144
|
requirements:
|
144
|
-
- -
|
145
|
+
- - ">="
|
145
146
|
- !ruby/object:Gem::Version
|
146
147
|
version: '0'
|
147
|
-
|
148
|
+
type: :runtime
|
148
149
|
prerelease: false
|
149
|
-
type: :development
|
150
150
|
version_requirements: !ruby/object:Gem::Requirement
|
151
151
|
requirements:
|
152
|
-
- -
|
152
|
+
- - ">="
|
153
153
|
- !ruby/object:Gem::Version
|
154
154
|
version: '0'
|
155
155
|
description: Simple finite state machines with integrated Celluloid timeout support.
|
@@ -160,13 +160,13 @@ executables: []
|
|
160
160
|
extensions: []
|
161
161
|
extra_rdoc_files: []
|
162
162
|
files:
|
163
|
-
- .env-ci
|
164
|
-
- .env-dev
|
165
|
-
- .gitignore
|
166
|
-
- .gitmodules
|
167
|
-
- .rspec
|
168
|
-
- .rubocop.yml
|
169
|
-
- .travis.yml
|
163
|
+
- ".env-ci"
|
164
|
+
- ".env-dev"
|
165
|
+
- ".gitignore"
|
166
|
+
- ".gitmodules"
|
167
|
+
- ".rspec"
|
168
|
+
- ".rubocop.yml"
|
169
|
+
- ".travis.yml"
|
170
170
|
- CHANGES.md
|
171
171
|
- Gemfile
|
172
172
|
- LICENSE.txt
|
@@ -181,24 +181,24 @@ homepage: https://github.com/celluloid/celluloid-fsm
|
|
181
181
|
licenses:
|
182
182
|
- MIT
|
183
183
|
metadata: {}
|
184
|
-
post_install_message:
|
184
|
+
post_install_message:
|
185
185
|
rdoc_options: []
|
186
186
|
require_paths:
|
187
187
|
- lib
|
188
188
|
required_ruby_version: !ruby/object:Gem::Requirement
|
189
189
|
requirements:
|
190
|
-
- -
|
190
|
+
- - ">="
|
191
191
|
- !ruby/object:Gem::Version
|
192
192
|
version: 1.9.2
|
193
193
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
194
194
|
requirements:
|
195
|
-
- -
|
195
|
+
- - ">="
|
196
196
|
- !ruby/object:Gem::Version
|
197
197
|
version: 1.3.6
|
198
198
|
requirements: []
|
199
|
-
rubyforge_project:
|
199
|
+
rubyforge_project:
|
200
200
|
rubygems_version: 2.4.6
|
201
|
-
signing_key:
|
201
|
+
signing_key:
|
202
202
|
specification_version: 4
|
203
203
|
summary: Celluloid Finite State Machines
|
204
204
|
test_files: []
|