minitest-holdify 1.3.2 → 1.3.3
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/lib/holdify/feedback.rb +13 -8
- data/lib/holdify.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: 16f323fa95fbafe93f7554b26b3bcfd77c64904541374d1bb2355625a0cf3456
|
|
4
|
+
data.tar.gz: 35af707d16f16b01da03cdc4c57601c62d7c33157604a5a539f3b3b313dcfc21
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 1becfd3103d6e03e31e25b5cbfc16155792a6454d5052b85e4797d7d1597a25689dfc109597d115cd541c736eedb17c2b708cf6cd28089f13e8819b79cef62ac
|
|
7
|
+
data.tar.gz: 7a7be717e2bba29f50c16dcc0d4017cd9dc96a41618e65c8eeabec5a457de4da6891b190efe7a04464d2a447e4a81e55baf24b4546c37785022d1c9068f01a49
|
data/lib/holdify/feedback.rb
CHANGED
|
@@ -22,12 +22,16 @@ module Holdify
|
|
|
22
22
|
|
|
23
23
|
@expected, @actual, @message = *args
|
|
24
24
|
|
|
25
|
-
# Extend
|
|
26
|
-
extend
|
|
25
|
+
# Extend features
|
|
26
|
+
extend Color if Holdify.color
|
|
27
27
|
return unless Holdify.git_diff
|
|
28
28
|
|
|
29
|
-
|
|
30
|
-
extend
|
|
29
|
+
@diff_yaml_headers = 2 # ----expected and +---actual (no sgr code) on 2 lines
|
|
30
|
+
extend GitDiff # rubocop:disable Layout/EmptyLinesAfterModuleInclusion
|
|
31
|
+
return unless Holdify.color
|
|
32
|
+
|
|
33
|
+
@diff_yaml_headers = 1 # ---expected---actual (with sgr codes) on single line
|
|
34
|
+
extend Color::GitDiff
|
|
31
35
|
end
|
|
32
36
|
|
|
33
37
|
def message = [@message, *file_refs, *diff, ''].join("\n")
|
|
@@ -87,14 +91,15 @@ module Holdify
|
|
|
87
91
|
end
|
|
88
92
|
|
|
89
93
|
def process_lines(lines)
|
|
90
|
-
width
|
|
91
|
-
lineno
|
|
94
|
+
width = 0
|
|
95
|
+
lineno = [@yaml_lno - 1]
|
|
92
96
|
lines.map.with_index do |line, i|
|
|
93
97
|
if i.zero? # @@ ... @@
|
|
94
98
|
width, line = render_hunk(line)
|
|
95
99
|
next line
|
|
100
|
+
elsif i <= @diff_yaml_headers # ---
|
|
101
|
+
next
|
|
96
102
|
end
|
|
97
|
-
next if i == 1 || (i == 2 && !Holdify.color) # ---
|
|
98
103
|
|
|
99
104
|
render_line(line, lineno, width)
|
|
100
105
|
end.compact
|
|
@@ -156,7 +161,7 @@ module Holdify
|
|
|
156
161
|
|
|
157
162
|
sgr = SGR[color].to_s if color
|
|
158
163
|
gutter = if added
|
|
159
|
-
"#{sgr}#{type}
|
|
164
|
+
"#{sgr}#{type}#{' ' * width}#{SGR[:clear]}"
|
|
160
165
|
else
|
|
161
166
|
lineno[0] += 1
|
|
162
167
|
"#{sgr}#{type || ' '}#{lineno[0].to_s.rjust(width)}#{SGR[:clear]}"
|
data/lib/holdify.rb
CHANGED