specguard-ruby 0.3.24 → 0.3.25

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: dd1e42b8014d4627c1126b81fd4e419e000316e788f0115a24dbbf9041ad52b1
4
- data.tar.gz: d74ca48cff5263d913f727a94d59b6bb6ffd477ff4a31bddcf7d83599b96f9c3
3
+ metadata.gz: 406d8e0f3f1d7df09e15238b5873d058c56f790a57abc2756c410071c804e24b
4
+ data.tar.gz: 35d3af2251ea0b454284702142d2c9eb3d91665ceb0ffa4ee5f419b7fd041f49
5
5
  SHA512:
6
- metadata.gz: 79519698cb6c136909f09bd425548bdac0e3ab936145449e983937d2f9f97e9f1e30e7f3bcd9936e1c200b2c49358157d9b97469804f3b11a200538557dc78f3
7
- data.tar.gz: c034dc9514a7cb085909a1bcdfb7c51e84dd67af457bbd73c26c4a4d31f21afae6c6893a7f42d2475dd350b80d0112879698ab5a912cf2dee5c83dfa7abc7c25
6
+ metadata.gz: 3674ff375d6f9b74fff339763fadf9d8852fb130e9456260f1d1258c070d31d1f7bee1bf72b3e9eede768bb0873e5583349fd49b7fa400eb0c7f1d913e147fed
7
+ data.tar.gz: 7fb0ad96d1a6dfb38378fa2d0df55c9fad1b8a8f8a19e5e5721a183a512af1c420d98c86f8827489b1ad95254fdfde9a6bb378e28c3fbe4a8bae163c70544f9c
data/README.md CHANGED
@@ -877,7 +877,9 @@ command draws. Everything else stays **byte for byte, in the file's order**:
877
877
 
878
878
  The rewrite is **atomic**: a temporary file in the same directory, renamed over
879
879
  the original, so a failure mid-drain leaves the file exactly as it was — and
880
- nothing is written at all unless something was actually accepted.
880
+ nothing is written at all unless something was actually accepted. The swap
881
+ also keeps the queue file's permissions, and when the queue path is a symlink
882
+ it rewrites the link's target rather than replacing the link.
881
883
 
882
884
  **The removal renumbers what it leaves.** The rewrite keeps the surviving lines
883
885
  byte for byte and in order, and packing them up from the top gives them new
@@ -1155,13 +1155,26 @@ module SpecGuard
1155
1155
  # The atomic swap: a temporary file in the SAME directory — `rename` is
1156
1156
  # only atomic within one filesystem — renamed over the original. A
1157
1157
  # failure at any point before the rename leaves the original untouched,
1158
- # and the `ensure` takes the temporary with it.
1158
+ # and the `ensure` takes the temporary with it. The rename lands on the
1159
+ # RESOLVED target (`File.realpath`), so a queue reached through a
1160
+ # symlink is rewritten at the file the link points to and the link
1161
+ # itself survives: `rename(2)` replaces the directory entry at the path
1162
+ # given to it, and without this the swap would turn the link into a
1163
+ # regular file while the real target kept every line just accepted —
1164
+ # lines the next drain would then send again. The replacement is
1165
+ # chmod'ed to the target's mode before the swap, because
1166
+ # `File.binwrite` creates it under the umask's defaults and a queue
1167
+ # restricted to 0600 would come back 0644 as a fresh inode. Ownership
1168
+ # is deliberately NOT carried over: `chown` needs privilege, and in
1169
+ # practice the drain runs as the queue's owner.
1159
1170
  def drain_write(path, content)
1160
- tmp = File.join(File.dirname(path),
1161
- ".#{File.basename(path)}.drain-#{Process.pid}-#{rand(1 << 32).to_s(36)}.tmp")
1171
+ target = File.realpath(path)
1172
+ tmp = File.join(File.dirname(target),
1173
+ ".#{File.basename(target)}.drain-#{Process.pid}-#{rand(1 << 32).to_s(36)}.tmp")
1162
1174
  begin
1163
1175
  File.binwrite(tmp, content)
1164
- File.rename(tmp, path)
1176
+ File.chmod(File.stat(target).mode & 0o7777, tmp)
1177
+ File.rename(tmp, target)
1165
1178
  ensure
1166
1179
  File.unlink(tmp) if File.exist?(tmp)
1167
1180
  end
@@ -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.24"
10
+ VERSION = "0.3.25"
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.24
4
+ version: 0.3.25
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-24 00:00:00.000000000 Z
11
+ date: 2026-09-25 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: json