mina-puma 0.3.2 → 1.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +6 -5
- data/lib/mina/puma/tasks.rake +31 -23
- data/lib/mina/puma/version.rb +1 -1
- data/mina-puma.gemspec +1 -1
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ffb5c8a885cccb123942b259db41dd99aa613d77
|
4
|
+
data.tar.gz: f389dafb16b8d3027861c2496f46143166eed20c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 37d58ac13d159452dbb392816b9a8e0379b4a48785bb80ebe525835119df348845ef3c8ab8a94127a88c96899fb4ee52557ef00268a3e41b9653c2ccaa4216aa
|
7
|
+
data.tar.gz: f71195b5edca9e1ae111a6fcdeffd31ce9582f0484181e66649a11bdd3d47dbd5ffc54b3c1db91f3e62d93cf6d8f93c8c3f675b5b6b928f36709cb1c4eb37b4a
|
data/README.md
CHANGED
@@ -25,7 +25,7 @@ And then execute:
|
|
25
25
|
Or install it yourself as:
|
26
26
|
|
27
27
|
$ gem install mina-puma
|
28
|
-
|
28
|
+
|
29
29
|
Note: by just including this gem, does not mean your development server will be Puma, for that, you need explicitly add `gem 'puma'` to your Gemfile.
|
30
30
|
|
31
31
|
## Usage
|
@@ -49,6 +49,7 @@ OR you can set other directories by setting follow variables:
|
|
49
49
|
* `puma_pid` - puma pid file, default `shared/tmp/pids/puma.pid`
|
50
50
|
* `puma_state` - puma state file, default `shared/tmp/sockets/puma.state`
|
51
51
|
* `pumactl_socket` - pumactl socket file, default `shared/tmp/sockets/pumactl.sock`
|
52
|
+
* `puma_root_path` - puma command execute root path, default `current`
|
52
53
|
|
53
54
|
Then:
|
54
55
|
|
@@ -62,10 +63,10 @@ require 'mina/puma'
|
|
62
63
|
|
63
64
|
task :setup => :environment do
|
64
65
|
# Puma needs a place to store its pid file and socket file.
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
66
|
+
command %(mkdir -p "#{deploy_to}/#{shared_path}/tmp/sockets")
|
67
|
+
command %(chmod g+rx,u+rwx "#{deploy_to}/#{shared_path}/tmp/sockets")
|
68
|
+
command %(mkdir -p "#{deploy_to}/#{shared_path}/tmp/pids")
|
69
|
+
command %(chmod g+rx,u+rwx "#{deploy_to}/#{shared_path}/tmp/pids")
|
69
70
|
|
70
71
|
...
|
71
72
|
|
data/lib/mina/puma/tasks.rake
CHANGED
@@ -4,28 +4,30 @@ require 'mina/rails'
|
|
4
4
|
namespace :puma do
|
5
5
|
set :web_server, :puma
|
6
6
|
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
7
|
+
set :puma_role, -> { fetch(:user) }
|
8
|
+
set :puma_env, -> { fetch(:rails_env, 'production') }
|
9
|
+
set :puma_config, -> { "#{fetch(:shared_path)}/config/puma.rb" }
|
10
|
+
set :puma_socket, -> { "#{fetch(:shared_path)}/tmp/sockets/puma.sock" }
|
11
|
+
set :puma_state, -> { "#{fetch(:shared_path)}/tmp/sockets/puma.state" }
|
12
|
+
set :puma_pid, -> { "#{fetch(:shared_path)}/tmp/pids/puma.pid" }
|
13
|
+
set :puma_cmd, -> { "#{fetch(:bundle_prefix)} puma" }
|
14
|
+
set :pumactl_cmd, -> { "#{fetch(:bundle_prefix)} pumactl" }
|
15
|
+
set :pumactl_socket, -> { "#{fetch(:shared_path)}/tmp/sockets/pumactl.sock" }
|
16
|
+
set :puma_root_path, -> { fetch(:current_path) }
|
16
17
|
|
17
18
|
desc 'Start puma'
|
18
19
|
task :start => :environment do
|
19
|
-
puma_port_option = "-p #{puma_port}" if puma_port
|
20
|
+
puma_port_option = "-p #{fetch(:puma_port)}" if set?(:puma_port)
|
20
21
|
|
21
|
-
|
22
|
-
|
22
|
+
comment "Starting Puma..."
|
23
|
+
command %[
|
24
|
+
if [ -e '#{fetch(:pumactl_socket)}' ]; then
|
23
25
|
echo 'Puma is already running!';
|
24
26
|
else
|
25
|
-
if [ -e '#{puma_config}' ]; then
|
26
|
-
cd #{
|
27
|
+
if [ -e '#{fetch(:puma_config)}' ]; then
|
28
|
+
cd #{fetch(:puma_root_path)} && #{fetch(:puma_cmd)} -q -d -e #{fetch(:puma_env)} -C #{fetch(:puma_config)}
|
27
29
|
else
|
28
|
-
cd #{
|
30
|
+
cd #{fetch(:puma_root_path)} && #{fetch(:puma_cmd)} -q -d -e #{fetch(:puma_env)} -b 'unix://#{fetch(:puma_socket)}' #{puma_port_option} -S #{fetch(:puma_state)} --pidfile #{fetch(:puma_pid)} --control 'unix://#{fetch(:pumactl_socket)}'
|
29
31
|
fi
|
30
32
|
fi
|
31
33
|
]
|
@@ -33,42 +35,48 @@ namespace :puma do
|
|
33
35
|
|
34
36
|
desc 'Stop puma'
|
35
37
|
task stop: :environment do
|
38
|
+
comment "Stopping Puma..."
|
36
39
|
pumactl_command 'stop'
|
37
|
-
|
40
|
+
command %[rm -f '#{fetch(:pumactl_socket)}']
|
38
41
|
end
|
39
42
|
|
40
43
|
desc 'Restart puma'
|
41
44
|
task restart: :environment do
|
45
|
+
comment "Restart Puma...."
|
42
46
|
pumactl_command 'restart'
|
43
47
|
end
|
44
48
|
|
45
49
|
desc 'Restart puma (phased restart)'
|
46
50
|
task phased_restart: :environment do
|
51
|
+
comment "Restart Puma -- phased..."
|
47
52
|
pumactl_command 'phased-restart'
|
48
53
|
end
|
49
54
|
|
50
55
|
desc 'Restart puma (hard restart)'
|
51
56
|
task hard_restart: :environment do
|
57
|
+
comment "Restart Puma -- hard..."
|
52
58
|
invoke 'puma:stop'
|
53
59
|
invoke 'puma:start'
|
54
60
|
end
|
55
|
-
|
61
|
+
|
56
62
|
desc 'Get status of puma'
|
57
63
|
task status: :environment do
|
64
|
+
comment "Puma status..."
|
58
65
|
pumactl_command 'status'
|
59
66
|
end
|
60
67
|
|
61
68
|
def pumactl_command(command)
|
62
|
-
|
63
|
-
if [ -e '#{pumactl_socket}' ]; then
|
64
|
-
if [ -e '#{puma_config}' ]; then
|
65
|
-
cd #{
|
69
|
+
cmd = %{
|
70
|
+
if [ -e '#{fetch(:pumactl_socket)}' ]; then
|
71
|
+
if [ -e '#{fetch(:puma_config)}' ]; then
|
72
|
+
cd #{fetch(:puma_root_path)} && #{fetch(:pumactl_cmd)} -F #{fetch(:puma_config)} #{command}
|
66
73
|
else
|
67
|
-
cd #{
|
74
|
+
cd #{fetch(:puma_root_path)} && #{fetch(:pumactl_cmd)} -S #{fetch(:puma_state)} -C 'unix://#{fetch(:pumactl_socket)}' --pidfile #{fetch(:puma_pid)} #{command}
|
68
75
|
fi
|
69
76
|
else
|
70
77
|
echo 'Puma is not running!';
|
71
78
|
fi
|
72
|
-
|
79
|
+
}
|
80
|
+
command cmd
|
73
81
|
end
|
74
82
|
end
|
data/lib/mina/puma/version.rb
CHANGED
data/mina-puma.gemspec
CHANGED
@@ -18,7 +18,7 @@ Gem::Specification.new do |spec|
|
|
18
18
|
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
|
19
19
|
spec.require_paths = ['lib']
|
20
20
|
|
21
|
-
spec.add_dependency 'mina', '
|
21
|
+
spec.add_dependency 'mina', '~> 1.0.0'
|
22
22
|
spec.add_dependency 'puma', '>= 2.13'
|
23
23
|
|
24
24
|
spec.add_development_dependency 'bundler', '~> 1.3'
|
metadata
CHANGED
@@ -1,27 +1,27 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: mina-puma
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 1.0.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Tobias Sandelius
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-
|
11
|
+
date: 2016-12-05 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: 1.0.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: 1.0.0
|
27
27
|
- !ruby/object:Gem::Dependency
|