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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: d832438a096700948416cb8017a6dce26e9f5d9d9e3fbcb87b4ce7489d176715
4
- data.tar.gz: 526b39e7bcd2d1c684d0b5188ebbc03f2599033ed28036cecf164b1f82b7e54d
3
+ metadata.gz: f8b15b82b2a87742868a94cd6964469cb4aff857259d3752fe258e595f0dcfc1
4
+ data.tar.gz: cc35beef6a1b53c6f418337d1a59b48ce7d5152e1abf9746a0847fda08721bfc
5
5
  SHA512:
6
- metadata.gz: 43e4f48418d72b83666f225ba16fca6cbef1b0fec3cc42f8ca563c5a5f4c17818375433d5405ff7dda22090b7e5279080da69f854c0e64d6ea691189bc0a4ca0
7
- data.tar.gz: '089a473204356b7161945b1113037698a70bcdc521c5fb50cfbdf11e33bcea04bcefe2bbbf771bada372267cb277e6f12b1f92e960bb7191a526cfc2a37a07d0'
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
@@ -1,4 +1,4 @@
1
- Copyright 2021 Sarah Ridge
1
+ Copyright 2021-2025 Sarah Ridge
2
2
 
3
3
  Permission is hereby granted, free of charge, to any person obtaining
4
4
  a copy of this software and associated documentation files (the
@@ -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>-#{min_width(:path) + 1}s %<status>s",
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 min_width key
35
+ def min_path_width
35
36
  strings =
36
- data[:covered].map { |hash| hash[key] } +
37
- data[:ignored].map { |hash| hash[key] } +
38
- data[:uncovered].map { |hash| hash[key] }
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).size
41
+ @min_path_width ||= strings.max_by(&:length)&.size.to_i + 1
41
42
  end
42
43
 
43
44
  def final_output
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Swagcov
4
4
  module Version
5
- STRING = "0.8.0"
5
+ STRING = "0.8.1"
6
6
  end
7
7
  end
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.8.0
4
+ version: 0.8.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sarah Ridge