puma-daemon 0.2.2 → 0.2.3

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.
data/codecov.yml ADDED
@@ -0,0 +1,4 @@
1
+ comment:
2
+ layout: "reach,diff,flags,tree,betaprofiling"
3
+ show_critical_paths: true
4
+
data/example/config.ru CHANGED
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  # config.ru
2
- run Proc.new { |_env| ['200', {'Content-Type' => 'text/html'}, ['Hello World']] }
4
+ run(proc { |*| ['200', { 'Content-Type' => 'text/html' }, ['Hello World']] })
3
5
  # run this with rackup command
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
- # ssl_bind '127.0.0.1', '9292', { key: path_to_key, cert: path_to_cert }
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
@@ -1,5 +1,6 @@
1
1
  #!/usr/bin/env ruby
2
2
  # frozen_string_literal: true
3
+
3
4
  # vim: ft=ruby
4
5
 
5
6
  lib_path = File.expand_path("#{File.dirname(__FILE__)}/../lib")
@@ -5,32 +5,44 @@ require_relative 'version'
5
5
  module Puma
6
6
  module Daemon
7
7
  module RunnerAdapter
8
- attr_reader :options
9
- attr_accessor :has_demonized
10
-
11
- def output_header(mode)
12
- super(mode)
13
-
14
- daemonize! if daemon?
15
- end
16
-
17
- def daemon?
18
- options[:daemon]
19
- end
20
-
21
- def daemonize!
22
- return if has_demonized
23
-
24
- log '* Puma Daemon: Demonizing...'
25
- log "* Gem: puma-daemon v#{::Puma::Daemon::VERSION}"
26
- log "* Gem: puma v#{::Puma::Const::VERSION}"
27
-
28
- Process.daemon(true, true)
29
- self.has_demonized = true
30
- end
31
-
32
- def log(str)
33
- super(str) unless str == 'Use Ctrl-C to stop'
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
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Puma
4
4
  module Daemon
5
- VERSION = '0.2.2'
5
+ VERSION = '0.2.3'
6
6
  end
7
7
  end
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/CHANAGELOG.md'
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.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-07 00:00:00.000000000 Z
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/CHANAGELOG.md
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.26
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