puma-daemon 0.2.2 → 0.3.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 +4 -4
- data/.github/workflows/main.yml +20 -2
- data/.gitignore +1 -1
- data/.rubocop.yml +3 -0
- data/CHANGELOG.md +14 -0
- data/Dockerfile.download +1 -1
- data/Makefile +8 -0
- data/README.adoc +92 -44
- data/README.pdf +9557 -1
- data/codecov.yml +4 -0
- data/example/config.ru +3 -1
- data/example/puma.rb +4 -2
- data/exe/pumad +1 -0
- data/lib/puma/daemon/runner_adapter.rb +38 -26
- data/lib/puma/daemon/version.rb +1 -1
- data/puma-daemon.gemspec +12 -15
- metadata +29 -14
data/codecov.yml
ADDED
data/example/config.ru
CHANGED
data/example/puma.rb
CHANGED
@@ -1,3 +1,5 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
require 'puma/daemon'
|
2
4
|
|
3
5
|
# The directory to operate out of.
|
@@ -34,7 +36,7 @@ bind 'tcp://0.0.0.0:9292'
|
|
34
36
|
# Instead of “bind 'ssl://127.0.0.1:9292?key=path_to_key&cert=path_to_cert'” you
|
35
37
|
# can also use the “ssl_bind” option.
|
36
38
|
|
37
|
-
|
39
|
+
# ssl_bind '127.0.0.1', '9292', { key: path_to_key, cert: path_to_cert }
|
38
40
|
|
39
41
|
# Code to run before doing a restart. This code should
|
40
42
|
# close log files, database connections, etc.
|
@@ -71,6 +73,6 @@ workers 2
|
|
71
73
|
# Check out https://github.com/puma/puma/blob/master/lib/puma/app/status.rb
|
72
74
|
# to see what the app has available.
|
73
75
|
|
74
|
-
#activate_control_app 'unix:///var/run/pumactl.sock'
|
76
|
+
# activate_control_app 'unix:///var/run/pumactl.sock'
|
75
77
|
|
76
78
|
daemonize
|
data/exe/pumad
CHANGED
@@ -5,32 +5,44 @@ require_relative 'version'
|
|
5
5
|
module Puma
|
6
6
|
module Daemon
|
7
7
|
module RunnerAdapter
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
8
|
+
class << self
|
9
|
+
def included(base)
|
10
|
+
base.class_eval do
|
11
|
+
attr_reader :options
|
12
|
+
attr_accessor :has_demonized
|
13
|
+
end
|
14
|
+
|
15
|
+
base.class_eval do
|
16
|
+
def output_header(mode)
|
17
|
+
super(mode)
|
18
|
+
|
19
|
+
daemonize! if daemon?
|
20
|
+
end
|
21
|
+
|
22
|
+
def daemon?
|
23
|
+
options[:daemon]
|
24
|
+
end
|
25
|
+
|
26
|
+
def daemonize!
|
27
|
+
return if has_demonized
|
28
|
+
|
29
|
+
log '* Puma Daemon: Demonizing...'
|
30
|
+
log "* Gem: puma-daemon v#{::Puma::Daemon::VERSION}"
|
31
|
+
log "* Gem: puma v#{::Puma::Const::VERSION}"
|
32
|
+
|
33
|
+
Process.daemon(true, true)
|
34
|
+
self.has_demonized = true
|
35
|
+
end
|
36
|
+
|
37
|
+
def log(str)
|
38
|
+
if super.respond_to?(:log)
|
39
|
+
super(str) unless str == 'Use Ctrl-C to stop'
|
40
|
+
else
|
41
|
+
puts(str)
|
42
|
+
end
|
43
|
+
end
|
44
|
+
end
|
45
|
+
end
|
34
46
|
end
|
35
47
|
end
|
36
48
|
end
|
data/lib/puma/daemon/version.rb
CHANGED
data/puma-daemon.gemspec
CHANGED
@@ -11,19 +11,17 @@ Gem::Specification.new do |spec|
|
|
11
11
|
spec.summary = "Restore somewhat Puma's ability to self-daemonize, since Puma 5.0 dropped it"
|
12
12
|
spec.description = <<~DESCRIPTION
|
13
13
|
|
14
|
-
In version 5.0 the authors of the popular Ruby web server Puma chose
|
15
|
-
|
16
|
-
and because other and
|
17
|
-
|
18
|
-
all servers on the foreground.
|
14
|
+
In version 5.0 the authors of the popular Ruby web server Puma chose to remove the
|
15
|
+
daemonization support from Puma, because the code wasn't wall maintained,
|
16
|
+
and because other and better options exist for production deployments. For example
|
17
|
+
systemd, Docker/Kubernetes, Heroku, etc.
|
19
18
|
|
20
|
-
|
21
|
-
|
22
|
-
|
19
|
+
Having said that, it was neat and often useful to daemonize Puma in development.
|
20
|
+
This gem adds this support to Puma 5 & 6 (hopefully) without breaking anything in Puma
|
21
|
+
itself.
|
23
22
|
|
24
|
-
So, if you want to use the latest and greatest Puma 5+, but
|
25
|
-
this gem
|
26
|
-
your config file.
|
23
|
+
So, if you want to use the latest and greatest Puma 5+, but prefer to keep using built-in
|
24
|
+
daemonization, this gem if for you.
|
27
25
|
DESCRIPTION
|
28
26
|
|
29
27
|
spec.homepage = 'https://github.com/kigster/puma-daemon'
|
@@ -33,7 +31,7 @@ Gem::Specification.new do |spec|
|
|
33
31
|
|
34
32
|
spec.metadata['homepage_uri'] = spec.homepage
|
35
33
|
spec.metadata['source_code_uri'] = 'https://github.com/kigster/puma-daemon'
|
36
|
-
spec.metadata['changelog_uri'] = 'https://github.com/kigster/puma-daemon/master/
|
34
|
+
spec.metadata['changelog_uri'] = 'https://github.com/kigster/puma-daemon/blob/master/CHANGELOG.md'
|
37
35
|
|
38
36
|
# Specify which files should be added to the gem when it is released.
|
39
37
|
# The `git ls-files -z` loads the files in the RubyGem that have been added into git.
|
@@ -50,15 +48,14 @@ Gem::Specification.new do |spec|
|
|
50
48
|
|
51
49
|
spec.add_development_dependency 'asciidoctor'
|
52
50
|
spec.add_development_dependency 'codecov'
|
51
|
+
spec.add_development_dependency 'httparty'
|
53
52
|
spec.add_development_dependency 'relaxed-rubocop'
|
54
53
|
spec.add_development_dependency 'rspec-its'
|
55
54
|
spec.add_development_dependency 'rubocop'
|
56
55
|
spec.add_development_dependency 'simplecov'
|
57
56
|
spec.add_development_dependency 'yard'
|
58
57
|
|
59
|
-
# Uncomment to register a new dependency of your gem
|
60
|
-
# spec.add_dependency "example-gem", "~> 1.0"
|
61
|
-
|
62
58
|
# For more information and examples about making a new gem, checkout our
|
63
59
|
# guide at: https://bundler.io/guides/creating_gem.html
|
60
|
+
spec.metadata['rubygems_mfa_required'] = 'true'
|
64
61
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: puma-daemon
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.3.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Konstantin Gredeskoul
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-03-
|
11
|
+
date: 2023-03-14 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: puma
|
@@ -66,6 +66,20 @@ dependencies:
|
|
66
66
|
- - ">="
|
67
67
|
- !ruby/object:Gem::Version
|
68
68
|
version: '0'
|
69
|
+
- !ruby/object:Gem::Dependency
|
70
|
+
name: httparty
|
71
|
+
requirement: !ruby/object:Gem::Requirement
|
72
|
+
requirements:
|
73
|
+
- - ">="
|
74
|
+
- !ruby/object:Gem::Version
|
75
|
+
version: '0'
|
76
|
+
type: :development
|
77
|
+
prerelease: false
|
78
|
+
version_requirements: !ruby/object:Gem::Requirement
|
79
|
+
requirements:
|
80
|
+
- - ">="
|
81
|
+
- !ruby/object:Gem::Version
|
82
|
+
version: '0'
|
69
83
|
- !ruby/object:Gem::Dependency
|
70
84
|
name: relaxed-rubocop
|
71
85
|
requirement: !ruby/object:Gem::Requirement
|
@@ -136,16 +150,14 @@ dependencies:
|
|
136
150
|
- - ">="
|
137
151
|
- !ruby/object:Gem::Version
|
138
152
|
version: '0'
|
139
|
-
description: "\nIn version 5.0 the authors of the popular Ruby web server Puma chose
|
140
|
-
remove the
|
141
|
-
|
142
|
-
|
143
|
-
to
|
144
|
-
|
145
|
-
|
146
|
-
if you
|
147
|
-
\nthis gem is for you. Just use *pumad* binary instead of *puma*, or require 'puma/daemon'
|
148
|
-
inside\nyour config file.\n"
|
153
|
+
description: "\nIn version 5.0 the authors of the popular Ruby web server Puma chose
|
154
|
+
to remove the \ndaemonization support from Puma, because the code wasn't wall maintained,\nand
|
155
|
+
because other and better options exist for production deployments. For example\nsystemd,
|
156
|
+
Docker/Kubernetes, Heroku, etc. \n\nHaving said that, it was neat and often useful
|
157
|
+
to daemonize Puma in development.\nThis gem adds this support to Puma 5 & 6 (hopefully)
|
158
|
+
without breaking anything in Puma\nitself.\n\nSo, if you want to use the latest
|
159
|
+
and greatest Puma 5+, but prefer to keep using built-in\ndaemonization, this gem
|
160
|
+
if for you.\n"
|
149
161
|
email:
|
150
162
|
- kigster@gmail.com
|
151
163
|
executables:
|
@@ -167,9 +179,11 @@ files:
|
|
167
179
|
- LICENSE.txt
|
168
180
|
- Makefile
|
169
181
|
- README.adoc
|
182
|
+
- README.pdf
|
170
183
|
- Rakefile
|
171
184
|
- bin/console
|
172
185
|
- bin/setup
|
186
|
+
- codecov.yml
|
173
187
|
- config/puma_cluster.rb
|
174
188
|
- config/puma_single.rb
|
175
189
|
- example/cluster.sh
|
@@ -191,7 +205,8 @@ licenses:
|
|
191
205
|
metadata:
|
192
206
|
homepage_uri: https://github.com/kigster/puma-daemon
|
193
207
|
source_code_uri: https://github.com/kigster/puma-daemon
|
194
|
-
changelog_uri: https://github.com/kigster/puma-daemon/master/
|
208
|
+
changelog_uri: https://github.com/kigster/puma-daemon/blob/master/CHANGELOG.md
|
209
|
+
rubygems_mfa_required: 'true'
|
195
210
|
post_install_message:
|
196
211
|
rdoc_options: []
|
197
212
|
require_paths:
|
@@ -207,7 +222,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
207
222
|
- !ruby/object:Gem::Version
|
208
223
|
version: '0'
|
209
224
|
requirements: []
|
210
|
-
rubygems_version: 3.3.
|
225
|
+
rubygems_version: 3.3.22
|
211
226
|
signing_key:
|
212
227
|
specification_version: 4
|
213
228
|
summary: Restore somewhat Puma's ability to self-daemonize, since Puma 5.0 dropped
|