finite_machine 0.11.2 → 0.14.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +5 -5
- data/CHANGELOG.md +80 -0
- data/LICENSE.txt +1 -1
- data/README.md +679 -624
- data/lib/finite_machine.rb +35 -45
- data/lib/finite_machine/async_call.rb +5 -21
- data/lib/finite_machine/callable.rb +4 -4
- data/lib/finite_machine/catchable.rb +24 -14
- data/lib/finite_machine/choice_merger.rb +20 -20
- data/lib/finite_machine/const.rb +16 -0
- data/lib/finite_machine/definition.rb +3 -3
- data/lib/finite_machine/dsl.rb +98 -151
- data/lib/finite_machine/env.rb +4 -2
- data/lib/finite_machine/event_definition.rb +7 -15
- data/lib/finite_machine/{events_chain.rb → events_map.rb} +40 -53
- data/lib/finite_machine/hook_event.rb +60 -61
- data/lib/finite_machine/hooks.rb +44 -36
- data/lib/finite_machine/listener.rb +2 -2
- data/lib/finite_machine/logger.rb +5 -4
- data/lib/finite_machine/{event_queue.rb → message_queue.rb} +76 -32
- data/lib/finite_machine/observer.rb +71 -34
- data/lib/finite_machine/safety.rb +16 -14
- data/lib/finite_machine/state_definition.rb +3 -5
- data/lib/finite_machine/state_machine.rb +93 -76
- data/lib/finite_machine/state_parser.rb +55 -83
- data/lib/finite_machine/subscribers.rb +2 -2
- data/lib/finite_machine/threadable.rb +3 -1
- data/lib/finite_machine/transition.rb +34 -34
- data/lib/finite_machine/transition_builder.rb +23 -32
- data/lib/finite_machine/transition_event.rb +12 -11
- data/lib/finite_machine/two_phase_lock.rb +8 -6
- data/lib/finite_machine/undefined_transition.rb +5 -6
- data/lib/finite_machine/version.rb +2 -2
- metadata +58 -142
- data/.gitignore +0 -18
- data/.rspec +0 -5
- data/.ruby-gemset +0 -1
- data/.ruby-version +0 -1
- data/.travis.yml +0 -26
- data/Gemfile +0 -15
- data/Rakefile +0 -8
- data/assets/finite_machine_logo.png +0 -0
- data/examples/atm.rb +0 -45
- data/examples/bug_system.rb +0 -145
- data/finite_machine.gemspec +0 -23
- data/lib/finite_machine/async_proxy.rb +0 -30
- data/spec/integration/system_spec.rb +0 -95
- data/spec/spec_helper.rb +0 -33
- data/spec/unit/alias_target_spec.rb +0 -108
- data/spec/unit/async_events_spec.rb +0 -138
- data/spec/unit/callable/call_spec.rb +0 -113
- data/spec/unit/callbacks_spec.rb +0 -942
- data/spec/unit/can_spec.rb +0 -98
- data/spec/unit/choice_spec.rb +0 -331
- data/spec/unit/define_spec.rb +0 -55
- data/spec/unit/definition_spec.rb +0 -115
- data/spec/unit/event_names_spec.rb +0 -19
- data/spec/unit/event_queue_spec.rb +0 -52
- data/spec/unit/events_chain/add_spec.rb +0 -25
- data/spec/unit/events_chain/cancel_transitions_spec.rb +0 -22
- data/spec/unit/events_chain/choice_transition_spec.rb +0 -28
- data/spec/unit/events_chain/clear_spec.rb +0 -15
- data/spec/unit/events_chain/events_spec.rb +0 -18
- data/spec/unit/events_chain/inspect_spec.rb +0 -24
- data/spec/unit/events_chain/match_transition_spec.rb +0 -37
- data/spec/unit/events_chain/move_to_spec.rb +0 -48
- data/spec/unit/events_chain/states_for_spec.rb +0 -17
- data/spec/unit/events_spec.rb +0 -459
- data/spec/unit/handlers_spec.rb +0 -152
- data/spec/unit/hook_event/build_spec.rb +0 -15
- data/spec/unit/hook_event/eql_spec.rb +0 -36
- data/spec/unit/hook_event/infer_default_name_spec.rb +0 -13
- data/spec/unit/hook_event/initialize_spec.rb +0 -25
- data/spec/unit/hook_event/notify_spec.rb +0 -14
- data/spec/unit/hooks/call_spec.rb +0 -24
- data/spec/unit/hooks/clear_spec.rb +0 -16
- data/spec/unit/hooks/inspect_spec.rb +0 -17
- data/spec/unit/hooks/register_spec.rb +0 -22
- data/spec/unit/if_unless_spec.rb +0 -353
- data/spec/unit/initial_spec.rb +0 -222
- data/spec/unit/inspect_spec.rb +0 -17
- data/spec/unit/is_spec.rb +0 -55
- data/spec/unit/log_transitions_spec.rb +0 -30
- data/spec/unit/logger_spec.rb +0 -38
- data/spec/unit/respond_to_spec.rb +0 -38
- data/spec/unit/state_parser/inspect_spec.rb +0 -25
- data/spec/unit/state_parser/parse_spec.rb +0 -59
- data/spec/unit/states_spec.rb +0 -34
- data/spec/unit/subscribers_spec.rb +0 -42
- data/spec/unit/target_spec.rb +0 -225
- data/spec/unit/terminated_spec.rb +0 -95
- data/spec/unit/transition/check_conditions_spec.rb +0 -54
- data/spec/unit/transition/inspect_spec.rb +0 -25
- data/spec/unit/transition/matches_spec.rb +0 -23
- data/spec/unit/transition/states_spec.rb +0 -31
- data/spec/unit/transition/to_state_spec.rb +0 -27
- data/spec/unit/trigger_spec.rb +0 -22
- data/spec/unit/undefined_transition/eql_spec.rb +0 -17
- data/tasks/console.rake +0 -11
- data/tasks/coverage.rake +0 -11
- data/tasks/spec.rake +0 -29
@@ -1,7 +1,21 @@
|
|
1
|
-
#
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require_relative "callable"
|
4
|
+
require_relative "threadable"
|
2
5
|
|
3
6
|
module FiniteMachine
|
4
7
|
# Class describing a transition associated with a given event
|
8
|
+
#
|
9
|
+
# The {Transition} is created with the `event` helper.
|
10
|
+
#
|
11
|
+
# @example Converting event into {Transition}
|
12
|
+
# event :go, :red => :green
|
13
|
+
#
|
14
|
+
# will be translated to
|
15
|
+
#
|
16
|
+
# Transition.new(context, :go, {states: {:red => :green}})
|
17
|
+
#
|
18
|
+
# @api private
|
5
19
|
class Transition
|
6
20
|
include Threadable
|
7
21
|
|
@@ -11,11 +25,8 @@ module FiniteMachine
|
|
11
25
|
# Predicates before transitioning
|
12
26
|
attr_threadsafe :conditions
|
13
27
|
|
14
|
-
# The current state machine
|
15
|
-
attr_threadsafe :
|
16
|
-
|
17
|
-
# Check if transition should be cancelled
|
18
|
-
attr_threadsafe :cancelled
|
28
|
+
# The current state machine context
|
29
|
+
attr_threadsafe :context
|
19
30
|
|
20
31
|
# All states for this transition event
|
21
32
|
attr_threadsafe :states
|
@@ -23,33 +34,25 @@ module FiniteMachine
|
|
23
34
|
# Initialize a Transition
|
24
35
|
#
|
25
36
|
# @example
|
26
|
-
# attributes = {
|
27
|
-
# Transition.new(
|
37
|
+
# attributes = {states: {green: :yellow}}
|
38
|
+
# Transition.new(context, :go, attributes)
|
28
39
|
#
|
29
|
-
# @param [
|
40
|
+
# @param [Object] context
|
41
|
+
# the context this transition evaluets conditions in
|
30
42
|
#
|
31
43
|
# @param [Hash] attrs
|
32
44
|
#
|
33
45
|
# @return [Transition]
|
34
46
|
#
|
35
47
|
# @api public
|
36
|
-
def initialize(
|
37
|
-
@
|
38
|
-
@name =
|
48
|
+
def initialize(context, name, attrs = {})
|
49
|
+
@context = context
|
50
|
+
@name = name
|
39
51
|
@states = attrs.fetch(:states, {})
|
40
52
|
@if = Array(attrs.fetch(:if, []))
|
41
53
|
@unless = Array(attrs.fetch(:unless, []))
|
42
54
|
@conditions = make_conditions
|
43
|
-
|
44
|
-
end
|
45
|
-
|
46
|
-
# Check if this transition is cancelled or not
|
47
|
-
#
|
48
|
-
# @return [Boolean]
|
49
|
-
#
|
50
|
-
# @api public
|
51
|
-
def cancelled?
|
52
|
-
@cancelled
|
55
|
+
freeze
|
53
56
|
end
|
54
57
|
|
55
58
|
# Reduce conditions
|
@@ -72,7 +75,7 @@ module FiniteMachine
|
|
72
75
|
# @api private
|
73
76
|
def check_conditions(*args)
|
74
77
|
conditions.all? do |condition|
|
75
|
-
condition.call(
|
78
|
+
condition.call(context, *args)
|
76
79
|
end
|
77
80
|
end
|
78
81
|
|
@@ -82,7 +85,7 @@ module FiniteMachine
|
|
82
85
|
# the from state to match against
|
83
86
|
#
|
84
87
|
# @example
|
85
|
-
# transition = Transition.new(
|
88
|
+
# transition = Transition.new(context, states: {:green => :red})
|
86
89
|
# transition.matches?(:green) # => true
|
87
90
|
#
|
88
91
|
# @return [Boolean]
|
@@ -99,7 +102,7 @@ module FiniteMachine
|
|
99
102
|
# the from state to check
|
100
103
|
#
|
101
104
|
# @example
|
102
|
-
# transition = Transition.new(
|
105
|
+
# transition = Transition.new(context, states: {:green => :red})
|
103
106
|
# transition.to_state(:green) # => :red
|
104
107
|
#
|
105
108
|
# @return [Symbol]
|
@@ -107,18 +110,14 @@ module FiniteMachine
|
|
107
110
|
#
|
108
111
|
# @api public
|
109
112
|
def to_state(from)
|
110
|
-
|
111
|
-
from
|
112
|
-
else
|
113
|
-
states[from] || states[ANY_STATE]
|
114
|
-
end
|
113
|
+
states[from] || states[ANY_STATE]
|
115
114
|
end
|
116
115
|
|
117
116
|
# Return transition name
|
118
117
|
#
|
119
118
|
# @example
|
120
|
-
# transition = Transition.new(
|
121
|
-
# transition.to_s # =>
|
119
|
+
# transition = Transition.new(context, name: :go)
|
120
|
+
# transition.to_s # => "go"
|
122
121
|
#
|
123
122
|
# @return [String]
|
124
123
|
#
|
@@ -133,8 +132,9 @@ module FiniteMachine
|
|
133
132
|
#
|
134
133
|
# @api public
|
135
134
|
def inspect
|
136
|
-
transitions = @states.map { |from, to| "#{from} -> #{to}" }.join(
|
137
|
-
"<##{self.class} @name=#{@name}, @transitions=#{transitions},
|
135
|
+
transitions = @states.map { |from, to| "#{from} -> #{to}" }.join(", ")
|
136
|
+
"<##{self.class} @name=#{@name}, @transitions=#{transitions}, " \
|
137
|
+
"@when=#{@conditions}>"
|
138
138
|
end
|
139
139
|
end # Transition
|
140
140
|
end # FiniteMachine
|
@@ -1,8 +1,9 @@
|
|
1
|
-
#
|
1
|
+
# frozen_string_literal: true
|
2
2
|
|
3
|
-
|
4
|
-
|
5
|
-
|
3
|
+
require_relative "event_definition"
|
4
|
+
require_relative "state_definition"
|
5
|
+
require_relative "state_parser"
|
6
|
+
require_relative "transition"
|
6
7
|
|
7
8
|
module FiniteMachine
|
8
9
|
# A class reponsible for building transition out of parsed states
|
@@ -11,54 +12,44 @@ module FiniteMachine
|
|
11
12
|
#
|
12
13
|
# @api private
|
13
14
|
class TransitionBuilder
|
14
|
-
include Threadable
|
15
|
-
|
16
|
-
# The current state machine
|
17
|
-
attr_threadsafe :machine
|
18
|
-
|
19
|
-
attr_threadsafe :attributes
|
20
|
-
|
21
|
-
attr_threadsafe :event_definition
|
22
|
-
|
23
|
-
attr_threadsafe :state_definition
|
24
|
-
|
25
15
|
# Initialize a TransitionBuilder
|
26
16
|
#
|
27
17
|
# @example
|
28
18
|
# TransitionBuilder.new(machine, {})
|
29
19
|
#
|
30
20
|
# @api public
|
31
|
-
def initialize(machine, attributes = {})
|
32
|
-
@machine
|
21
|
+
def initialize(machine, name, attributes = {})
|
22
|
+
@machine = machine
|
23
|
+
@name = name
|
33
24
|
@attributes = attributes
|
25
|
+
|
34
26
|
@event_definition = EventDefinition.new(machine)
|
35
27
|
@state_definition = StateDefinition.new(machine)
|
36
28
|
end
|
37
29
|
|
38
|
-
#
|
30
|
+
# Converts user transitions into internal {Transition} representation
|
39
31
|
#
|
40
32
|
# @example
|
41
33
|
# transition_builder.call([:green, :yellow] => :red)
|
42
34
|
#
|
43
|
-
# @param [Hash[Symbol]]
|
44
|
-
# The
|
35
|
+
# @param [Hash[Symbol]] transitions
|
36
|
+
# The transitions to extract states from
|
45
37
|
#
|
46
38
|
# @return [self]
|
47
39
|
#
|
48
40
|
# @api public
|
49
|
-
def call(
|
50
|
-
StateParser.
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
event_definition.apply(name, silent)
|
41
|
+
def call(transitions)
|
42
|
+
StateParser.parse(transitions) do |from, to|
|
43
|
+
transition = Transition.new(@machine.env.target, @name,
|
44
|
+
@attributes.merge(states: { from => to }))
|
45
|
+
silent = @attributes.fetch(:silent, false)
|
46
|
+
@machine.events_map.add(@name, transition)
|
47
|
+
next unless @machine.auto_methods?
|
48
|
+
|
49
|
+
unless @machine.respond_to?(@name)
|
50
|
+
@event_definition.apply(@name, silent)
|
60
51
|
end
|
61
|
-
state_definition.apply(
|
52
|
+
@state_definition.apply(from => to)
|
62
53
|
end
|
63
54
|
self
|
64
55
|
end
|
@@ -1,4 +1,6 @@
|
|
1
|
-
#
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require_relative "threadable"
|
2
4
|
|
3
5
|
module FiniteMachine
|
4
6
|
# A class representing a callback transition event
|
@@ -7,38 +9,37 @@ module FiniteMachine
|
|
7
9
|
#
|
8
10
|
# @api private
|
9
11
|
class TransitionEvent
|
10
|
-
include Threadable
|
11
|
-
|
12
12
|
# This event from state name
|
13
13
|
#
|
14
14
|
# @return [Object]
|
15
15
|
#
|
16
16
|
# @api public
|
17
|
-
|
17
|
+
attr_reader :from
|
18
18
|
|
19
19
|
# This event to state name
|
20
20
|
#
|
21
21
|
# @return [Object]
|
22
22
|
#
|
23
23
|
# @api public
|
24
|
-
|
24
|
+
attr_reader :to
|
25
25
|
|
26
26
|
# This event name
|
27
27
|
#
|
28
28
|
# @api public
|
29
|
-
|
29
|
+
attr_reader :name
|
30
30
|
|
31
31
|
# Build a transition event
|
32
32
|
#
|
33
|
-
# @param [
|
33
|
+
# @param [String] event_name
|
34
|
+
# @param [String] from
|
35
|
+
# @param [String] to
|
34
36
|
#
|
35
37
|
# @return [self]
|
36
38
|
#
|
37
39
|
# @api private
|
38
|
-
|
39
|
-
|
40
|
-
@
|
41
|
-
@from = hook_event.from
|
40
|
+
def initialize(event_name, from, to)
|
41
|
+
@name = event_name
|
42
|
+
@from = from
|
42
43
|
@to = to
|
43
44
|
freeze
|
44
45
|
end
|
@@ -1,4 +1,6 @@
|
|
1
|
-
#
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require "sync"
|
2
4
|
|
3
5
|
module FiniteMachine
|
4
6
|
# Mixin to provide lock to a {Threadable}
|
@@ -10,9 +12,10 @@ module FiniteMachine
|
|
10
12
|
# @return [Sync]
|
11
13
|
#
|
12
14
|
# @api private
|
13
|
-
def
|
14
|
-
@
|
15
|
+
def lock
|
16
|
+
@lock = Sync.new
|
15
17
|
end
|
18
|
+
module_function :lock
|
16
19
|
|
17
20
|
# Synchronize given block of code
|
18
21
|
#
|
@@ -23,9 +26,8 @@ module FiniteMachine
|
|
23
26
|
#
|
24
27
|
# @api private
|
25
28
|
def synchronize(mode, &block)
|
26
|
-
|
29
|
+
lock.synchronize(mode, &block)
|
27
30
|
end
|
28
|
-
|
29
|
-
module_function :sync, :synchronize
|
31
|
+
module_function :synchronize
|
30
32
|
end # TwoPhaseLock
|
31
33
|
end # FiniteMachine
|
@@ -1,19 +1,18 @@
|
|
1
|
-
#
|
1
|
+
# frozen_string_literal: true
|
2
2
|
|
3
3
|
module FiniteMachine
|
4
4
|
# Stand in for lack of matching transition.
|
5
5
|
#
|
6
|
-
# Used internally by {
|
6
|
+
# Used internally by {EventsMap}
|
7
7
|
#
|
8
8
|
# @api private
|
9
9
|
class UndefinedTransition
|
10
|
-
include Threadable
|
11
|
-
|
12
10
|
# Initialize an undefined transition
|
13
11
|
#
|
14
12
|
# @api private
|
15
13
|
def initialize(name)
|
16
|
-
|
14
|
+
@name = name
|
15
|
+
freeze
|
17
16
|
end
|
18
17
|
|
19
18
|
def to_state(from)
|
@@ -26,7 +25,7 @@ module FiniteMachine
|
|
26
25
|
|
27
26
|
protected
|
28
27
|
|
29
|
-
|
28
|
+
attr_reader :name
|
30
29
|
|
31
30
|
end # UndefinedTransition
|
32
31
|
end # FiniteMachine
|
metadata
CHANGED
@@ -1,82 +1,102 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: finite_machine
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.14.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Piotr Murach
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2020-09-12 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
|
-
name:
|
14
|
+
name: concurrent-ruby
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
|
-
- -
|
17
|
+
- - "~>"
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: '0'
|
20
|
-
type: :
|
19
|
+
version: '1.0'
|
20
|
+
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
|
-
- -
|
24
|
+
- - "~>"
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version: '0'
|
26
|
+
version: '1.0'
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: sync
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - "~>"
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '0.5'
|
34
|
+
type: :runtime
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - "~>"
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '0.5'
|
27
41
|
- !ruby/object:Gem::Dependency
|
28
42
|
name: rake
|
29
43
|
requirement: !ruby/object:Gem::Requirement
|
30
44
|
requirements:
|
31
|
-
- -
|
45
|
+
- - ">="
|
32
46
|
- !ruby/object:Gem::Version
|
33
47
|
version: '0'
|
34
48
|
type: :development
|
35
49
|
prerelease: false
|
36
50
|
version_requirements: !ruby/object:Gem::Requirement
|
37
51
|
requirements:
|
38
|
-
- -
|
52
|
+
- - ">="
|
39
53
|
- !ruby/object:Gem::Version
|
40
54
|
version: '0'
|
55
|
+
- !ruby/object:Gem::Dependency
|
56
|
+
name: rspec
|
57
|
+
requirement: !ruby/object:Gem::Requirement
|
58
|
+
requirements:
|
59
|
+
- - ">="
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: '3.0'
|
62
|
+
type: :development
|
63
|
+
prerelease: false
|
64
|
+
version_requirements: !ruby/object:Gem::Requirement
|
65
|
+
requirements:
|
66
|
+
- - ">="
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
version: '3.0'
|
41
69
|
description: A minimal finite state machine with a straightforward syntax. You can
|
42
70
|
quickly model states, add callbacks and use object-oriented techniques to integrate
|
43
71
|
with ORMs.
|
44
72
|
email:
|
45
|
-
-
|
73
|
+
- piotr@piotrmurach.com
|
46
74
|
executables: []
|
47
75
|
extensions: []
|
48
|
-
extra_rdoc_files:
|
76
|
+
extra_rdoc_files:
|
77
|
+
- README.md
|
78
|
+
- CHANGELOG.md
|
79
|
+
- LICENSE.txt
|
49
80
|
files:
|
50
|
-
- .gitignore
|
51
|
-
- .rspec
|
52
|
-
- .ruby-gemset
|
53
|
-
- .ruby-version
|
54
|
-
- .travis.yml
|
55
81
|
- CHANGELOG.md
|
56
|
-
- Gemfile
|
57
82
|
- LICENSE.txt
|
58
83
|
- README.md
|
59
|
-
- Rakefile
|
60
|
-
- assets/finite_machine_logo.png
|
61
|
-
- examples/atm.rb
|
62
|
-
- examples/bug_system.rb
|
63
|
-
- finite_machine.gemspec
|
64
84
|
- lib/finite_machine.rb
|
65
85
|
- lib/finite_machine/async_call.rb
|
66
|
-
- lib/finite_machine/async_proxy.rb
|
67
86
|
- lib/finite_machine/callable.rb
|
68
87
|
- lib/finite_machine/catchable.rb
|
69
88
|
- lib/finite_machine/choice_merger.rb
|
89
|
+
- lib/finite_machine/const.rb
|
70
90
|
- lib/finite_machine/definition.rb
|
71
91
|
- lib/finite_machine/dsl.rb
|
72
92
|
- lib/finite_machine/env.rb
|
73
93
|
- lib/finite_machine/event_definition.rb
|
74
|
-
- lib/finite_machine/
|
75
|
-
- lib/finite_machine/events_chain.rb
|
94
|
+
- lib/finite_machine/events_map.rb
|
76
95
|
- lib/finite_machine/hook_event.rb
|
77
96
|
- lib/finite_machine/hooks.rb
|
78
97
|
- lib/finite_machine/listener.rb
|
79
98
|
- lib/finite_machine/logger.rb
|
99
|
+
- lib/finite_machine/message_queue.rb
|
80
100
|
- lib/finite_machine/observer.rb
|
81
101
|
- lib/finite_machine/safety.rb
|
82
102
|
- lib/finite_machine/state_definition.rb
|
@@ -90,136 +110,32 @@ files:
|
|
90
110
|
- lib/finite_machine/two_phase_lock.rb
|
91
111
|
- lib/finite_machine/undefined_transition.rb
|
92
112
|
- lib/finite_machine/version.rb
|
93
|
-
|
94
|
-
- spec/spec_helper.rb
|
95
|
-
- spec/unit/alias_target_spec.rb
|
96
|
-
- spec/unit/async_events_spec.rb
|
97
|
-
- spec/unit/callable/call_spec.rb
|
98
|
-
- spec/unit/callbacks_spec.rb
|
99
|
-
- spec/unit/can_spec.rb
|
100
|
-
- spec/unit/choice_spec.rb
|
101
|
-
- spec/unit/define_spec.rb
|
102
|
-
- spec/unit/definition_spec.rb
|
103
|
-
- spec/unit/event_names_spec.rb
|
104
|
-
- spec/unit/event_queue_spec.rb
|
105
|
-
- spec/unit/events_chain/add_spec.rb
|
106
|
-
- spec/unit/events_chain/cancel_transitions_spec.rb
|
107
|
-
- spec/unit/events_chain/choice_transition_spec.rb
|
108
|
-
- spec/unit/events_chain/clear_spec.rb
|
109
|
-
- spec/unit/events_chain/events_spec.rb
|
110
|
-
- spec/unit/events_chain/inspect_spec.rb
|
111
|
-
- spec/unit/events_chain/match_transition_spec.rb
|
112
|
-
- spec/unit/events_chain/move_to_spec.rb
|
113
|
-
- spec/unit/events_chain/states_for_spec.rb
|
114
|
-
- spec/unit/events_spec.rb
|
115
|
-
- spec/unit/handlers_spec.rb
|
116
|
-
- spec/unit/hook_event/build_spec.rb
|
117
|
-
- spec/unit/hook_event/eql_spec.rb
|
118
|
-
- spec/unit/hook_event/infer_default_name_spec.rb
|
119
|
-
- spec/unit/hook_event/initialize_spec.rb
|
120
|
-
- spec/unit/hook_event/notify_spec.rb
|
121
|
-
- spec/unit/hooks/call_spec.rb
|
122
|
-
- spec/unit/hooks/clear_spec.rb
|
123
|
-
- spec/unit/hooks/inspect_spec.rb
|
124
|
-
- spec/unit/hooks/register_spec.rb
|
125
|
-
- spec/unit/if_unless_spec.rb
|
126
|
-
- spec/unit/initial_spec.rb
|
127
|
-
- spec/unit/inspect_spec.rb
|
128
|
-
- spec/unit/is_spec.rb
|
129
|
-
- spec/unit/log_transitions_spec.rb
|
130
|
-
- spec/unit/logger_spec.rb
|
131
|
-
- spec/unit/respond_to_spec.rb
|
132
|
-
- spec/unit/state_parser/inspect_spec.rb
|
133
|
-
- spec/unit/state_parser/parse_spec.rb
|
134
|
-
- spec/unit/states_spec.rb
|
135
|
-
- spec/unit/subscribers_spec.rb
|
136
|
-
- spec/unit/target_spec.rb
|
137
|
-
- spec/unit/terminated_spec.rb
|
138
|
-
- spec/unit/transition/check_conditions_spec.rb
|
139
|
-
- spec/unit/transition/inspect_spec.rb
|
140
|
-
- spec/unit/transition/matches_spec.rb
|
141
|
-
- spec/unit/transition/states_spec.rb
|
142
|
-
- spec/unit/transition/to_state_spec.rb
|
143
|
-
- spec/unit/trigger_spec.rb
|
144
|
-
- spec/unit/undefined_transition/eql_spec.rb
|
145
|
-
- tasks/console.rake
|
146
|
-
- tasks/coverage.rake
|
147
|
-
- tasks/spec.rake
|
148
|
-
homepage: http://peter-murach.github.io/finite_machine/
|
113
|
+
homepage: https://piotrmurach.github.io/finite_machine/
|
149
114
|
licenses:
|
150
115
|
- MIT
|
151
|
-
metadata:
|
116
|
+
metadata:
|
117
|
+
allowed_push_host: https://rubygems.org
|
118
|
+
changelog_uri: https://github.com/piotrmurach/finite_machine/blob/master/CHANGELOG.md
|
119
|
+
documentation_uri: https://www.rubydoc.info/gems/finite_machine
|
120
|
+
homepage_uri: https://piotrmurach.github.io/finite_machine/
|
121
|
+
source_code_uri: https://github.com/piotrmurach/finite_machine
|
152
122
|
post_install_message:
|
153
123
|
rdoc_options: []
|
154
124
|
require_paths:
|
155
125
|
- lib
|
156
126
|
required_ruby_version: !ruby/object:Gem::Requirement
|
157
127
|
requirements:
|
158
|
-
- -
|
128
|
+
- - ">="
|
159
129
|
- !ruby/object:Gem::Version
|
160
|
-
version:
|
130
|
+
version: 2.0.0
|
161
131
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
162
132
|
requirements:
|
163
|
-
- -
|
133
|
+
- - ">="
|
164
134
|
- !ruby/object:Gem::Version
|
165
135
|
version: '0'
|
166
136
|
requirements: []
|
167
|
-
|
168
|
-
rubygems_version: 2.0.3
|
137
|
+
rubygems_version: 3.1.2
|
169
138
|
signing_key:
|
170
139
|
specification_version: 4
|
171
140
|
summary: A minimal finite state machine with a straightforward syntax.
|
172
|
-
test_files:
|
173
|
-
- spec/integration/system_spec.rb
|
174
|
-
- spec/spec_helper.rb
|
175
|
-
- spec/unit/alias_target_spec.rb
|
176
|
-
- spec/unit/async_events_spec.rb
|
177
|
-
- spec/unit/callable/call_spec.rb
|
178
|
-
- spec/unit/callbacks_spec.rb
|
179
|
-
- spec/unit/can_spec.rb
|
180
|
-
- spec/unit/choice_spec.rb
|
181
|
-
- spec/unit/define_spec.rb
|
182
|
-
- spec/unit/definition_spec.rb
|
183
|
-
- spec/unit/event_names_spec.rb
|
184
|
-
- spec/unit/event_queue_spec.rb
|
185
|
-
- spec/unit/events_chain/add_spec.rb
|
186
|
-
- spec/unit/events_chain/cancel_transitions_spec.rb
|
187
|
-
- spec/unit/events_chain/choice_transition_spec.rb
|
188
|
-
- spec/unit/events_chain/clear_spec.rb
|
189
|
-
- spec/unit/events_chain/events_spec.rb
|
190
|
-
- spec/unit/events_chain/inspect_spec.rb
|
191
|
-
- spec/unit/events_chain/match_transition_spec.rb
|
192
|
-
- spec/unit/events_chain/move_to_spec.rb
|
193
|
-
- spec/unit/events_chain/states_for_spec.rb
|
194
|
-
- spec/unit/events_spec.rb
|
195
|
-
- spec/unit/handlers_spec.rb
|
196
|
-
- spec/unit/hook_event/build_spec.rb
|
197
|
-
- spec/unit/hook_event/eql_spec.rb
|
198
|
-
- spec/unit/hook_event/infer_default_name_spec.rb
|
199
|
-
- spec/unit/hook_event/initialize_spec.rb
|
200
|
-
- spec/unit/hook_event/notify_spec.rb
|
201
|
-
- spec/unit/hooks/call_spec.rb
|
202
|
-
- spec/unit/hooks/clear_spec.rb
|
203
|
-
- spec/unit/hooks/inspect_spec.rb
|
204
|
-
- spec/unit/hooks/register_spec.rb
|
205
|
-
- spec/unit/if_unless_spec.rb
|
206
|
-
- spec/unit/initial_spec.rb
|
207
|
-
- spec/unit/inspect_spec.rb
|
208
|
-
- spec/unit/is_spec.rb
|
209
|
-
- spec/unit/log_transitions_spec.rb
|
210
|
-
- spec/unit/logger_spec.rb
|
211
|
-
- spec/unit/respond_to_spec.rb
|
212
|
-
- spec/unit/state_parser/inspect_spec.rb
|
213
|
-
- spec/unit/state_parser/parse_spec.rb
|
214
|
-
- spec/unit/states_spec.rb
|
215
|
-
- spec/unit/subscribers_spec.rb
|
216
|
-
- spec/unit/target_spec.rb
|
217
|
-
- spec/unit/terminated_spec.rb
|
218
|
-
- spec/unit/transition/check_conditions_spec.rb
|
219
|
-
- spec/unit/transition/inspect_spec.rb
|
220
|
-
- spec/unit/transition/matches_spec.rb
|
221
|
-
- spec/unit/transition/states_spec.rb
|
222
|
-
- spec/unit/transition/to_state_spec.rb
|
223
|
-
- spec/unit/trigger_spec.rb
|
224
|
-
- spec/unit/undefined_transition/eql_spec.rb
|
225
|
-
has_rdoc:
|
141
|
+
test_files: []
|