swagcov 0.7.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 +9 -0
- data/LICENSE +1 -1
- data/lib/swagcov/coverage.rb +1 -1
- data/lib/swagcov/formatter/console.rb +7 -6
- data/lib/swagcov/version.rb +1 -1
- data/lib/swagcov.rb +4 -0
- metadata +2 -3
- data/Rakefile +0 -3
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,15 @@
|
|
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
|
+
|
9
|
+
## 0.8.0 (2025-04-22)
|
10
|
+
### Enhancement
|
11
|
+
- Reduce gem dependencies by replacing `rails` with `railties` ([#101](https://github.com/smridge/swagcov/pull/101))
|
12
|
+
- Remove unnecessary file from gem package ([#105](https://github.com/smridge/swagcov/pull/105))
|
13
|
+
|
5
14
|
## 0.7.0 (2025-04-18)
|
6
15
|
### Enhancement
|
7
16
|
- Add support for Ruby 3.5 ([#98](https://github.com/smridge/swagcov/pull/98))
|
data/LICENSE
CHANGED
data/lib/swagcov/coverage.rb
CHANGED
@@ -4,7 +4,7 @@ module Swagcov
|
|
4
4
|
class Coverage
|
5
5
|
attr_reader :dotfile
|
6
6
|
|
7
|
-
def initialize dotfile: ::Swagcov::Dotfile.new, routes: ::
|
7
|
+
def initialize dotfile: ::Swagcov::Dotfile.new, routes: ::Swagcov.project_routes
|
8
8
|
@dotfile = dotfile
|
9
9
|
@routes = routes
|
10
10
|
@data = {
|
@@ -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
data/lib/swagcov.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: swagcov
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.8.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Sarah Ridge
|
@@ -10,7 +10,7 @@ cert_chain: []
|
|
10
10
|
date: 1980-01-02 00:00:00.000000000 Z
|
11
11
|
dependencies:
|
12
12
|
- !ruby/object:Gem::Dependency
|
13
|
-
name:
|
13
|
+
name: railties
|
14
14
|
requirement: !ruby/object:Gem::Requirement
|
15
15
|
requirements:
|
16
16
|
- - ">="
|
@@ -32,7 +32,6 @@ files:
|
|
32
32
|
- CHANGELOG.md
|
33
33
|
- LICENSE
|
34
34
|
- README.md
|
35
|
-
- Rakefile
|
36
35
|
- lib/swagcov.rb
|
37
36
|
- lib/swagcov/command/generate_dotfile.rb
|
38
37
|
- lib/swagcov/command/generate_todo_file.rb
|
data/Rakefile
DELETED