mina-infinum 1.4.0 → 1.4.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/mina/infinum/helpers.rb +15 -2
- data/lib/mina/infinum/tasks.rb +1 -12
- data/lib/mina/infinum/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 986bc555540ee3b9bb56fe419a17469a512beab05c45e8affde03a5670944dda
|
4
|
+
data.tar.gz: 37620601b89345d56802951adf8fa5078833d9c0da46be611e62edf5fb632b23
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3cea56ddbf45b1daa3f25aeb8facb84a2449acff5663203f01ae01e3228850038b7b6ae980d6a9d2ecf4a57f923cc3a2dc6b5332f6c46fed6cd67e4dcc253de6
|
7
|
+
data.tar.gz: 40522b20353e44192c9bc38d0a55c9a7a310187f8172320e20a9d09e34e3c9a6b93de7c102a95ea8571af22c52cdb094751e4adff4a4280050df6caa11f68bc4
|
data/lib/mina/infinum/helpers.rb
CHANGED
@@ -1,12 +1,25 @@
|
|
1
1
|
def background_worker(state)
|
2
2
|
ensure!(:background_worker)
|
3
3
|
ensure!(:application_name)
|
4
|
+
ensure!(:service_manager)
|
4
5
|
comment %(#{state}ing #{background_worker_name})
|
6
|
+
|
5
7
|
case fetch(:service_manager)
|
6
8
|
when :systemd
|
7
|
-
|
9
|
+
case state
|
10
|
+
when :status
|
11
|
+
command %(/bin/systemctl --no-pager #{state} #{background_worker_name})
|
12
|
+
else
|
13
|
+
command %(sudo /bin/systemctl #{state} #{background_worker_name})
|
14
|
+
end
|
15
|
+
|
8
16
|
when :upstart
|
9
|
-
|
17
|
+
case state
|
18
|
+
when :restart
|
19
|
+
command %(sudo stop #{background_worker_name} > /dev/null 2>&1; sudo start #{background_worker_name})
|
20
|
+
else
|
21
|
+
command %(sudo #{state} #{background_worker_name})
|
22
|
+
end
|
10
23
|
end
|
11
24
|
end
|
12
25
|
|
data/lib/mina/infinum/tasks.rb
CHANGED
@@ -7,21 +7,10 @@ task :restart_application do
|
|
7
7
|
end
|
8
8
|
|
9
9
|
namespace :background_workers do
|
10
|
-
[:start, :stop, :status].each do |state|
|
10
|
+
[:start, :stop, :status, :restart].each do |state|
|
11
11
|
desc "#{state.capitalize}ing background workers"
|
12
12
|
task state do
|
13
13
|
background_worker(state)
|
14
14
|
end
|
15
15
|
end
|
16
|
-
|
17
|
-
desc 'Restarting backgrond workers'
|
18
|
-
task :restart do
|
19
|
-
comment "Restarting #{background_worker_name}"
|
20
|
-
case fetch(:service_manager)
|
21
|
-
when :systemd
|
22
|
-
command %(sudo systemctl --no-pager restart #{background_worker_name})
|
23
|
-
when :upstart
|
24
|
-
command %(sudo stop #{background_worker_name} > /dev/null 2>&1; sudo start #{background_worker_name})
|
25
|
-
end
|
26
|
-
end
|
27
16
|
end
|
data/lib/mina/infinum/version.rb
CHANGED