test_bench-bootstrap 5.0.0 → 6.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. checksums.yaml +4 -4
  2. data/lib/test_bench/bootstrap.rb +24 -16
  3. metadata +1 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: febf97af4be1d698e916883487cabb3c97744fb131a21c0f90480615152cc2b2
4
- data.tar.gz: a4672760952c94f5d286ae7b805fb5f2f6331b9a528ffc89b5c997ced799d7d3
3
+ metadata.gz: a477bb3e37ba7658184cef18d64bb583ebc6b806450ac7d2b414551e9de7865e
4
+ data.tar.gz: 385937532fa15f4fb5b3a616ed1bbe685dbf75bbd062ce56d907a6a95adf99cd
5
5
  SHA512:
6
- metadata.gz: e2f01bb6c75c2634166590b1daae4befffdae3f4dd29db85e83bd379a9e783e6355c2b05c817040582604873d16da6a55d8c79b85cf382a2a5208bb4fe453603
7
- data.tar.gz: db121e97235618571c7fadc8478efb0e027873ba027acad04c1914963e4d9f5a3b08be94ad98a119f84a8454438933160bda71d1bf8eb76fdf003c24c9395a34
6
+ metadata.gz: bc54646b9be52b8f4d244cea662a7f18e4c4a757f16ba424c5855076428c75dec148d1ad4b5973b69d47c4f0c2e3d9cb9d594aa428f0a1505961213fb417abb2
7
+ data.tar.gz: ad3987c5017ebca65f1db95e436e9deef09a25746119389b2f57602f007933a1df9db5ed154d602f26e28711aaa4fe42b39ffa4289457bca4174ae32ffee3d03
@@ -151,30 +151,38 @@ module TestBench
151
151
  test(title)
152
152
  end
153
153
 
154
- def comment(text)
155
- Output.indent(text)
154
+ def comment(...)
155
+ detail(...)
156
156
  end
157
157
 
158
- def detail(text, *supplemental_lines, title: nil)
159
- if supplemental_lines.none? && title.nil?
160
- comment(text)
161
- return
158
+ def detail(detail, *additional_details, quote: nil, heading: nil)
159
+ details = [detail, *additional_details]
160
+
161
+ if quote.nil?
162
+ quote = details.last.end_with?("\n")
162
163
  end
163
164
 
164
- title = !text.end_with?("\n") if title.nil?
165
+ if quote
166
+ if heading.nil?
167
+ heading = !detail.end_with?("\n")
168
+ end
169
+ end
165
170
 
166
- if title
167
- title_text = text.chomp
168
- Output.indent(title_text, sgr_codes: [0x1, 0x4])
169
- else
170
- first_supplemental_line = text
171
- supplemental_lines.unshift(first_supplemental_line)
171
+ if heading
172
+ heading_text = details.shift
173
+ Output.indent(heading_text, sgr_codes: [0x1, 0x4])
172
174
  end
173
175
 
174
- supplemental_lines.each do |line|
175
- line.chomp!
176
+ details.each do |detail|
177
+ if quote
178
+ detail.each_line do |line|
179
+ line.chomp!
176
180
 
177
- Output.indent("\e[2m>\e[22m \e[3m#{line}\e[0m")
181
+ Output.indent("\e[2m>\e[22m \e[3m#{line}\e[0m")
182
+ end
183
+ else
184
+ Output.indent(detail)
185
+ end
178
186
  end
179
187
  end
180
188
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: test_bench-bootstrap
3
3
  version: !ruby/object:Gem::Version
4
- version: 5.0.0
4
+ version: 6.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Nathan Ladd