end_state 1.0.1 → 1.0.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/end_state.gemspec +1 -1
- data/lib/end_state/state_machine.rb +5 -5
- data/lib/end_state/version.rb +1 -1
- data/spec/end_state/state_machine_spec.rb +4 -1
- metadata +6 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2658b1366252a71619b0e67bb15f12858ab1dafe
|
4
|
+
data.tar.gz: ddb735e643726468112e9c72d28fd7b73e83724b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b6600b6e9ef3cdb6d25758dfb589814ce71bf448ca993273fa9a826a09b17be25e37c6b9522a48cd14c09107c69cd4d5218b637dde5e28cfcbb76a31b0dc5454
|
7
|
+
data.tar.gz: be6865eacd6f30d9e44188d36215cadc5e3cc2050b1a2d483a3acb070ce098760a53ac5332da39ac52832c77c1ba81d8a8087d06b0ca1217617fc3e8ee6a22fd
|
data/end_state.gemspec
CHANGED
@@ -18,7 +18,7 @@ Gem::Specification.new do |spec|
|
|
18
18
|
spec.test_files = spec.files.grep(/^(test|spec|features)\//)
|
19
19
|
spec.require_paths = ['lib']
|
20
20
|
|
21
|
-
spec.add_development_dependency 'bundler'
|
21
|
+
spec.add_development_dependency 'bundler'
|
22
22
|
spec.add_development_dependency 'rake'
|
23
23
|
spec.add_development_dependency 'rspec'
|
24
24
|
spec.add_development_dependency 'rubocop'
|
@@ -14,18 +14,18 @@ module EndState
|
|
14
14
|
end
|
15
15
|
|
16
16
|
def can_transition?(end_state, params = {})
|
17
|
-
return false unless __sm_transition_configuration_for(state, end_state)
|
18
|
-
__sm_transition_for(end_state).will_allow?(params)
|
17
|
+
return false unless __sm_transition_configuration_for(state.to_sym, end_state.to_sym)
|
18
|
+
__sm_transition_for(end_state.to_sym).will_allow?(params)
|
19
19
|
end
|
20
20
|
|
21
21
|
def transition(end_state, params = {}, mode = self.class.mode)
|
22
22
|
__sm_reset_messages
|
23
|
-
return __sm_block_transistion(end_state, mode) unless __sm_transition_configuration_for(state, end_state)
|
24
|
-
__sm_transition_for(end_state, mode).call(params)
|
23
|
+
return __sm_block_transistion(end_state.to_sym, mode) unless __sm_transition_configuration_for(state.to_sym, end_state.to_sym)
|
24
|
+
__sm_transition_for(end_state.to_sym, mode).call(params)
|
25
25
|
end
|
26
26
|
|
27
27
|
def transition!(end_state, params = {})
|
28
|
-
transition end_state, params, :hard
|
28
|
+
transition end_state.to_sym, params, :hard
|
29
29
|
end
|
30
30
|
|
31
31
|
def method_missing(method, *args, &block)
|
data/lib/end_state/version.rb
CHANGED
@@ -289,7 +289,10 @@ module EndState
|
|
289
289
|
end
|
290
290
|
|
291
291
|
context 'and the machine is set to store_states_as_strings' do
|
292
|
-
before
|
292
|
+
before do
|
293
|
+
object.state = 'a'
|
294
|
+
StateMachine.store_states_as_strings!
|
295
|
+
end
|
293
296
|
|
294
297
|
it 'transitions the state stored as a string' do
|
295
298
|
machine.transition :b
|
metadata
CHANGED
@@ -1,29 +1,29 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: end_state
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- alexpeachey
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-03-
|
11
|
+
date: 2016-03-30 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
|
-
- - "
|
17
|
+
- - ">="
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: '
|
19
|
+
version: '0'
|
20
20
|
type: :development
|
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: '
|
26
|
+
version: '0'
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: rake
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|