stealth 0.10.0 → 0.10.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/LICENSE +1 -1
- data/VERSION +1 -1
- data/lib/stealth/controller/catch_all.rb +11 -4
- data/lib/stealth/controller/controller.rb +1 -1
- data/lib/stealth/flow/base.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: 334f9e3c6cc796dd9c3ed123d9226b764681170a
|
4
|
+
data.tar.gz: 637b3749ec73a66dc6f4f09e0d44e74bbb13369f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4e12660a2fd12c23f08837c578a1c64423ef4fc29e7682b522152a820567107614e7ee52648a2a9dbe44b3aad4b3308db31f31fcca5303278ec1f0ab89706d0d
|
7
|
+
data.tar.gz: 40f9f7c4e9eb231cfd9efe0eb415553f709f85c0ac007b1b7d3b4746046e9220acf0d074c680648ac565e3fc61c36fde0c55536417eaa96bdd04e535c82b463d
|
data/LICENSE
CHANGED
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.10.
|
1
|
+
0.10.1
|
@@ -11,10 +11,17 @@ module Stealth
|
|
11
11
|
|
12
12
|
def run_catch_all(reason: nil)
|
13
13
|
error_level = fetch_error_level
|
14
|
-
Stealth::Logger.l(topic: "catch_all", message: "CatchAll #{
|
14
|
+
Stealth::Logger.l(topic: "catch_all", message: "CatchAll #{calculate_catch_all_state(error_level)} triggered for #{error_slug}: #{reason}")
|
15
15
|
|
16
|
-
if defined?(CatchAllsController)
|
17
|
-
|
16
|
+
if defined?(CatchAllsController) && defined?(CatchAllFlow)
|
17
|
+
catch_all_state = calculate_catch_all_state(error_level)
|
18
|
+
|
19
|
+
if CatchAllFlow.flow_spec.states.keys.include?(catch_all_state.to_sym)
|
20
|
+
step_to flow: 'catch_all', state: catch_all_state
|
21
|
+
else
|
22
|
+
# Jump to the last catch_all state if we are out of bounds
|
23
|
+
step_to flow: 'catch_all', state: CatchAllFlow.flow_spec.states.keys.last.to_s
|
24
|
+
end
|
18
25
|
end
|
19
26
|
end
|
20
27
|
|
@@ -43,7 +50,7 @@ module Stealth
|
|
43
50
|
['error', current_user_id, current_session.flow_string, current_session.state_string].join('-')
|
44
51
|
end
|
45
52
|
|
46
|
-
def
|
53
|
+
def calculate_catch_all_state(error_level)
|
47
54
|
"level#{error_level}"
|
48
55
|
end
|
49
56
|
|
@@ -90,7 +90,7 @@ module Stealth
|
|
90
90
|
run_callbacks :action do
|
91
91
|
begin
|
92
92
|
flow_controller.send(@action_name)
|
93
|
-
run_catch_all(reason: 'Did not send replies, update session, or step') unless progressed?
|
93
|
+
run_catch_all(reason: 'Did not send replies, update session, or step') unless flow_controller.progressed?
|
94
94
|
rescue StandardError => e
|
95
95
|
run_catch_all(reason: e.message)
|
96
96
|
end
|
data/lib/stealth/flow/base.rb
CHANGED
@@ -44,7 +44,7 @@ module Stealth
|
|
44
44
|
|
45
45
|
new_state = state.to_sym
|
46
46
|
unless states.include?(new_state)
|
47
|
-
raise(Stealth::Errors::InvalidStateTransition)
|
47
|
+
raise(Stealth::Errors::InvalidStateTransition, "Unknown state '#{state}' for #{self.class.to_s}")
|
48
48
|
end
|
49
49
|
@flow_state = new_state
|
50
50
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: stealth
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.10.
|
4
|
+
version: 0.10.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Mauricio Gomes
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-01-
|
11
|
+
date: 2018-01-10 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: sinatra
|