puma-daemon 0.1.0 → 0.1.1

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
  SHA256:
3
- metadata.gz: 56b4e579687433f3eae998a8b30c3b1b02834c1dde9ef7f57c90d4c501866092
4
- data.tar.gz: 1dcd52a307ddabc3083f30b6eba58bc8b679d3f743cd1925199de2e52045b3f4
3
+ metadata.gz: 181a06dc6b28bae8af85a9eaa03ad0e8eb5c0a147647b10907022db5d596b74e
4
+ data.tar.gz: 21907cb861b6fb67538502fd70fa56d6c3038997869af268a8891de93f0f728c
5
5
  SHA512:
6
- metadata.gz: 24e84862cf484e0b08f24356d63cf7fe223f257960f972b1b84ef30e42339e2ec5f6d443b724414bd505a6d9fa176460ac284839155f590c5ca598eed151fbd4
7
- data.tar.gz: b8555d31db72c344b076d98aef64dc915dcee38bce42ae4425c2e33dfbecaef10242d7e76cc94f175a41598f6827ea3cee2b7b5f9728da6a330f6c26803028e7
6
+ metadata.gz: d1c287db4aaa4a4ec29abb422ed9800a31ecc32891a600ced60bf796c192d08eb7e75642a7b8137afcb283fbd1ae2872e4b02124f7ec3bbb09b8072ce72f867b
7
+ data.tar.gz: c26fe226d00997d7432ef73fadaf44d70719a0c20dc5efdf6c55062dcc6df8e00b69b5794e1b94591c7625e255574135d5d36c2bc4747599e39f8c510bd3e3a7
@@ -5,14 +5,22 @@ on: [push,pull_request]
5
5
  jobs:
6
6
  build:
7
7
  runs-on: ubuntu-latest
8
+ strategy:
9
+ matrix:
10
+ ruby-version: [3.0.0, 2.7.2, 2.6.6, 2.5.7]
11
+
8
12
  steps:
9
13
  - uses: actions/checkout@v2
10
- - name: Set up Ruby
14
+ - name: Set up Ruby ${{ matrix.ruby-version }}
11
15
  uses: ruby/setup-ruby@v1
12
16
  with:
