mina-puma 0.0.5 → 0.0.6

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
  SHA1:
3
- metadata.gz: 13a02952c20112fe90fea09fbfe7bb19643d4229
4
- data.tar.gz: 61481a3b23aa910fa02a51a12b60106586a622a6
3
+ metadata.gz: 64507fce87b0467be63a81f7acfb952d19476e66
4
+ data.tar.gz: 7f57c5e069b956d7e9c8834fbbc3ca4a7cb8b90b
5
5
  SHA512:
6
- metadata.gz: a3f525821c96e3dd497bcb5eaeaa1955e898c7c95c60f368aeb2d30d0c66d52345843a2aef3c8ac2755435e4bf06da319fbaab1ee50cbf42485cfeee818ef699
7
- data.tar.gz: f25d35111cd2c192d161a1616c19d40f9d3f3a6f8b90571ca05e6b04173302ccf70111bcdfc71003f1d5442bc2dfe5e7bb4aaa0dc7a344ecfb64664978c076b3
6
+ metadata.gz: 143ce3a9acbc2274afe6e3605fc5254afdca9a349bda0d6120435fd794b811d8b49026b1b92668ef8900a4a56b864bf8dc3b5a260b84118444a32580e7091e61
7
+ data.tar.gz: 919a68331f02d374be14c005156129fb67f59f75bb6de319ae7048b86870fd04a251cc9070d5c07151b8a3814ffa1aa0b1864142cf365310db51584e4047cf24
data/README.md CHANGED
@@ -15,27 +15,22 @@ Add this line to your application's Gemfile:
15
15
  require 'mina/puma'
16
16
 
17
17
  # Add pids and sockets to shared paths
18
- set :shared_paths, %w(log tmp/pids tmp/sockets config/database.yml)
18
+ set :shared_paths, %w(log tmp/sockets config/database.yml)
19
19
 
20
20
  ...
21
21
  task :setup do
22
22
  ...
23
- queue! %[mkdir -p "{deploy_to}/shared/tmp/pids/"]
24
23
  queue! %[mkdir -p "{deploy_to}/shared/tmp/sockets/"]
25
24
  end
26
25
 
27
26
  task :deploy do
28
27
  deploy do
29
- to :prepare do
30
- invoke :'puma:stop'
31
- end
32
-
33
28
  invoke :'git:clone'
34
29
  ...
35
30
 
36
31
  to :launch do
37
32
  ...
38
- invoke :'puma:start'
33
+ invoke :'puma:restart'
39
34
  end
40
35
  end
41
36
  end
@@ -48,8 +43,9 @@ Available commands:
48
43
 
49
44
  Default settings:
50
45
 
51
- set :puma_pid, "#{deploy_to}/#{shared_path}/tmp/pids/puma.pid"
52
- set :puma_socket, "#{deploy_to}/#{shared_path}/tmp/sockets/puma.sock"
46
+ set :puma_socket, -> { "#{deploy_to}/#{shared_path}/tmp/sockets/puma.sock" }
47
+ set :puma_ctl, -> { "#{deploy_to}/#{shared_path}/tmp/sockets/pumactl.sock" }
48
+ set :puma_state, -> { "#{deploy_to}/#{shared_path}/tmp/sockets/puma.state" }
53
49
 
54
50
  ## Contributing
55
51
 
@@ -1,51 +1,35 @@
1
- # ## Usage example
2
- # require 'mina/puma'
3
- # ...
4
- # task :setup do
5
- # queue! %[mkdir -p "#{deploy_to}/shared/tmp/pids/"]
6
- # queue! %[mkdir -p "#{deploy_to}/shared/tmp/sockets/"]
7
- # end
8
- #
9
- # task :deploy do
10
- # deploy do
11
- # to :prepare do
12
- # invoke :'puma:stop'
13
- # end
14
- #
15
- # invoke :'git:clone'
16
- # ...
17
- #
18
- # to :launch do
19
- # ...
20
- # invoke :'puma:start'
21
- # end
22
- # end
23
- # end
24
-
25
- set_default :puma_pid, -> { "#{deploy_to}/#{shared_path}/tmp/pids/puma.pid" }
26
1
  set_default :puma_socket, -> { "#{deploy_to}/#{shared_path}/tmp/sockets/puma.sock" }
2
+ set_default :puma_ctl, -> { "#{deploy_to}/#{shared_path}/tmp/sockets/pumactl.sock" }
3
+ set_default :puma_state, -> { "#{deploy_to}/#{shared_path}/tmp/sockets/puma.state" }
4
+
27
5
 
28
6
  namespace :puma do
29
7
  desc 'Start puma'
30
8
  task start: :environment do
