mina-puma 0.0.10 → 0.1.0

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
  SHA1:
3
- metadata.gz: d4e515893bb0511bd463e93fda214bdc26e56ffc
4
- data.tar.gz: 7a923340a7e2c5a859d0732a820b45e7863583dd
3
+ metadata.gz: c68864f1dc2893df94157667a384d239f553abc3
4
+ data.tar.gz: 6011e5b815f40a885b5f952d2f686f2ea1de2c1b
5
5
  SHA512:
6
- metadata.gz: 24b077c9d7b907ff73d6bccb0048596701952071363545996b1d81bbfb0cab5bdc37dfc78670bac7aa04d5b193116fbaf5b16d8e99f842b08bb4f6e4d634f7e7
7
- data.tar.gz: 14d90cbba5c5faca762e148cb1ed751d9e6efa575bb4fe3d2604d6e04bef23404528e92ca4df751483fb85e8d51264d998e553a9e0d919454e78687daebf4f23
6
+ metadata.gz: fb8818233cf6c6aac522d6e7a460de8c32a3468b87f7e44410fdab64c494c4e5d0f4a4bcdfb9f0a8a5706806fbbce59a33d164980e804590ee0a2b8e9abfbbf6
7
+ data.tar.gz: 8453b5a1931f663233f1192c5ff07d16f66721f264454f3a67f73c42cd13b9da6a99a74ed7d9adbaaf6ed40dba69d6980a92ff30fb4aa891c0317528afade5b2
@@ -16,42 +16,33 @@ namespace :puma do
16
16
 
17
17
  desc 'Start puma'
18
18
  task :start => :environment do
19
- in_directory "#{deploy_to}/#{current_path}" do
20
- queue! %(#{puma_cmd} #{start_options})
21
- end
19
+ queue! %[
20
+ if [ -e '#{pumactl_socket}' ]; then
21
+ echo 'Puma is already running!';
22
+ else
23
+ if [ -e '#{puma_config}' ]; then
24
+ cd #{deploy_to}/#{current_path} && #{puma_cmd} -q -d -e #{puma_env} -C #{puma_config}
25
+ else
26
+ cd #{deploy_to}/#{current_path} && #{puma_cmd} -q -d -e #{puma_env} -b 'unix://#{puma_socket}' -S #{puma_state} --control 'unix://#{pumactl_socket}'
27
+ fi
28
+ fi
29
+ ]
22
30
  end
23
31
 
24
32
  desc 'Stop puma'
25
33
  task stop: :environment do
26
- in_directory "#{deploy_to}/#{current_path}" do
27
- queue! %(#{pumactl_cmd} -S #{puma_state} stop)
28
- end
34
+ queue! %[
35
+ if [ -e '#{pumactl_socket}' ]; then
36
+ cd #{deploy_to}/#{current_path} && #{pumactl_cmd} -S #{puma_state} stop
37
+ else
38
+ echo 'Puma is not running!';
39
+ fi
40
+ ]
29
41
  end
30
42
 
31
43
  desc 'Restart puma'
32
44
  task restart: :environment do
33
- in_directory "#{deploy_to}/#{current_path}" do
34
- if check_exists?(pumactl_socket)
35
- queue! %(#{pumactl_cmd} -S #{puma_state} stop)
36
- queue! %(#{puma_cmd} #{start_options})
37
- else
38
- queue! %(#{puma_cmd} #{start_options})
39
- end
40
- end
45
+ invoke :'puma:stop'
46
+ invoke :'puma:start'
41
47
  end
42
-
43
- private
44
-
45
- def start_options
46
- if check_exists?(puma_config)
47
- "-q -d -e #{puma_env} -C #{puma_config}"
48
- else
49
- "-q -d -e #{puma_env} -b 'unix://#{puma_socket}' -S #{puma_state} --control 'unix://#{pumactl_socket}'"
50
- end
51
- end
52
-
53
- def check_exists?(file)
54
- boolean = capture("if [ -e '#{file}' ]; then echo 'yes'; else echo 'no'; fi").chomp
55
- boolean == 'yes' ? true : false
56
- end
57
- end
48
+ end
@@ -1,5 +1,5 @@
1
1
  module Mina
2
2
  module Puma
3
- VERSION = "0.0.10"
3
+ VERSION = "0.1.0"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mina-puma
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.10
4
+ version: 0.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tobias Sandelius