13
- ruby-version: 3.0.0
14
- - name: Run the default task
15
- run: |
16
- gem install bundler -v 2.2.4
17
- bundle install
18
- bundle exec rake
17
+ ruby-version: ${{ matrix.ruby-version }}
18
+ - name: Install dependencies
19
+ run: bundle install
20
+ - name: Run RSpecs
21
+ run: bundle exec rspec --color
22
+ - name: Run Rubocop
23
+ run: bundle exec rubocop
24
+ - name: Upload Code Coverage
25
+ run: bash <(curl -s https://codecov.io/bash)
26
+
data/.gitignore CHANGED
@@ -6,6 +6,9 @@
6
6
  /pkg/
7
7
  /spec/reports/
8
8
  /tmp/
9
-
9
+ .idea/
10
10
  # rspec failure tracking
11
11
  .rspec_status
12
+ .ruby-version
13
+ /Gemfile.lock
14
+
@@ -1,10 +1,21 @@
1
+ inherit_gem:
2
+ relaxed-rubocop: .rubocop.yml
3
+
4
+ AllCops:
5
+ TargetRubyVersion: 2.4
6
+ NewCops: enable
7
+
8
+ Style/OptionalBooleanParameter:
9
+ Exclude:
10
+ - 'lib/puma/daemon/dsl.rb'
11
+
1
12
  Style/StringLiterals:
2
13
  Enabled: true
3
- EnforcedStyle: double_quotes
14
+ EnforcedStyle: single_quotes
4
15
 
5
16
  Style/StringLiteralsInInterpolation:
6
17
  Enabled: true
7
- EnforcedStyle: double_quotes
18
+ EnforcedStyle: single_quotes
8
19
 
9
20
  Layout/LineLength:
10
21
  Max: 120
@@ -0,0 +1,14 @@
1
+ # This configuration was generated by
2
+ # `rubocop --auto-gen-config`
3
+ # on 2021-01-24 15:37:53 UTC using RuboCop version 0.93.1.
4
+ # The point is for the user to remove these configuration records
5
+ # one by one as the offenses are removed from the code base.
6
+ # Note that changes in the inspected code, or installation of new
7
+ # versions of RuboCop, may require this file to be generated again.
8
+
9
+ # Offense count: 1
10
+ # Configuration parameters: AllowedMethods.
11
+ # AllowedMethods: respond_to_missing?
12
+ Style/OptionalBooleanParameter:
13
+ Exclude:
14
+ - 'lib/puma/daemon/dsl.rb'
data/Gemfile CHANGED
@@ -1,12 +1,14 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- source "https://rubygems.org"
3
+ source 'https://rubygems.org'
4
4
 
5
5
  # Specify your gem's dependencies in puma-daemon.gemspec
6
6
  gemspec
7
7
 
8
- gem "rake", "~> 13.0"
8
+ gem 'rake', '~> 13.0'
9
9
 
10
- gem "rspec", "~> 3.0"
11
-
12
- gem "rubocop", "~> 0.80"
10
+ group :test do
11
+ gem 'codecov', require: false
12
+ gem 'rspec', '~> 3.0'
13
+ gem 'rubocop', '~> 0.80'
14
+ end
@@ -1,6 +1,4 @@
1
- The MIT License (MIT)
2
-
3
- Copyright (c) 2021 Konstantin Gredeskoul
1
+ Copyright © 2021 Konstantin Gredeskoul
4
2
 
5
3
  Permission is hereby granted, free of charge, to any person obtaining a copy
6
4
  of this software and associated documentation files (the "Software"), to deal
@@ -1,8 +1,40 @@
1
1
  = Puma::Daemon
2
+ :toc:
3
+ :toclevels: 4
4
+ :sectnums:
5
+ :icons: font
2
6
 
3
- Welcome to your new gem! In this directory, you'll find the files you need to be able to package up your Ruby library into a gem. Put your Ruby code in the file `lib/puma/daemon`. To experiment with that code, run `bin/console` for an interactive prompt.
7
+ image:https://github.com/kigster/puma-daemon/workflows/Ruby/badge.svg[link=https://github.com/kigster/puma-daemon/actions?query=workflow%3ARuby] image:https://codecov.io/gh/kigster/puma-daemon/branch/master/graph/badge.svg?token=asxarMSGbz[link=https://codecov.io/gh/kigster/puma-daemon]
4
8
 
5
- TODO: Delete this and the text above, and describe your gem
9
+ In version 5.0 of the popular Ruby HTTP server https://github.com/puma/puma[Puma] the developers chose to https://github.com/puma/puma/pull/2170/files[drop the daemonization] support from Puma. They did that because the code wasn't actively maintained. Other and perhaps better options now exist (such as `systemd`, etc), not to mention that many people have switched to Kubernetes and Docker, where you generally want to start all servers in the foreground.
10
+
11
+ And yet, on occasion, it was rather useful and straightforward to use the built-in daemonization feature that was cross-platform and is now gone. Some folks are still using this feature and are therefore stuck with Puma version 4, or must wrap Puma either in the `systemd` manifest or `launchctl plist` on Mac OS-X, or a Docker container. Well, **not anymore!**
12
+
13
+ NOTE: Add this gem to your dependencies, and make a one line change either in your `config/puma.rb` file, or use `pumad` binary to start Puma as per usual, and you can even leave `-d` flags there (they are ignored when started via `pumad`, and Puma always goes to the background when started that way).
14
+
15
+ One of the nice features of the old daemonization functionality was that it worked across all platforms.
16
+
17
+ So, if you want to use the latest and greatest Puma 5+, but have it self-daemonize, this gem is for you.
18
+
19
+ == Compatility
20
+
21
+ We did not restore the daemonization code for JRuby; so at the moment this will work with the MRI distribution, and possibly others that support `Process.daemon(true)`.
22
+
23
+ We currently run CI suite on Github Actions against
24
+
25
+ * MRI Ruby 3.0.0
26
+ * MRI Ruby 2.7.2
27
+ * MRI Ruby 2.6.6
28
+ * MRI Ruby 2.5.7
29
+
30
+
31
+ == Design Decisions
32
+
33
+ This gem's goal was to surgically augment Puma's source code to restore daemonization by merely requiring `puma/daemon`. We almost got there, but not quite.
34
+
35
+ While this was an admirable goal, it has not been accomplished in the current version. The internals of Puma isn't very easy to monkey-patch or augment. For example, we couldn't think of a way to add back the `-d` flags to the Option Parsing method without having to override the entire method: — which is _not a good solution_, because — what if Puma developers add a new flag in the future? We would have to keep this overridden method frequently updated and potentially choose a different version depending on what version of Puma you are using. That sounds like a nightmare.
36
+
37
+ It is why instead, we took an approach that requires you — the user — to make a couple of small changes in your Puma configuration to bring daemonization back, or in your scripts, change `puma` to `pumad`, and everything should work. If you run into problems, please https://github.com/kigster/puma-daemon/issues/new[submit an issue].
6
38
 
7
39
  == Installation
8
40
 
@@ -10,20 +42,95 @@ Add this line to your application's Gemfile:
10
42
 
11
43
  [source,ruby]
12
44
  ----
13
- gem 'puma-daemon'
45
+ gem 'puma-daemon', require: false
46
+ gem 'puma', '~> 5'
14
47
  ----
15
48
 
16
49
  And then execute:
17
50
 
18
51
  $ bundle install
19
52
 
20
- Or install it yourself as:
53
+ == Usage
21
54
 
22
- $ gem install puma-daemon
55
+ There were two ways you could daemonize Puma in the past:
23
56
 
24
- == Usage
57
+ 1. By specifying `daemonize` or `daemonize(true)` in your config file.
58
+ 2. Or, by passing a `-d` or `--daemonize` command line flag.
59
+
60
+ This gem allows you to daemonize using both ways, but with a small caveat in each case.
61
+
62
+ Please note that both ways require you to include this gem in your Gemfile, but you may specify it as `require: false` — it will only activate if you explicitly require it, or use `pumad` executable.
63
+
64
+ === Daemonizing via the Config File
65
+
66
+ If you want to specify `daemonize` in your config file, simply include `require 'puma/daemon'` at the top of your config file:
67
+
68
+ [source,ruby]
69
+ ----
70
+ # file: config/puma.rb
71
+ require 'puma/daemon'
72
+
73
+ port 3001
74
+ workers 3
75
+ threads 2,3
76
+ # accepts true or false, and if false is passed will NOT daemonize
77
+ daemonize
78
+ ----
79
+
80
+ With this method you can continue using the standard `puma` executable to get it started, but (and this is important) — **you must remove any `-d` or `--daemonize` from the command line**, or Puma v5 and above will fail with an error.
81
+
82
+ Here is an example of daemonizing via the config file shown above, and using the regular `puma` binary:
83
+
84
+ [source,bash]
85
+ ----
86
+ ❯ gem install puma-daemon puma -N
87
+ ❯ puma -C config/puma.rb config.ru
88
+
89
+ [98795] Puma starting in cluster mode...
90
+ [98795] * Puma version: 5.1.1 (ruby 2.7.2-p137) ("At Your Service")
91
+ [98795] * Min threads: 2
92
+ [98795] * Max threads: 3
93
+ [98795] * Environment: production
94
+ [98795] * Master PID: 98795
95
+ [98795] * Workers: 3
96
+ [98795] * Restarts: (✔) hot (✔) phased
97
+ [98795] * Listening on http://0.0.0.0:3001
98
+ [98795] * Puma Daemon: Daemonizing (puma-daemon v0.1.1)...
99
+ ----
100
+
101
+ Note that using this method you can decide whether to daemonize or not by passing true or false to the `daemonize` method.
102
+
103
+ === Daemonizing on the Command Line
104
+
105
+ If you prefer to make a decision whether to daemonize or not on the command line, you only have to make one chance: replace `puma` with `pumad`.
106
+
107
+ NOTE: We did not want to conflict with the `puma` gem by introducing another executable under the same name. The executable this gem provides is called `pumad` (where 'd' stands for daemon, and follows standard UNIX convention, as in eg `sshd`, `ftpd`, etc).
108
+
109
+ If you replace `puma` with `pumad` — you no longer need to pass any aditional command line flag t ocontinue passing it `-d` or you can remove it (both `-d` and `--daemonize` are stripped out before ARGV is passed onto Puma's CLI parser.)
110
+
111
+ [source,bash]
112
+ ----
113
+ ❯ gem install puma --version 5.1.1 -N
114
+ ❯ gem install puma-daemon -N
115
+
116
+ ❯ pumad -C config/puma.rb spec/rackup/bind.ru
117
+
118
+ [98795] Puma starting in cluster mode...
119
+ [98795] * Puma version: 5.1.1 (ruby 2.7.2-p137) ("At Your Service")
120
+ [98795] * Min threads: 2
121
+ [98795] * Max threads: 8
122
+ [98795] * Environment: production
123
+ [98795] * Master PID: 98795
124
+ [98795] * Workers: 3
125
+ [98795] * Restarts: (✔) hot (✔) phased
126
+ [98795] * Listening on http://0.0.0.0:3000
127
+ [98795] * Puma Daemon: Daemonizing (puma-daemon v0.1.1)...
128
+ ----
129
+
130
+ As you can see, at the end it says "Daemonizing".
131
+
132
+ If you start puma this way, you can still specify `daemonize(false)` in the configuration file to turn it off, but the default is to daemonize. Also, if you start with `pumad` you do not need to include `require 'puma/daemon'` in your configuration file, as the `pumad` binary loads all dependencies prior to parsing the config.
25
133
 
26
- Work in progress.
27
134
 
28
135
  == Development
29
136
 
data/Rakefile CHANGED
@@ -1,8 +1,9 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'bundler/gem_tasks'
2
4
  require 'rspec/core/rake_task'
3
5
  require 'rubocop/rake_task'
4
6
  require 'yard'
5
- require 'timeout'
6
7
 
7
8
  def shell(*args)
8
9
  puts "running: #{args.join(' ')}"
@@ -10,33 +11,28 @@ def shell(*args)
10
11
  end
11
12
 
12
13
  task :clean do
13
- shell('rm -rf pkg/ tmp/ coverage/ doc/ ' )
14
+ shell('rm -rf pkg/ tmp/ coverage/ doc/ ')
14
15
  end
15
16
 
16
- task :gem => [:build] do
17
+ task gem: [:build] do
17
18
  shell('gem install pkg/*')
18
19
  end
19
20
 
20
- task :permissions => [ :clean ] do
21
- shell("chmod -v o+r,g+r * */* */*/* */*/*/* */*/*/*/* */*/*/*/*/*")
22
- shell("find . -type d -exec chmod o+x,g+x {} \\;")
21
+ task permissions: [:clean] do
22
+ shell('chmod -v o+r,g+r * */* */*/* */*/*/* */*/*/*/* */*/*/*/*/*')
23
+ shell('find . -type d -exec chmod o+x,g+x {} \\;')
23
24
  end
24
25
 
25
- task :build => :permissions
26
+ task build: :permissions
26
27
 
27
28
  YARD::Rake::YardocTask.new(:doc) do |t|
28
- t.files = %w(lib/**/*.rb exe/*.rb - README.adoc CHANGELOG.md LICENSE)
29
- t.options.unshift('--title', '"Sym – Symmetric Encryption for Humins"')
30
- t.after = -> { Thread.new { sleep 5; exec('open doc/index.html') } }
29
+ t.files = %w[lib/**/*.rb exe/*.rb - README.adoc CHANGELOG.md LICENSE.txt]
30
+ t.options.unshift('--title', '"Puma Daemon"')
31
+ t.after = -> { exec('open doc/index.html') }
31
32
  end
32
33
 
33
34
  RSpec::Core::RakeTask.new(:spec)
34
35
 
35
36
  RuboCop::RakeTask.new
36
37
 
37
- task :default => :spec
38
-
39
-
40
-
41
-
42
-
38
+ task default: %i[spec rubocop]
@@ -1,8 +1,8 @@
1
1
  #!/usr/bin/env ruby
2
2
  # frozen_string_literal: true
3
3
 
4
- require "bundler/setup"
5
- require "puma/daemon"
4
+ require 'bundler/setup'
5
+ require 'puma/daemon'
6
6
 
7
7
  # You can add fixtures and/or initialization code here to make experimenting
8
8
  # with your gem easier. You can also use a different console, if you like.
@@ -11,5 +11,5 @@ require "puma/daemon"
11
11
  # require "pry"
12
12
  # Pry.start
13
13
 
14
- require "irb"
14
+ require 'irb'
15
15
  IRB.start(__FILE__)
@@ -0,0 +1,9 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'puma/daemon'
4
+
5
+ workers 3
6
+ threads 2, 8
7
+ port 3000
8
+ environment ENV['RAILS_ENV'] || 'production'
9
+ daemonize ENV['NO_DAEMON'] ? false : true
@@ -0,0 +1,13 @@
1
+ #!/usr/bin/env ruby
2
+ # frozen_string_literal: true
3
+
4
+ require 'puma/daemon'
5
+
6
+ # If we are passing -d or --daemonize, do so
7
+ # otherwise invoke to the original puma
8
+ if (ARGV & %w[-d --daemonize]).size.positive?
9
+ ARGV.delete '-d'
10
+ ARGV.delete '--daemonize'
11
+ end
12
+
13
+ Puma::Daemon::CLI.new(ARGV)&.run
@@ -1,10 +1,27 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require_relative "daemon/version"
3
+ require 'puma/runner'
4
+ require 'puma/single'
5
+ require 'puma/cluster'
6
+ require 'puma/dsl'
7
+ require 'puma/cli'
8
+
9
+ require 'puma/daemon/version'
10
+ require 'puma/daemon/runner'
11
+ require 'puma/daemon/configuration'
12
+ require 'puma/daemon/cli'
13
+ require 'puma/daemon/dsl'
4
14
 
5
15
  module Puma
6
16
  module Daemon
7
- class Error < StandardError; end
8
- # Your code goes here...
17
+ def self.daemonize!
18
+ ::Puma::Single.include(::Puma::Daemon::Runner)
19
+ ::Puma::Cluster.include(::Puma::Daemon::Runner)
20
+ ::Puma::DSL.include(::Puma::Daemon::DSL)
21
+ ::Puma::Configuration.prepend(::Puma::Daemon::Configuration)
22
+ ::Puma::CLI.instance_eval { attr_reader :options }
23
+ end
9
24
  end
10
25
  end
26
+
27
+ Puma::Daemon.daemonize!
@@ -0,0 +1,18 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Puma
4
+ module Daemon
5
+ class CLI
6
+ attr_accessor :argv, :cli
7
+
8
+ def initialize(argv = ARGV, events = Events.stdio)
9
+ self.argv = argv
10
+ self.cli = ::Puma::CLI.new(argv, events)
11
+ end
12
+
13
+ def run
14
+ cli.run
15
+ end
16
+ end
17
+ end
18
+ end
@@ -0,0 +1,13 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Puma
4
+ module Daemon
5
+ module Configuration
6
+ attr_reader :default_dsl, :file_dsl, :user_dsl
7
+
8
+ def puma_default_options
9
+ super.merge({ daemon: true })
10
+ end
11
+ end
12
+ end
13
+ end
@@ -0,0 +1,23 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Puma
4
+ module Daemon
5
+ module DSL
6
+ # Daemonize the server into the background. It's highly recommended to
7
+ # use this in combination with +pidfile+ and +stdout_redirect+.
8
+ #
9
+ # The default is "false".
10
+ #
11
+ # @example
12
+ # daemonize
13
+ #
14
+ # @example
15
+ # daemonize false
16
+ def daemonize(which = true)
17
+ @options[:daemon] = which
18
+ end
19
+
20
+ attr_reader :options
21
+ end
22
+ end
23
+ end
@@ -0,0 +1,30 @@
1
+ # frozen_string_literal: true
2
+
3
+ require_relative 'version'
4
+
5
+ module Puma
6
+ module Daemon
7
+ module Runner
8
+ attr_reader :options
9
+
10
+ def redirect_io
11
+ super
12
+
13
+ daemonize! if daemon?
14
+ end
15
+
16
+ def daemon?
17
+ options[:daemon]
18
+ end
19
+
20
+ def daemonize!
21
+ log "* Puma Daemon: Daemonizing (puma-daemon v#{::Puma::Daemon::VERSION})..."
22
+ Process.daemon(true)
23
+ end
24
+
25
+ def log(str)
26
+ super(str) unless str == 'Use Ctrl-C to stop'
27
+ end
28
+ end
29
+ end
30
+ end
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Puma
4
4
  module Daemon
5
- VERSION = "0.1.0"
5
+ VERSION = '0.1.1'
6
6
  end
7
7
  end
@@ -1,38 +1,60 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require_relative "lib/puma/daemon/version"
3
+ require_relative 'lib/puma/daemon/version'
4
4
 
5
5
  Gem::Specification.new do |spec|
6
- spec.name = "puma-daemon"
6
+ spec.name = 'puma-daemon'
7
7
  spec.version = Puma::Daemon::VERSION
8
- spec.authors = ["Konstantin Gredeskoul"]
9
- spec.email = ["kigster@gmail.com"]
8
+ spec.authors = ['Konstantin Gredeskoul']
9
+ spec.email = ['kigster@gmail.com']
10
10
 
11
- spec.summary = "Daemonize puma without any external OS-dependent method"
12
- spec.description = "Daemonize puma without any external OS-dependent method"
13
- spec.homepage = "https://github.com/kig/puma-daemon"
14
- spec.license = "MIT"
15
-
16
- spec.required_ruby_version = Gem::Requirement.new(">= 2.3.0")
11
+ spec.summary = "Restore somewhat Puma's ability to self-daemonize, since Puma 5.0 dropped it"
12
+ spec.description = <<~DESCRIPTION
17
13
 
18
- spec.metadata["homepage_uri"] = spec.homepage
19
- spec.metadata["source_code_uri"] = "https://github.com/kig/puma-daemon"
20
- spec.metadata["changelog_uri"] = "https://github.com/kig/puma-daemon/master/CHANAGELOG"
14
+ In version 5.0 the authors of the popular Ruby web server Puma chose
15
+ to remove the daemonization support from Puma, because the code wasn't wall maintained,
16
+ and because other and perhaps better options exist (such as systemd, etc), not to
17
+ mention many people have switched to Kubernetes and Docker, where you want to start
18
+ all servers on the foreground.
19
+
20
+ And yet, something useful and simple got lost — in our humble opinion. Some folks were
21
+ indeed happily using the `--daemonize` feature until in 5.0 they got an error that this flag is
22
+ not supported.
23
+
24
+ So, if you want to use the latest and greatest Puma 5+, but have it self-daemonize,
25
+ this gem is for you. Just use *pumad* binary instead of *puma*, or require 'puma/daemon' inside
26
+ your config file.
27
+ DESCRIPTION
28
+
29
+ spec.homepage = 'https://github.com/kig/puma-daemon'
30
+ spec.license = 'MIT'
31
+
32
+ spec.required_ruby_version = Gem::Requirement.new('>= 2.4.0')
33
+
34
+ spec.metadata['homepage_uri'] = spec.homepage
35
+ spec.metadata['source_code_uri'] = 'https://github.com/kig/puma-daemon'
36
+ spec.metadata['changelog_uri'] = 'https://github.com/kig/puma-daemon/master/CHANAGELOG'
21
37
 
22
38
  # Specify which files should be added to the gem when it is released.
23
39
  # The `git ls-files -z` loads the files in the RubyGem that have been added into git.
24
40
  spec.files = Dir.chdir(File.expand_path(__dir__)) do
25
41
  `git ls-files -z`.split("\x0").reject { |f| f.match(%r{\A(?:test|spec|features)/}) }
26
42
  end
27
- spec.bindir = "exe"
43
+ spec.bindir = 'exe'
28
44
  spec.executables = spec.files.grep(%r{\Aexe/}) { |f| File.basename(f) }
29
- spec.require_paths = ["lib"]
45
+ spec.require_paths = ['lib']
46
+
47
+ spec.add_dependency 'puma', '>= 5.0'
48
+ spec.add_dependency 'rack'
49
+
50
+ spec.add_development_dependency 'asciidoctor'
51
+ spec.add_development_dependency 'codecov'
52
+ spec.add_development_dependency 'relaxed-rubocop'
53
+ spec.add_development_dependency 'rspec-its'
54
+ spec.add_development_dependency 'rubocop'
55
+ spec.add_development_dependency 'simplecov'
56
+ spec.add_development_dependency 'yard'
30
57
 
31
- spec.add_dependency "puma", ">= 5.0"
32
-
33
- spec.add_development_dependency "asciidoctor"
34
- spec.add_development_dependency "rspec-its"
35
- spec.add_development_dependency "relaxed-rubocop"
36
58
  # Uncomment to register a new dependency of your gem
37
59
  # spec.add_dependency "example-gem", "~> 1.0"
38
60
 
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.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Konstantin Gredeskoul
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2021-01-18 00:00:00.000000000 Z
11
+ date: 2021-01-24 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: puma
@@ -24,6 +24,20 @@ dependencies:
24
24
  - - ">="
25
25
  - !ruby/object:Gem::Version
26
26
  version: '5.0'
27
+ - !ruby/object:Gem::Dependency
28
+ name: rack
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - ">="
32
+ - !ruby/object:Gem::Version
33
+ version: '0'
34
+ type: :runtime
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - ">="
39
+ - !ruby/object:Gem::Version
40
+ version: '0'
27
41
  - !ruby/object:Gem::Dependency
28
42
  name: asciidoctor
29
43
  requirement: !ruby/object:Gem::Requirement
@@ -39,7 +53,7 @@ dependencies:
39
53
  - !ruby/object:Gem::Version
40
54
  version: '0'
41
55
  - !ruby/object:Gem::Dependency
42
- name: rspec-its
56
+ name: codecov
43
57
  requirement: !ruby/object:Gem::Requirement
44
58
  requirements:
45
59
  - - ">="
@@ -66,11 +80,76 @@ dependencies:
66
80
  - - ">="
67
81
  - !ruby/object:Gem::Version
68
82
  version: '0'
69
- description: Daemonize puma without any external OS-dependent method
83
+ - !ruby/object:Gem::Dependency
84
+ name: rspec-its
85
+ requirement: !ruby/object:Gem::Requirement
86
+ requirements:
87
+ - - ">="
88
+ - !ruby/object:Gem::Version
89
+ version: '0'
90
+ type: :development
91
+ prerelease: false
92
+ version_requirements: !ruby/object:Gem::Requirement
93
+ requirements:
94
+ - - ">="
95
+ - !ruby/object:Gem::Version
96
+ version: '0'
97
+ - !ruby/object:Gem::Dependency
98
+ name: rubocop
99
+ requirement: !ruby/object:Gem::Requirement
100
+ requirements:
101
+ - - ">="
102
+ - !ruby/object:Gem::Version
103
+ version: '0'
104
+ type: :development
105
+ prerelease: false
106
+ version_requirements: !ruby/object:Gem::Requirement
107
+ requirements:
108
+ - - ">="
109
+ - !ruby/object:Gem::Version
110
+ version: '0'
111
+ - !ruby/object:Gem::Dependency
112
+ name: simplecov
113
+ requirement: !ruby/object:Gem::Requirement
114
+ requirements:
115
+ - - ">="
116
+ - !ruby/object:Gem::Version
117
+ version: '0'
118
+ type: :development
119
+ prerelease: false
120
+ version_requirements: !ruby/object:Gem::Requirement
121
+ requirements:
122
+ - - ">="
123
+ - !ruby/object:Gem::Version
124
+ version: '0'
125
+ - !ruby/object:Gem::Dependency
126
+ name: yard
127
+ requirement: !ruby/object:Gem::Requirement
128
+ requirements:
129
+ - - ">="
130
+ - !ruby/object:Gem::Version
131
+ version: '0'
132
+ type: :development
133
+ prerelease: false
134
+ version_requirements: !ruby/object:Gem::Requirement
135
+ requirements:
136
+ - - ">="
137
+ - !ruby/object:Gem::Version
138
+ version: '0'
139
+ description: "\nIn version 5.0 the authors of the popular Ruby web server Puma chose\nto
140
+ remove the daemonization support from Puma, because the code wasn't wall maintained,
141
+ \nand because other and perhaps better options exist (such as systemd, etc), not
142
+ to \nmention many people have switched to Kubernetes and Docker, where you want
143
+ to start \nall servers on the foreground.\n\nAnd yet, something useful and simple
144
+ got lost — in our humble opinion. Some folks were \nindeed happily using the `--daemonize`
145
+ feature until in 5.0 they got an error that this flag is \nnot supported.\n\nSo,
146
+ if you want to use the latest and greatest Puma 5+, but have it self-daemonize,
147
+ \nthis gem is for you. Just use *pumad* binary instead of *puma*, or require 'puma/daemon'
148
+ inside\nyour config file.\n"
70
149
  email:
71
150
  - kigster@gmail.com
72
151
  executables:
73
- - puma-daemon
152
+ - pumad
74
153
  extensions: []
75
154
  extra_rdoc_files: []
76
155
  files:
@@ -78,15 +157,20 @@ files:
78
157
  - ".gitignore"
79
158
  - ".rspec"
80
159
  - ".rubocop.yml"
160
+ - ".rubocop_todo.yml"
81
161
  - Gemfile
82
- - Gemfile.lock
83
162
  - LICENSE.txt
84
163
  - README.adoc
85
164
  - Rakefile
86
165
  - bin/console
87
166
  - bin/setup
88
- - exe/puma-daemon
167
+ - config/puma.rb
168
+ - exe/pumad
89
169
  - lib/puma/daemon.rb
170
+ - lib/puma/daemon/cli.rb
171
+ - lib/puma/daemon/configuration.rb
172
+ - lib/puma/daemon/dsl.rb
173
+ - lib/puma/daemon/runner.rb
90
174
  - lib/puma/daemon/version.rb
91
175
  - puma-daemon.gemspec
92
176
  homepage: https://github.com/kig/puma-daemon
@@ -104,15 +188,16 @@ required_ruby_version: !ruby/object:Gem::Requirement
104
188
  requirements:
105
189
  - - ">="
106
190
  - !ruby/object:Gem::Version
107
- version: 2.3.0
191
+ version: 2.4.0
108
192
  required_rubygems_version: !ruby/object:Gem::Requirement
109
193
  requirements:
110
194
  - - ">="
111
195
  - !ruby/object:Gem::Version
112
196
  version: '0'
113
197
  requirements: []
114
- rubygems_version: 3.2.4
198
+ rubygems_version: 3.1.4
115
199
  signing_key:
116
200
  specification_version: 4
117
- summary: Daemonize puma without any external OS-dependent method
201
+ summary: Restore somewhat Puma's ability to self-daemonize, since Puma 5.0 dropped
202
+ it
118
203
  test_files: []
@@ -1,67 +0,0 @@
1
- PATH
2
- remote: .
3
- specs:
4
- puma-daemon (0.1.0)
5
- puma (>= 5.0)
6
-
7
- GEM
8
- remote: https://rubygems.org/
9
- specs:
10
- asciidoctor (2.0.12)
11
- ast (2.4.1)
12
- diff-lcs (1.4.4)
13
- nio4r (2.5.4)
14
- parallel (1.20.1)
15
- parser (3.0.0.0)
16
- ast (~> 2.4.1)
17
- puma (5.1.1)
18
- nio4r (~> 2.0)
19
- rainbow (3.0.0)
20
- rake (13.0.3)
21
- regexp_parser (2.0.3)
22
- relaxed-rubocop (2.5)
23
- rexml (3.2.4)
24
- rspec (3.10.0)
25
- rspec-core (~> 3.10.0)
26
- rspec-expectations (~> 3.10.0)
27
- rspec-mocks (~> 3.10.0)
28
- rspec-core (3.10.1)
29
- rspec-support (~> 3.10.0)
30
- rspec-expectations (3.10.1)
31
- diff-lcs (>= 1.2.0, < 2.0)
32
- rspec-support (~> 3.10.0)
33
- rspec-its (1.3.0)
34
- rspec-core (>= 3.0.0)
35
- rspec-expectations (>= 3.0.0)
36
- rspec-mocks (3.10.1)
37
- diff-lcs (>= 1.2.0, < 2.0)
38
- rspec-support (~> 3.10.0)
39
- rspec-support (3.10.1)
40
- rubocop (0.93.1)
41
- parallel (~> 1.10)
42
- parser (>= 2.7.1.5)
43
- rainbow (>= 2.2.2, < 4.0)
44
- regexp_parser (>= 1.8)
45
- rexml
46
- rubocop-ast (>= 0.6.0)
47
- ruby-progressbar (~> 1.7)
48
- unicode-display_width (>= 1.4.0, < 2.0)
49
- rubocop-ast (1.4.0)
50
- parser (>= 2.7.1.5)
51
- ruby-progressbar (1.11.0)
52
- unicode-display_width (1.7.0)
53
-
54
- PLATFORMS
55
- x86_64-darwin-20
56
-
57
- DEPENDENCIES
58
- asciidoctor
59
- puma-daemon!
60
- rake (~> 13.0)
61
- relaxed-rubocop
62
- rspec (~> 3.0)
63
- rspec-its
64
- rubocop (~> 0.80)
65
-
66
- BUNDLED WITH
67
- 2.2.4
@@ -1,3 +0,0 @@
1
- #!/usr/bin/env ruby
2
-
3
- require "puma/daemon"