specguard-ruby 0.3.10 → 0.3.11

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: c7d1dfb3eb7af542eee8c1202dae06dd0d9c3981f5415d12875037c9a9067944
4
- data.tar.gz: 9d785e02b70ea9e06b0d0cf55ce31cbb1d67c841ea36fb0b7f3c7217a8f20304
3
+ metadata.gz: e274f554d8e8271f6fe4b096963e59a1a58579a2c09b772eaded70a7a0a4fbd5
4
+ data.tar.gz: f967409a020a45d16f79b53edf89edae5c04f9a80118169ffc774ea8d4b772f5
5
5
  SHA512:
6
- metadata.gz: 3d5ae9e309ae02ea33679223f712d04edf7c9e06aab22f011fde61484f2f3c8d2c992b02b792caceeb934b63136734840cdd01d0dbe62619b695dd09c3ceb238
7
- data.tar.gz: 3d3f373483219a5cdbeecdf639065bd99cb90dd648acf4bd75174ae9eba6adefcfc94a6458577480bb526dc636d88b139a4742cda3c12269a320bd5e7f994a3f
6
+ metadata.gz: 6fd5fae21c02ed7bafd55e59f17ed26ab25f383330fd43d7220cc1c584f88101f19534e108fa2eb762d992d7f73a307011f589bd6c84d1fb5551db52e76672f3
7
+ data.tar.gz: aa9e90a632a41dd09033517f20afbb80b6b2169990365ea73a6d6bd0a457afb2fab17eb3260b3ac07698898e1b0226b215df88fb06c139e7bc236802c493e0fd
@@ -225,9 +225,18 @@ module SpecGuard
225
225
  #
226
226
  # Under `--json` the count is not dropped, it MOVES: stdout carries one
227
227
  # document and nothing else, and this line's number is that document's
228
- # `summary.files`. The warnings are diagnostics about the linter rather
229
- # than findings, so they stay on stderr exactly as they are a run that
230
- # selected nothing is still loud, in both renderers.
228
+ # `summary.files`. The sentence branches by STREAM, not by content: the
229
+ # human renderer reads it on stdout, the json renderer on stderr, where
230
+ # diagnostics about the linter already live the empty-selection
231
+ # warning is the precedent, SPGD-247 the doctrine. (SPGD-1134: this was
232
+ # an `elsif !json` suppression, which left a json run's selection
233
+ # unverifiable — the machine channel named neither its resolved base nor
234
+ # its untracked leg, so the bridge, which passes `--json`
235
+ # unconditionally, could only verify the diff ∪ untracked union by
236
+ # arithmetic on `summary.files`.) The warnings below are diagnostics
237
+ # about the linter rather than findings, so they stay on stderr exactly
238
+ # as they are — a run that selected nothing is still loud, in both
239
+ # renderers.
231
240
  #
232
241
  # The `--changed` count names its provenance: files can reach the
233
242
  # selection through the untracked leg (`file_selector.rb`), and "changed
@@ -239,15 +248,24 @@ module SpecGuard
239
248
  if selection.empty?
240
249
  @stderr.puts "specguard-lint: warning: selected 0 spec files — #{empty_reason(selection)}"
241
250
  @stderr.puts "specguard-lint: warning: #{selection.note}" if selection.note
242
- elsif !json
243
- untracked = selection.mode == :changed ? selection.stats&.untracked.to_i : 0
244
- @stdout.puts "specguard-lint: checked #{selection.count} spec file#{'s' unless selection.count == 1}" \
245
- "#{" changed since #{selection.base}" if selection.mode == :changed}" \
246
- "#{" under #{Dir.pwd}" if selection.mode == :all}" \
247
- "#{" including #{untracked} untracked" if untracked.positive?}"
251
+ else
252
+ json ? @stderr.puts(selection_line(selection)) : @stdout.puts(selection_line(selection))
248
253
  end
249
254
  end
250
255
 
256
+ # The selection sentence, built at exactly one site and written by both
257
+ # renderers — only the stream differs. The human line is the contract
258
+ # of record; the json renderer printing the SAME bytes is what makes
259
+ # "the machine reads the provenance the human does" a property of the
260
+ # code rather than a promise two copies could drift apart on.
261
+ def selection_line(selection)
262
+ untracked = selection.mode == :changed ? selection.stats&.untracked.to_i : 0
263
+ "specguard-lint: checked #{selection.count} spec file#{'s' unless selection.count == 1}" \
264
+ "#{" changed since #{selection.base}" if selection.mode == :changed}" \
265
+ "#{" under #{Dir.pwd}" if selection.mode == :all}" \
266
+ "#{" including #{untracked} untracked" if untracked.positive?}"
267
+ end
268
+
251
269
  # `:explicit` is absent by construction — an explicit Selection is only
252
270
  # built from a non-empty file list, so it can never be empty.
253
271
  def empty_reason(selection)
@@ -7,5 +7,5 @@
7
7
  # framework-scoped version constant a lie, so the number moved here and the
8
8
  # rspec module now points at it for back-compat.
9
9
  module SpecGuard
10
- VERSION = "0.3.10"
10
+ VERSION = "0.3.11"
11
11
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: specguard-ruby
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.10
4
+ version: 0.3.11
5
5
  platform: ruby
6
6
  authors:
7
7
  - specguard Agent
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2026-09-14 00:00:00.000000000 Z
11
+ date: 2026-09-15 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: json