puma-daemon 0.2.2 → 0.2.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/workflows/main.yml +20 -2
- data/.gitignore +1 -1
- data/Dockerfile.download +1 -1
- data/Makefile +3 -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 +2 -1
- metadata +20 -4
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
@@ -33,7 +33,7 @@ Gem::Specification.new do |spec|
|
|
33
33
|
|
34
34
|
spec.metadata['homepage_uri'] = spec.homepage
|
35
35
|
spec.metadata['source_code_uri'] = 'https://github.com/kigster/puma-daemon'
|
36
|
-
spec.metadata['changelog_uri'] = 'https://github.com/kigster/puma-daemon/master/
|
36
|
+
spec.metadata['changelog_uri'] = 'https://github.com/kigster/puma-daemon/blob/master/CHANGELOG.md'
|
37
37
|
|
38
38
|
# Specify which files should be added to the gem when it is released.
|
39
39
|
# The `git ls-files -z` loads the files in the RubyGem that have been added into git.
|
@@ -50,6 +50,7 @@ Gem::Specification.new do |spec|
|
|
50
50
|
|
51
51
|
spec.add_development_dependency 'asciidoctor'
|
52
52
|
spec.add_development_dependency 'codecov'
|
53
|
+
spec.add_development_dependency 'httparty'
|
53
54
|
spec.add_development_dependency 'relaxed-rubocop'
|
54
55
|
spec.add_development_dependency 'rspec-its'
|
55
56
|
spec.add_development_dependency 'rubocop'
|
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.2.
|
4
|
+
version: 0.2.3
|
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
|
@@ -167,9 +181,11 @@ files:
|
|
167
181
|
- LICENSE.txt
|
168
182
|
- Makefile
|
169
183
|
- README.adoc
|
184
|
+
- README.pdf
|
170
185
|
- Rakefile
|
171
186
|
- bin/console
|
172
187
|
- bin/setup
|
188
|
+
- codecov.yml
|
173
189
|
- config/puma_cluster.rb
|
174
190
|
- config/puma_single.rb
|
175
191
|
- example/cluster.sh
|
@@ -191,7 +207,7 @@ licenses:
|
|
191
207
|
metadata:
|
192
208
|
homepage_uri: https://github.com/kigster/puma-daemon
|
193
209
|
source_code_uri: https://github.com/kigster/puma-daemon
|
194
|
-
changelog_uri: https://github.com/kigster/puma-daemon/master/
|
210
|
+
changelog_uri: https://github.com/kigster/puma-daemon/blob/master/CHANGELOG.md
|
195
211
|
post_install_message:
|
196
212
|
rdoc_options: []
|
197
213
|
require_paths:
|
@@ -207,7 +223,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
207
223
|
- !ruby/object:Gem::Version
|
208
224
|
version: '0'
|
209
225
|
requirements: []
|
210
|
-
rubygems_version: 3.3.
|
226
|
+
rubygems_version: 3.3.22
|
211
227
|
signing_key:
|
212
228
|
specification_version: 4
|
213
229
|
summary: Restore somewhat Puma's ability to self-daemonize, since Puma 5.0 dropped
|