akainaa 0.1.5 → 0.1.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +6 -0
- data/README.md +1 -0
- data/lib/akainaa/version.rb +1 -1
- data/lib/akainaa.rb +22 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 423527610c1fbb25d01ddfb555e6ea40f8a943001b04dc399682937353529a23
|
4
|
+
data.tar.gz: 70aab5713abf80fc2dd41783fb56b6e223d2d2549438640ca4916bf2f413cba6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 35978a5f110960e9c5f37e5d025efb6c40307fae6e4979a4e01f368802e230d8d3ae338f4dd1ef0370a8d69d66bbddd96d5860c65e559e49e0f56b52696cf14b
|
7
|
+
data.tar.gz: 92c0ac588743097d660462ee452438cbd3c98ae0933525689e4024b592c815dfc36e7696dffb4d3f33e44505d6d1ea291f7307b103013e29c6d70e066b9262b4
|
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,11 @@
|
|
1
1
|
## [Unreleased]
|
2
2
|
|
3
|
+
## [0.1.6] - 2024-09-11
|
4
|
+
|
5
|
+
- Feature: Add `clear` flag on first emit
|
6
|
+
- Feature: Add `trap_at_exit` option to `Akainaa.start` method
|
7
|
+
- Feature: Do not emit regularly if interval is 0 or nil
|
8
|
+
|
3
9
|
## [0.1.5] - 2024-09-10
|
4
10
|
|
5
11
|
- Bug fix: nested method call won't handled
|
data/README.md
CHANGED
data/lib/akainaa/version.rb
CHANGED
data/lib/akainaa.rb
CHANGED
@@ -27,6 +27,7 @@ module Akainaa
|
|
27
27
|
@ignore_files = Set.new(ignore_files)
|
28
28
|
@hide_not_executed_files = hide_not_executed_files
|
29
29
|
@monitor = Monitor.new
|
30
|
+
@first_emitted = false
|
30
31
|
|
31
32
|
Coverage.start(lines: true)
|
32
33
|
|
@@ -34,6 +35,12 @@ module Akainaa
|
|
34
35
|
option = default_online_emit.merge(online_emit)
|
35
36
|
FileUtils.mkdir_p(File.dirname(option[:path]))
|
36
37
|
start_multipart_emit(option)
|
38
|
+
|
39
|
+
if option[:trap_at_exit]
|
40
|
+
at_exit do
|
41
|
+
write_result(peek_result, option[:path])
|
42
|
+
end
|
43
|
+
end
|
37
44
|
end
|
38
45
|
end
|
39
46
|
|
@@ -52,15 +59,28 @@ module Akainaa
|
|
52
59
|
end
|
53
60
|
end
|
54
61
|
|
62
|
+
private def write_result(result, path)
|
63
|
+
puts "Writing coverage result to #{path}"
|
64
|
+
unless @first_emitted
|
65
|
+
puts "with clear flag"
|
66
|
+
result['clear'] = true
|
67
|
+
end
|
68
|
+
File.write(path, result.to_json)
|
69
|
+
@first_emitted = true
|
70
|
+
end
|
71
|
+
|
55
72
|
private def default_online_emit
|
56
73
|
{
|
57
74
|
mode: :file,
|
58
75
|
interval: 1,
|
59
76
|
path: 'tmp/coverage.json',
|
77
|
+
trap_at_exit: true,
|
60
78
|
}
|
61
79
|
end
|
62
80
|
|
63
81
|
private def start_multipart_emit(option)
|
82
|
+
return if option[:interval].nil? || option[:interval] <= 0
|
83
|
+
|
64
84
|
Thread.new do
|
65
85
|
@monitor.synchronize do
|
66
86
|
@previous_result = {}
|
@@ -92,7 +112,8 @@ module Akainaa
|
|
92
112
|
@monitor.synchronize do
|
93
113
|
@previous_result = current_result
|
94
114
|
end
|
95
|
-
|
115
|
+
|
116
|
+
write_result(diff, option[:path])
|
96
117
|
end
|
97
118
|
end
|
98
119
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: akainaa
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Shia
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-09-
|
11
|
+
date: 2024-09-11 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: Minimum rack middleware for coverage
|
14
14
|
email:
|