diffbroker 0.17.1 → 0.17.2

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: aadb0ca6d980e54bb60cfebac6989a09743a26b980263431c82d71f6f36b4cd1
4
- data.tar.gz: ba0393f8a4c2a06427e848cc1ded4e839238f9d4039815025b40cbee2a560333
3
+ metadata.gz: 24dbf68bc6fdacb58899e04d69497ed9d0a6980c85a6776c93c134ef7769ed4d
4
+ data.tar.gz: 749d3ae05641bfb67c8bc3d1b15afb65dd92f496a92d23870b73c1926b24f473
5
5
  SHA512:
6
- metadata.gz: b8382f66ce1144835f96907edbf49f16c2e8e05287934bedd832c34e36dc69fb351ec626c924c39279b5653dfeccf23241390439491d418c6fb103ccc4c58a05
7
- data.tar.gz: de18274bdd29606965514e7a4392ba3377b7fc9b9bd1baa27e8f4c9ec7169861caad8b9f32bc0f12f97815586e76aa75e5e592a5ef141cec4c3a85efc9570164
6
+ metadata.gz: ff9aa7e95e26b539367997d24c06637db9fa6186b02eff6e8f10eeee9fef518cc07b096c39da3de899a356d190e3c18e8de9beac768091e87a1c5cfd0dd004e4
7
+ data.tar.gz: 617654c889b195d025307e6d6bfb23b02bf692ac8e62f98b73ff7771a9a59bda0a39dc19ceaaff2ddb0214dc5b75976a9e367acca20e9882e302ee2cc20a3467
@@ -89,8 +89,7 @@ module Diffbroker
89
89
  path = definition_path
90
90
  FileUtils.mkdir_p(File.dirname(path))
91
91
  FileUtils.mkdir_p(File.join(@home, "Library", "Logs")) if @platform == "macos"
92
- File.write(path, @platform == "macos" ? plist : unit)
93
- File.chmod(0o600, path)
92
+ write_private(path, @platform == "macos" ? plist : unit)
94
93
  path
95
94
  end
96
95
 
@@ -227,6 +226,15 @@ module Diffbroker
227
226
  # systemd expands % specifiers and reads quotes and backslashes inside Environment="…".
228
227
  def unit_escape(value) = value.gsub(/[\\"%]/) { |char| char == "%" ? "%%" : "\\#{char}" }
229
228
 
229
+ # The file is born 0600 (a chmod afterwards would leave the token readable for a moment, and an existing file keeps
230
+ # its old mode) and replaces the old one in a single rename.
231
+ def write_private(path, text)
232
+ temp = "#{path}.new"
233
+ FileUtils.rm_f(temp)
234
+ File.open(temp, File::WRONLY | File::CREAT | File::EXCL, 0o600) { _1.write(text) }
235
+ File.rename(temp, path)
236
+ end
237
+
230
238
  def target = "gui/#{@uid}/#{LABEL}"
231
239
 
232
240
  # kickstart fails once the job was booted out (`stop!`): load it again, RunAtLoad starts it.
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Diffbroker
4
- VERSION = "0.17.1"
4
+ VERSION = "0.17.2"
5
5
  end
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "diffbroker",
3
- "version": "0.17.1",
3
+ "version": "0.17.2",
4
4
  "description": "Skills for working on Diff Broker agent tasks: the diffbroker MCP tools, write rules and report_task."
5
5
  }
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: diffbroker
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.17.1
4
+ version: 0.17.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Yuri Sidorov (@newstler)