capistrano-solid_queue 0.1.0 → 0.1.1

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: d4ca4bdb0350bc571d3b3f888d53331863639948e3eaeed1ce2b7854f2b5955a
4
- data.tar.gz: 4032721e0def7e6cfd673754d3327df4bffb4ae6c1273aff193887007cce6b85
3
+ metadata.gz: ab57e5cd0d1bf9a277206e00443219bc7b1ea33f227a8b32f3bbf3898b8c25a0
4
+ data.tar.gz: 9cc716786055b8448642a69988a16ef0529269248ac9168ac041fd188d7b439f
5
5
  SHA512:
6
- metadata.gz: 1072a98ca0a2485956334d46f4f857369c9643f05c0e49e63a83ec61a998f980751843a4531aef5f6aff988b25aec6731b890bebe334f3b1e75e7b87511127e5
7
- data.tar.gz: 0bc1d5232c7a61fc18802401e7d0d7bcaec9b84cc5e37b0b8e28cc1bd086e7905f63c92def2aba1457847bcca90f21e23aed0a67babd84e0bac1f6ee1fea3a0a
6
+ metadata.gz: fe9e90b7beb2ca985e294174f4f50f6421683c42e8fc467f1aa49b90e10b2d025599b6256c5354a8e8218c0073e154b395b3391cc778a6a5405331dbb7ef229f
7
+ data.tar.gz: 90e09e0115e8cf76d4647d0f303ad68251f0f571c7d15042c4fec9ebe2327f5d31482009e647eecea12b82170146cffcc5a1c78baf323f58403d3ace2a7343f3
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Capistrano
4
4
  module SolidQueue
5
- VERSION = "0.1.0"
5
+ VERSION = "0.1.1"
6
6
  end
7
7
  end
@@ -25,8 +25,25 @@ module Capistrano
25
25
  end
26
26
 
27
27
  def execute_systemd(*args, raise_on_non_zero_exit: true)
28
- command = ["/bin/systemctl", "--user"] + args
29
- backend.execute(*command, raise_on_non_zero_exit: raise_on_non_zero_exit)
28
+ sudo_if_needed(*systemd_command(*args), raise_on_non_zero_exit: true)
29
+ end
30
+
31
+ def sudo_if_needed(*command, raise_on_non_zero_exit: true)
32
+ if fetch(:solid_queue_systemctl_user) == :system
33
+ backend.sudo command.map(&:to_s).join(" ")
34
+ else
35
+ backend.execute(*command, raise_on_non_zero_exit: raise_on_non_zero_exit)
36
+ end
37
+ end
38
+
39
+ def systemd_command(*args)
40
+ command = ['/bin/systemctl']
41
+
42
+ unless fetch(:solid_queue_systemctl_user) == :system
43
+ command << "--user"
44
+ end
45
+
46
+ command + args
30
47
  end
31
48
 
32
49
  def fetch_systemd_unit_path
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: capistrano-solid_queue
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Brice TEXIER
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2024-04-22 00:00:00.000000000 Z
11
+ date: 2025-03-27 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: capistrano
@@ -65,7 +65,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
65
65
  - !ruby/object:Gem::Version
66
66
  version: '0'
67
67
  requirements: []
68
- rubygems_version: 3.3.26
68
+ rubygems_version: 3.5.22
69
69
  signing_key:
70
70
  specification_version: 4
71
71
  summary: Adds support for SolidQueue to Capistrano 3.x