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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 4fb43344c6f2a11991bd6ec2b71e7fabcb8a8c5f77bd2048cbac1f9c94b85448
4
- data.tar.gz: d8c9580c6701d82c50e11b96bd4bf0bc8fe9efeb98f7287057c6f8220519425d
3
+ metadata.gz: 16f323fa95fbafe93f7554b26b3bcfd77c64904541374d1bb2355625a0cf3456
4
+ data.tar.gz: 35af707d16f16b01da03cdc4c57601c62d7c33157604a5a539f3b3b313dcfc21
5
5
  SHA512:
6
- metadata.gz: b9420de8747442f0c2853caed136ac08bbd8066af4aa7d429efdec534a7e081b4a12b7bf7f5652de887f73c478a085f0f7032c34c5befd6b558b81128eff6583
7
- data.tar.gz: 1c78694729ccf6de3192648f1d0657fcf7cbcb3d471fbb82ffd4e18e6a9378a58eea0ea23a7ee057a6206ecd474bd56455506f765bef2fa1d9a2633644c012f2
6
+ metadata.gz: 1becfd3103d6e03e31e25b5cbfc16155792a6454d5052b85e4797d7d1597a25689dfc109597d115cd541c736eedb17c2b708cf6cd28089f13e8819b79cef62ac
7
+ data.tar.gz: 7a7be717e2bba29f50c16dcc0d4017cd9dc96a41618e65c8eeabec5a457de4da6891b190efe7a04464d2a447e4a81e55baf24b4546c37785022d1c9068f01a49
@@ -22,12 +22,16 @@ module Holdify
22
22
 
23
23
  @expected, @actual, @message = *args
24
24
 
25
- # Extend with features
26
- extend(Color) if Holdify.color
25
+ # Extend features
26
+ extend Color if Holdify.color
27
27
  return unless Holdify.git_diff
28
28
 
29
- extend GitDiff
30
- extend(Color::GitDiff) if Holdify.color
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 = 0
91
- lineno = [@yaml_lno - 1]
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} #{' ' * width}#{SGR[:clear]}"
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
@@ -7,7 +7,7 @@ require_relative 'holdify/store'
7
7
 
8
8
  # The container module
9
9
  module Holdify
10
- VERSION = '1.3.2'
10
+ VERSION = '1.3.3'
11
11
 
12
12
  @fresh_mutex = Mutex.new
13
13
  @fresh = []
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: minitest-holdify
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.3.2
4
+ version: 1.3.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Domizio Demichelis