simplestate 2.0.12 → 2.0.13
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 +4 -4
- data/CHANGE_NOTES.md +5 -0
- data/Gemfile.lock +1 -1
- data/lib/simplestate/state.rb +7 -2
- data/lib/simplestate/state_holder.rb +6 -2
- data/lib/simplestate/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: a2aea3285c815d588eeb10475b86dd7b5aeec43a
|
|
4
|
+
data.tar.gz: 00acd7b4da158b9f32e32215000fd199a22159da
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: e6035c111b8afebd7c90601550265ddb5b407b5212a6cdd441a1932328af0701546464656f98045b4a898ada83abf5f7b6b9b0f0d55de1f538e47c9423e55b78
|
|
7
|
+
data.tar.gz: af889fca0540a62039b204c5b1b84cdd6fe40195f509413362c92a0f56b5a8575f9976fbc154debbfe85152c435382f59c297167de65abce876406902d7e1546
|
data/CHANGE_NOTES.md
CHANGED
|
@@ -1,3 +1,8 @@
|
|
|
1
|
+
#### SimpleState version 2.0.13
|
|
2
|
+
In State and StateHolder the opts argument to initialize now defaults to nil. Descendents may use this for their own purposes. Recommend use of a configuration object or a hash to pass values via this argument.
|
|
3
|
+
State no longer implements the name method. It will raise Not ImplementedError if called. State descendants must provide their own implementation.
|
|
4
|
+
|
|
5
|
+
|
|
1
6
|
#### SimpleState version 2.0.12
|
|
2
7
|
NullState now correctly inherits from State rather than mimicking State.
|
|
3
8
|
Code grooming.
|
data/Gemfile.lock
CHANGED
data/lib/simplestate/state.rb
CHANGED
|
@@ -1,12 +1,17 @@
|
|
|
1
1
|
class State
|
|
2
2
|
attr_reader :holder
|
|
3
|
-
def initialize(holder
|
|
3
|
+
def initialize( holder: ,
|
|
4
|
+
opts: nil )
|
|
4
5
|
@holder = holder
|
|
5
6
|
@holder.__send__(:add_state, self)
|
|
7
|
+
@opts = opts
|
|
8
|
+
# opts is provided to allow super to be used 'bare' in the argument list of descendents.
|
|
9
|
+
# It will be silently ignored here. In the descendent opts may be anything,
|
|
10
|
+
# but a configuration object or a hash paired with appropriate accessors is recommended.
|
|
6
11
|
end
|
|
7
12
|
|
|
8
13
|
def name
|
|
9
|
-
|
|
14
|
+
raise NotImplementedError, "#name was called on an instance of State either directly or via super."
|
|
10
15
|
end
|
|
11
16
|
alias :to_s :name
|
|
12
17
|
|
|
@@ -4,11 +4,15 @@ class StateHolder < SimpleDelegator
|
|
|
4
4
|
def initialize( initial_state: nil,
|
|
5
5
|
state_history: StateHistory.new,
|
|
6
6
|
state_list: StateList.new,
|
|
7
|
-
opts:
|
|
7
|
+
opts: nil )
|
|
8
8
|
@initial_state = initial_state
|
|
9
9
|
@state_history = state_history
|
|
10
10
|
@state_list = state_list
|
|
11
|
-
|
|
11
|
+
@opts = opts
|
|
12
|
+
# opts is provided to allow super to be used 'bare' in the argument list of descendents.
|
|
13
|
+
# It will be silently ignored here. In the descendent opts may be anything,
|
|
14
|
+
# but a configuration object or a hash paired with appropriate accessors is recommended.
|
|
15
|
+
super
|
|
12
16
|
end
|
|
13
17
|
|
|
14
18
|
def start(init_state=initial_state)
|
data/lib/simplestate/version.rb
CHANGED
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: simplestate
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 2.0.
|
|
4
|
+
version: 2.0.13
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Mitchell C Kuppinger
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: exe
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2016-09-
|
|
11
|
+
date: 2016-09-19 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: bundler
|