soveran-micromachine 0.0.7 → 0.0.8
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/micromachine.rb +5 -1
- data/micromachine.gemspec +2 -6
- metadata +5 -4
data/lib/micromachine.rb
CHANGED
@@ -13,10 +13,14 @@ class MicroMachine
|
|
13
13
|
end
|
14
14
|
|
15
15
|
def trigger event
|
16
|
-
if
|
16
|
+
if trigger?(event)
|
17
17
|
@state = transitions_for[event][@state]
|
18
18
|
@callbacks[@state].each { |callback| callback.call }
|
19
19
|
true
|
20
20
|
end
|
21
21
|
end
|
22
|
+
|
23
|
+
def trigger?(event)
|
24
|
+
transitions_for[event][state]
|
25
|
+
end
|
22
26
|
end
|
data/micromachine.gemspec
CHANGED
@@ -1,14 +1,10 @@
|
|
1
1
|
Gem::Specification.new do |s|
|
2
2
|
s.name = 'micromachine'
|
3
|
-
s.version = '0.0.
|
3
|
+
s.version = '0.0.8'
|
4
4
|
s.summary = %{Minimal Finite State Machine.}
|
5
|
-
s.
|
5
|
+
s.description = %Q{There are many finite state machine implementations for Ruby, and they all provide a nice DSL for declaring events, exceptions, callbacks, and all kinds of niceties in general.\n\nBut if all you want is a finite state machine, look no further: this is only 22 lines of code and provides everything a finite state machine must have, and nothing more.}
|
6
6
|
s.author = "Michel Martens"
|
7
7
|
s.email = "michel@soveran.com"
|
8
8
|
s.homepage = "http://github.com/soveran/micromachine"
|
9
9
|
s.files = ["lib/micromachine.rb", "README.markdown", "LICENSE", "Rakefile", "micromachine.gemspec", "example/micromachine_sample.rb", "example/micromachine_sample_gem.rb"]
|
10
|
-
s.require_paths = ['lib']
|
11
|
-
s.has_rdoc = false
|
12
|
-
s.specification_version = 2 if s.respond_to? :specification_version=
|
13
10
|
end
|
14
|
-
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: soveran-micromachine
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.8
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Michel Martens
|
@@ -9,11 +9,11 @@ autorequire:
|
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
11
|
|
12
|
-
date: 2009-
|
12
|
+
date: 2009-05-16 00:00:00 -07:00
|
13
13
|
default_executable:
|
14
14
|
dependencies: []
|
15
15
|
|
16
|
-
description:
|
16
|
+
description: "There are many finite state machine implementations for Ruby, and they all provide a nice DSL for declaring events, exceptions, callbacks, and all kinds of niceties in general. But if all you want is a finite state machine, look no further: this is only 22 lines of code and provides everything a finite state machine must have, and nothing more."
|
17
17
|
email: michel@soveran.com
|
18
18
|
executables: []
|
19
19
|
|
@@ -31,6 +31,7 @@ files:
|
|
31
31
|
- example/micromachine_sample_gem.rb
|
32
32
|
has_rdoc: false
|
33
33
|
homepage: http://github.com/soveran/micromachine
|
34
|
+
licenses:
|
34
35
|
post_install_message:
|
35
36
|
rdoc_options: []
|
36
37
|
|
@@ -51,7 +52,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
51
52
|
requirements: []
|
52
53
|
|
53
54
|
rubyforge_project:
|
54
|
-
rubygems_version: 1.
|
55
|
+
rubygems_version: 1.3.5
|
55
56
|
signing_key:
|
56
57
|
specification_version: 2
|
57
58
|
summary: Minimal Finite State Machine.
|