currentsh 0.3.0 → 0.3.1

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: c4f702d9774084c47f2c4cc5c03d8c30adb4a1f3
4
- data.tar.gz: bd38902531b45780da0fa1b171e752be475418c9
3
+ metadata.gz: 7727e0736a3df105e925bd84bba64039dd37db5d
4
+ data.tar.gz: dc6881b53831dcd5958ee69d6879b468dd6c9925
5
5
  SHA512:
6
- metadata.gz: 5567fbc614ca388e8bb2378044a72a02cdd5c99e0c27c8183133e859378aabadac9266a82cb7fde71a5656ac549a78000e101e99da7cec8cf9d295b7a72a2850
7
- data.tar.gz: 4520830c7bed4048a089cbb38c913fe10eacb3c7adf931119454a746b53d7b07afc9accea9fc09a7368ed43ce033a158e56ceb6e4121f9b9f33d628d9e440bc0
6
+ metadata.gz: 9bc02a02774cd334e784797df3e654f4966739cfc74f329c836bc74d6a9000a4c3e04de8630a7a8e871896e6104f8c4ba80c049853804601745dea8cbb9d0ca8
7
+ data.tar.gz: 0dc0563a0ddcc6430e947b6c6044f7292c88cfd33b5263c6fbb8d02e43e55c0a86e01ebb246b08ba6b42c73f0ea77e516598bcee855adef007b2937f8b53c48e
@@ -14,8 +14,14 @@ module Currentsh
14
14
  end
15
15
 
16
16
  LogOutput.with_context(context) do
17
+
18
+ lc = {
19
+ process: ::Process.pid,
20
+ thread: Thread.current.object_id.to_s(36)
21
+ }.merge(context)
22
+
17
23
  begin
18
- ts = start context
24
+ ts = start lc
19
25
 
20
26
  yield
21
27
  rescue StandardError => ex
@@ -23,11 +29,11 @@ module Currentsh
23
29
  when Interrupt, SystemExit, SignalException
24
30
  raise ex
25
31
  else
26
- error context, ex, ts
32
+ error lc, ex, ts
27
33
  raise ex
28
34
  end
29
35
  else
30
- stop context, ts
36
+ stop lc, ts
31
37
  end
32
38
  end
33
39
  end
@@ -36,9 +42,6 @@ module Currentsh
36
42
  time = Time.now
37
43
 
38
44
  data = {
39
- time: time,
40
- process: ::Process.pid,
41
- thread: Thread.current.object_id.to_s(36),
42
45
  event: "start",
43
46
  }.merge!(context)
44
47
 
@@ -49,9 +52,6 @@ module Currentsh
49
52
 
50
53
  def error(context, error, start)
51
54
  data = {
52
- time: Time.now,
53
- process: ::Process.pid,
54
- thread: Thread.current.object_id.to_s(36),
55
55
  event: "error",
56
56
  error: error.to_s,
57
57
  elapse: (Time.now - start)
@@ -62,9 +62,6 @@ module Currentsh
62
62
 
63
63
  def stop(context, start)
64
64
  data = {
65
- time: Time.now,
66
- process: ::Process.pid,
67
- thread: Thread.current.object_id.to_s(36),
68
65
  event: "stop",
69
66
  elapse: (Time.now - start)
70
67
  }.merge!(context)
@@ -1,3 +1,3 @@
1
1
  module Currentsh
2
- VERSION = "0.3.0"
2
+ VERSION = "0.3.1"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: currentsh
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.0
4
+ version: 0.3.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Evan Phoenix