botiasloop 0.0.8 → 0.0.9

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: ba01f2452180ebb24a1591bfb93528dab2efbd470466fead4b1528c5137f7227
4
- data.tar.gz: c671cfe22c9958e1582e2fd514758a341c08fc2820450c87d09ec6d9857a4cbc
3
+ metadata.gz: dbb8e390c2b92efbef4ef3dc885ee7be2725dbb0e19736b2a594b228426dff42
4
+ data.tar.gz: 0ae9c7ee8516368ca84a3834219abca4e249bb96b255906f51ab8f92d250af7c
5
5
  SHA512:
6
- metadata.gz: b07dac2f185210185d3c6c92d059494775ee095ac414199bedc5c9a16788fc54ea1a8b174ef2486b21492c964498aa1a0ecb6b5babd28c4fee8dd670b52a7dfc
7
- data.tar.gz: c31d1d531a1a8215d7115cb33a92fe0888d240471965aa30008c178358c612baa84e39e652714afb3960ad9a5a833fe9830127f1b0a02f43659696cf78ad373b
6
+ metadata.gz: 4cff18b6b793a684001b9d912de2df8a8fbb323ced49232bd871b6fef9498828b744229314a62a4c023b5494c203e8d7ed70c67b702197bc83e6846106ec81e0
7
+ data.tar.gz: 23c31635ff9ef00d1652a79b0cb3ad83bf08f5aa7ebf83d34ac5a99c6890502674562c912199ba83f0347fa019cfa29ada1ad0cd305b833b601abdb321487efe
@@ -235,6 +235,17 @@ module Botiasloop
235
235
  File.join(systemd_user_dir, SERVICE_NAME)
236
236
  end
237
237
 
238
+ # Get the botiasloop binary path for ExecStart
239
+ #
240
+ # @return [String] Path to botiasloop binary
241
+ def binary_path
242
+ ENV["PATH"].split(":").each do |dir|
243
+ path = File.join(dir, "botiasloop")
244
+ return path if File.executable?(path)
245
+ end
246
+ raise SystemdError, "botiasloop not found in PATH"
247
+ end
248
+
238
249
  # Generate the service file content
239
250
  #
240
251
  # @return [String] systemd service unit content
@@ -247,35 +258,17 @@ module Botiasloop
247
258
 
248
259
  [Service]
249
260
  Type=simple
250
- ExecStart=#{executable_path} gateway
261
+ ExecStart=#{binary_path} gateway
251
262
  Restart=on-failure
252
263
  RestartSec=5
253
264
  StandardOutput=journal
254
265
  StandardError=journal
255
- Environment="PATH=#{ruby_bin_path}:/usr/local/bin:/usr/bin:/bin"
256
266
 
257
267
  [Install]
258
268
  WantedBy=default.target
259
269
  SERVICE
260
270
  end
261
271
 
262
- # Get the path to the botiasloop executable
263
- #
264
- # @return [String] Path to botiasloop binary
265
- def executable_path
266
- Gem.bin_path("botiasloop", "botiasloop")
267
- rescue Gem::Exception
268
- # Fallback to searching in PATH
269
- `which botiasloop 2>/dev/null`.strip
270
- end
271
-
272
- # Get the Ruby bin directory for PATH
273
- #
274
- # @return [String] Path to Ruby bin directory
275
- def ruby_bin_path
276
- File.dirname(RbConfig.ruby)
277
- end
278
-
279
272
  # Execute a systemctl command
280
273
  #
281
274
  # @param args [Array<String>] Arguments to pass to systemctl
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Botiasloop
4
- VERSION = "0.0.8"
4
+ VERSION = "0.0.9"
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: botiasloop
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.8
4
+ version: 0.0.9
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tobias Feistmantl