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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 174416038d9f1cf9bfa5696e73974e403eb7d421965f76dd837703f843261199
4
- data.tar.gz: b4ea327876dec29a59f509ef5810494a92ef52a2887df476974e733ec25e03f9
3
+ metadata.gz: 986bc555540ee3b9bb56fe419a17469a512beab05c45e8affde03a5670944dda
4
+ data.tar.gz: 37620601b89345d56802951adf8fa5078833d9c0da46be611e62edf5fb632b23
5
5
  SHA512:
6
- metadata.gz: 389cf73420a4227d2d56425b4e776f5eac4166b6d012cd1d8df769d3d072c7f584b12395acad2871aeb84a968a0e6090456961ee1436ea424c3e69466c534cec
7
- data.tar.gz: b8d520d1664935772603e5fab35ad6a3ab3948f4aa3b2e6b79753c13e768abd1e5121285bcc324fef0c4de155071d4c7e19068fd5225e253f4f28e6a690ca6b1
6
+ metadata.gz: 3cea56ddbf45b1daa3f25aeb8facb84a2449acff5663203f01ae01e3228850038b7b6ae980d6a9d2ecf4a57f923cc3a2dc6b5332f6c46fed6cd67e4dcc253de6
7
+ data.tar.gz: 40522b20353e44192c9bc38d0a55c9a7a310187f8172320e20a9d09e34e3c9a6b93de7c102a95ea8571af22c52cdb094751e4adff4a4280050df6caa11f68bc4
@@ -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
- command %(sudo /bin/systemctl --no-pager #{state} #{background_worker_name})
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
- command %(sudo #{state} #{background_worker_name})
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
 
@@ -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
@@ -1,5 +1,5 @@
1
1
  module Mina
2
2
  module Infinum
3
- VERSION = '1.4.0'.freeze
3
+ VERSION = '1.4.1'.freeze
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mina-infinum
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.4.0
4
+ version: 1.4.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Stjepan Hadjic