swagcov 0.8.0 → 0.8.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 +4 -4
- data/CHANGELOG.md +4 -0
- data/LICENSE +1 -1
- data/lib/swagcov/formatter/console.rb +7 -6
- data/lib/swagcov/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f8b15b82b2a87742868a94cd6964469cb4aff857259d3752fe258e595f0dcfc1
|
4
|
+
data.tar.gz: cc35beef6a1b53c6f418337d1a59b48ce7d5152e1abf9746a0847fda08721bfc
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4c1c0133c991c4dea09e0120aa54eab71b59746c5a9ec4e1718a2fc21d86802dec7b51039bfde1638fd9055932d1fc93a958285400fa9cb777378e5c02e91851
|
7
|
+
data.tar.gz: 00c4c6b3508b19cb0f2c89debfc920c6aa234a4e9ec5142a11cc5995fed34d255eb70000e482d47c50a7d4f88ab026b27592b7cd1f143add31d777c48898533a
|
data/CHANGELOG.md
CHANGED
@@ -2,6 +2,10 @@
|
|
2
2
|
## main (unreleased)
|
3
3
|
-
|
4
4
|
|
5
|
+
## 0.8.1 (2025-04-29)
|
6
|
+
### Fix
|
7
|
+
- Performance of coverage output by memoizing path string length ([#108](https://github.com/smridge/swagcov/pull/108))
|
8
|
+
|
5
9
|
## 0.8.0 (2025-04-22)
|
6
10
|
### Enhancement
|
7
11
|
- Reduce gem dependencies by replacing `rails` with `railties` ([#101](https://github.com/smridge/swagcov/pull/101))
|
data/LICENSE
CHANGED
@@ -10,6 +10,7 @@ module Swagcov
|
|
10
10
|
end
|
11
11
|
|
12
12
|
def run
|
13
|
+
min_path_width
|
13
14
|
routes_output(data[:covered], "green")
|
14
15
|
routes_output(data[:ignored], "yellow")
|
15
16
|
routes_output(data[:uncovered], "red")
|
@@ -24,20 +25,20 @@ module Swagcov
|
|
24
25
|
routes.each do |route|
|
25
26
|
$stdout.puts(
|
26
27
|
format(
|
27
|
-
"%<verb>10s %<path>-#{
|
28
|
+
"%<verb>10s %<path>-#{@min_path_width}s %<status>s",
|
28
29
|
{ verb: route[:verb], path: route[:path], status: route[:status].send(status_color) }
|
29
30
|
)
|
30
31
|
)
|
31
32
|
end
|
32
33
|
end
|
33
34
|
|
34
|
-
def
|
35
|
+
def min_path_width
|
35
36
|
strings =
|
36
|
-
data[:covered].map { |hash| hash[
|
37
|
-
data[:ignored].map { |hash| hash[
|
38
|
-
data[:uncovered].map { |hash| hash[
|
37
|
+
data[:covered].map { |hash| hash[:path] } +
|
38
|
+
data[:ignored].map { |hash| hash[:path] } +
|
39
|
+
data[:uncovered].map { |hash| hash[:path] }
|
39
40
|
|
40
|
-
strings.max_by(&:length).
|
41
|
+
@min_path_width ||= strings.max_by(&:length)&.size.to_i + 1
|
41
42
|
end
|
42
43
|
|
43
44
|
def final_output
|
data/lib/swagcov/version.rb
CHANGED