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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: e1d5a0becf29a132a2772a1be27f65d57bbe7d57
4
- data.tar.gz: c7cd80c70bc69f51c1049660da1876f4021509f6
3
+ metadata.gz: a2aea3285c815d588eeb10475b86dd7b5aeec43a
4
+ data.tar.gz: 00acd7b4da158b9f32e32215000fd199a22159da
5
5
  SHA512:
6
- metadata.gz: 0871ee04966cba102bea3958e29921bba0f8934367fdbd3afbed58d21b839915684cea5cf72e57269e31fe505e0a1f08a8fd98b9dd06e5351058fd3de0ce2ca5
7
- data.tar.gz: b840e5e102f1bb9b5b9b6457e0ef683f81edf32b053d962e2cd49dfe58889a0d73fcde94a77526b55e44826e0ba35361e7bedf831b56efab7fd41ba68f7723f6
6
+ metadata.gz: e6035c111b8afebd7c90601550265ddb5b407b5212a6cdd441a1932328af0701546464656f98045b4a898ada83abf5f7b6b9b0f0d55de1f538e47c9423e55b78
7
+ data.tar.gz: af889fca0540a62039b204c5b1b84cdd6fe40195f509413362c92a0f56b5a8575f9976fbc154debbfe85152c435382f59c297167de65abce876406902d7e1546
@@ -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.
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- simplestate (2.0.11)
4
+ simplestate (2.0.12)
5
5
 
6
6
  GEM
7
7
  remote: https://rubygems.org/
@@ -1,12 +1,17 @@
1
1
  class State
2
2
  attr_reader :holder
3
- def initialize(holder:, opts: {})
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
- 'State'
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
- super
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)
@@ -1,3 +1,3 @@
1
1
  module Simplestate
2
- VERSION = "2.0.12"
2
+ VERSION = "2.0.13"
3
3
  end
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.12
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-17 00:00:00.000000000 Z
11
+ date: 2016-09-19 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler