step-track 0.4.0 → 0.4.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/step_track/version.rb +1 -1
- data/lib/step_track.rb +8 -3
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ae905646f8383148b07b27620e6dcd11d0bf9830
|
4
|
+
data.tar.gz: b6de9e4901d83d3e340ee2cc0da0bc673da829f0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8b3d52bd83d3964229b20cea18e9d372bc5bf893ad1e561811fe7faa5fb578a7aebb45e8bd0bcf1b482a00bb00d0706e2d07214c0f1e29c2963718ecbc7c67d4
|
7
|
+
data.tar.gz: 8fdf95bdeb8036ef90bdbd488bca023ba1a0d609a1d5e06b877b783f9ad090dbd05a0b662673654d8867bffe6d9164b7121e4cc3cebebc8a21114b5640256ef0
|
data/lib/step_track/version.rb
CHANGED
data/lib/step_track.rb
CHANGED
@@ -4,14 +4,15 @@ module StepTrack
|
|
4
4
|
extend self
|
5
5
|
|
6
6
|
REF = "step_track/%{track}"
|
7
|
+
DEFAULT_CONFIG = {merge_key: :merge, error_key: :error}.freeze
|
7
8
|
|
8
|
-
def init(track, config={
|
9
|
+
def init(track, config={})
|
9
10
|
raise ArgumentError, "callback block required" unless block_given?
|
10
11
|
Thread.current[ref(track)] = {
|
11
12
|
steps: [],
|
12
13
|
callback: Proc.new,
|
13
14
|
time: Time.now
|
14
|
-
}.merge(config)
|
15
|
+
}.merge(DEFAULT_CONFIG).merge(config)
|
15
16
|
end
|
16
17
|
|
17
18
|
def push(track, name, payload={})
|
@@ -36,7 +37,11 @@ module StepTrack
|
|
36
37
|
steps = track_ref.delete(:steps)
|
37
38
|
steps.each { |step| step.delete(:time) }
|
38
39
|
result = {step_count: steps.count}
|
39
|
-
|
40
|
+
if err = steps.detect { |s| s.key?(track_ref[:error_key]) }
|
41
|
+
last_step = err.dup
|
42
|
+
else
|
43
|
+
last_step = steps.last&.dup || {}
|
44
|
+
end
|
40
45
|
last_step[:final_step_name] = last_step.delete(:step_name)
|
41
46
|
result.merge!(last_step)
|
42
47
|
steps.each_with_index do |step, i|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: step-track
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.4.
|
4
|
+
version: 0.4.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Matthias Geier
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2018-05-22 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: minitest
|
@@ -55,7 +55,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
55
55
|
version: '0'
|
56
56
|
requirements: []
|
57
57
|
rubyforge_project:
|
58
|
-
rubygems_version: 2.5.
|
58
|
+
rubygems_version: 2.5.2.3
|
59
59
|
signing_key:
|
60
60
|
specification_version: 4
|
61
61
|
summary: Tracks data fragments across the application
|