31
- queue %[cd #{deploy_to}/#{current_path} && bundle exec puma -q -d -e #{rails_env} -b unix://#{puma_socket} --pidfile #{puma_pid}]
9
+ queue %[cd #{deploy_to}/#{current_path} && bundle exec puma #{start_options}]
32
10
  end
33
11
 
34
12
  desc 'Stop puma'
35
13
  task stop: :environment do
36
- queue %{
37
- if [[ -f #{puma_pid} ]]; then
38
- kill -9 `cat #{puma_pid}` && rm #{puma_pid}
39
- fi
40
- if [[ -f #{puma_socket} ]]; then
41
- rm #{puma_socket}
42
- fi
43
- }
14
+ queue %[cd #{deploy_to}/#{current_path} && bundle exec pumactl -S #{puma_state} stop]
44
15
  end
45
16
 
46
17
  desc 'Restart puma'
47
18
  task restart: :environment do
48
- invoke :'puma:stop'
49
- invoke :'puma:start'
19
+ queue %[
20
+ if [ -f #{puma_ctl} ]; then
21
+ cd #{deploy_to}/#{current_path} && bundle exec pumactl -S #{puma_state} restart
22
+ else
23
+ cd #{deploy_to}/#{current_path} && bundle exec puma #{start_options}
24
+ fi
25
+ ]
26
+ end
27
+ end
28
+
29
+ def start_options
30
+ if File.exists?("./config/puma.rb")
31
+ "-q -d -e #{rails_env} -C ./config/puma.rb"
32
+ else
33
+ "-q -d -e #{rails_env} -b 'unix://#{puma_socket}' -S #{puma_state} --control 'unix://#{puma_ctl}'"
50
34
  end
51
35
  end
@@ -1,5 +1,5 @@
1
1
  module Mina
2
2
  module Puma
3
- VERSION = "0.0.5"
3
+ VERSION = "0.0.6"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,69 +1,69 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mina-puma
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.5
4
+ version: 0.0.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tobias Sandelius
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2013-12-17 00:00:00.000000000 Z
11
+ date: 2014-01-22 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: mina
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - '>='
17
+ - - ">="
18
18
  - !ruby/object:Gem::Version
19
19
  version: '0'
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
- - - '>='
24
+ - - ">="
25
25
  - !ruby/object:Gem::Version
26
26
  version: '0'
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: puma
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
- - - '>='
31
+ - - ">="
32
32
  - !ruby/object:Gem::Version
33
33
  version: '0'
34
34
  type: :runtime
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
- - - '>='
38
+ - - ">="
39
39
  - !ruby/object:Gem::Version
40
40
  version: '0'
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: bundler
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
- - - ~>
45
+ - - "~>"
46
46
  - !ruby/object:Gem::Version
47
47
  version: '1.3'
48
48
  type: :development
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
- - - ~>
52
+ - - "~>"
53
53
  - !ruby/object:Gem::Version
54
54
  version: '1.3'
55
55
  - !ruby/object:Gem::Dependency
56
56
  name: rake
57
57
  requirement: !ruby/object:Gem::Requirement
58
58
  requirements:
59
- - - '>='
59
+ - - ">="
60
60
  - !ruby/object:Gem::Version
61
61
  version: '0'
62
62
  type: :development
63
63
  prerelease: false
64
64
  version_requirements: !ruby/object:Gem::Requirement
65
65
  requirements:
66
- - - '>='
66
+ - - ">="
67
67
  - !ruby/object:Gem::Version
68
68
  version: '0'
69
69
  description: Puma tasks for Mina
@@ -73,7 +73,7 @@ executables: []
73
73
  extensions: []
74
74
  extra_rdoc_files: []
75
75
  files:
76
- - .gitignore
76
+ - ".gitignore"
77
77
  - Gemfile
78
78
  - LICENSE.txt
79
79
  - README.md
@@ -92,17 +92,17 @@ require_paths:
92
92
  - lib
93
93
  required_ruby_version: !ruby/object:Gem::Requirement
94
94
  requirements:
95
- - - '>='
95
+ - - ">="
96
96
  - !ruby/object:Gem::Version
97
97
  version: '0'
98
98
  required_rubygems_version: !ruby/object:Gem::Requirement
99
99
  requirements:
100
- - - '>='
100
+ - - ">="
101
101
  - !ruby/object:Gem::Version
102
102
  version: '0'
103
103
  requirements: []
104
104
  rubyforge_project:
105
- rubygems_version: 2.0.3
105
+ rubygems_version: 2.2.0
106
106
  signing_key:
107
107
  specification_version: 4
108
108
  summary: Puma tasks for Mina