puma-heroku 1.1.0 → 2.0.0

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: 216d3ac5271277c9fd8fdbd5609a1821bf1ca092310bfbeda0c93ceed20747ef
4
- data.tar.gz: 1f87bd9dadc93c0f27dce7c2a235d9c2d4eeca405739ed0952401e3eda43440e
3
+ metadata.gz: 90acb969a0d0ec50ff8f967a5d85b87bca07dd3655dceaa5b0af47bcbe2a8ae5
4
+ data.tar.gz: 8459f0321d2d69ef0fb6fbf4f2086db8a0d1017f7e528deb68ba136116231233
5
5
  SHA512:
6
- metadata.gz: eba79fb8ca09ddc005480a21a277308b31368f54fada4459c247fe5dbe6140e6610efa4fe8aa13753be8e2c8ddc4ff1ed7f635e53581b88c48f8bdaf52e0cebf
7
- data.tar.gz: 5500a25ba768c628cd85b6548d9003e6f2dda68174f9761779b2170a0eff0e77d36c0a27dad8a6eb80c9ddb51160b02fe417eed56ab1441be80c2ee8c31d720f
6
+ metadata.gz: 7dde6ec506ef93f7c7d4f4157ab91fb626bade5aa16c5b2db51c57d73176a5eff7cb03f3d7f2ab552959837aad6ffaab6f9cbb915295d0eab5536eeed2f62608
7
+ data.tar.gz: 0cc8c575780d8634a41bb3346d09aea2607544e3b23730c1d4f43aeb7861a033412cb29e18dc52c1777b15793bdbaae6a8b25303410fc70dc3fcdce00e434f84
data/README.md CHANGED
@@ -1,40 +1,20 @@
1
1
  # puma-heroku
2
2
 
3
- A Puma plugin with best-practices configuration and handy configuration
4
- variables for Heroku deployments.
3
+ This gem is being sunset. Puma 5.0+ now configures Puma in most of the ways that this plugin did.
5
4
 
6
- You can read Heroku's documentation on the topic [here](https://devcenter.heroku.com/articles/deploying-rails-applications-with-the-puma-web-server). Most of the ideas there apply to all ruby apps running on Puma. Important Note: In that article, Heroku uses a different (rails-specific) environment variable for configuring threads. This plugin uses the generic `MAX_THREADS`, but will use `RAILS_MAX_THREADS` if available.
5
+ ## Removing this gem from your Gemfile
7
6
 
8
- ## Installation
7
+ 1. Upgrade to Puma 5.0.
8
+ 2. Add `c.port ENV['PORT'] || 3000` to your Puma config file, or `-p ${PORT:-3000}` to your `puma` invocation in your Procfile.
9
+ 3. Remove this gem.
9
10
 
10
- Add this line to your application's Gemfile:
11
+ ## More Notes on Upgrading from 1.0
11
12
 
12
- ```ruby
13
- gem 'puma-heroku'
14
- ```
13
+ In 1.x, this plugin set `workers` to `1` if WEB_CONCURRENCY is not set. However, this isn't optimal, as it creates a master and worker process, when instead we could just use single mode (`workers 0`) and save memory. 2.x of this plugin uses the Puma 5 default, which is `workers 0` if `WEB_CONCURRENCY` is not set.
15
14
 
16
- And then execute:
15
+ If you are using Rails 4.0 or less, you will have to [add your own `on_worker_boot` block.](https://devcenter.heroku.com/articles/deploying-rails-applications-with-the-puma-web-server#on-worker-boot), it has been removed.
17
16
 
18
- $ bundle
19
-
20
- Or install it yourself as:
21
-
22
- $ gem install puma-heroku
23
-
24
- Then add to your puma config.rb:
25
-
26
- # config/puma.rb
27
- plugin 'heroku'
28
-
29
-
30
- ## Usage
31
-
32
- Read about how to configure puma to use this plugin here: https://github.com/puma/puma#plugins
33
-
34
- There are two variables this plugin reads from the environment which control its behavior.
35
-
36
- * `WEB_CONCURRENCY` — How many workers to run. This will be ignored on JRuby and Windows, where only 1 worker will be run.
37
- * `MAX_THREADS` — The number of threads to run per worker. Note that this also sets the minimum number of threads to the same value, which is a recommended approach, especially in a single-app environment such as Heroku. If you are using Rails, you may want to use `RAILS_MAX_THREADS` instead, which is also supported.
17
+ As of Puma 5.0/this plugin 2.x, all this gem does is set the port to `ENV["PORT"]`. In Puma 6.0, Puma will listen to `ENV["PORT"]` by default, and this plugin will receive no further updates (because all of its changes will be merged into the Puma default config).
38
18
 
39
19
  ## License
40
20
 
@@ -1,23 +1,7 @@
1
1
  Puma::Plugin.create do
2
2
  def config(c)
3
- workers_count = Integer(ENV['WEB_CONCURRENCY'] || 1)
4
- threads_count = Integer(ENV['RAILS_MAX_THREADS'] || ENV['MAX_THREADS'] || 5)
5
- c.threads threads_count, threads_count
6
-
7
3
  c.port ENV['PORT'] || 3000
8
- c.environment ENV['RACK_ENV'] || ENV['RAILS_ENV'] || 'development'
9
-
10
- if workers_supported? && workers_count > 1
11
- c.preload_app!
12
- c.workers workers_count
13
-
14
- # Not necessary in Rails 5.2+, see https://github.com/rails/rails/pull/29807
15
- if defined?(::ActiveRecord) && defined?(::ActiveRecord::Base) && Gem::Version.new(Rails.version) < Gem::Version.new('5.2.0')
16
- c.before_fork { ActiveRecord::Base.connection_pool.disconnect! }
17
- c.on_worker_boot { ActiveRecord::Base.establish_connection }
18
- end
19
- end
20
4
  end
21
5
 
22
- VERSION = "1.1.0"
6
+ VERSION = "2.0.0"
23
7
  end
@@ -15,13 +15,13 @@ Gem::Specification.new do |spec|
15
15
 
16
16
  spec.summary = %q{Puma integration for Heroku}
17
17
  spec.description = %q{A Puma plugin that contains the default Heroku config}
18
- spec.homepage = "https://github.com/evanphx/puma-heroku"
18
+ spec.homepage = "https://github.com/puma/puma-heroku"
19
19
  spec.license = "MIT"
20
20
 
21
21
  spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
22
22
  spec.require_paths = ["lib"]
23
23
 
24
- spec.add_runtime_dependency "puma", ">= 3.0", "< 5.0"
24
+ spec.add_runtime_dependency "puma", ">= 5.0", "< 6.0"
25
25
 
26
26
  spec.add_development_dependency "bundler"
27
27
  spec.add_development_dependency "rake"
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: puma-heroku
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.0
4
+ version: 2.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Evan Phoenix
8
- autorequire:
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-09-05 00:00:00.000000000 Z
11
+ date: 2020-10-10 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: puma
@@ -16,20 +16,20 @@ dependencies:
16
16
  requirements:
17
17
  - - ">="
18
18
  - !ruby/object:Gem::Version
19
- version: '3.0'
19
+ version: '5.0'
20
20
  - - "<"
21
21
  - !ruby/object:Gem::Version
22
- version: '5.0'
22
+ version: '6.0'
23
23
  type: :runtime
24
24
  prerelease: false
25
25
  version_requirements: !ruby/object:Gem::Requirement
26
26
  requirements:
27
27
  - - ">="
28
28
  - !ruby/object:Gem::Version
29
- version: '3.0'
29
+ version: '5.0'
30
30
  - - "<"
31
31
  - !ruby/object:Gem::Version
32
- version: '5.0'
32
+ version: '6.0'
33
33
  - !ruby/object:Gem::Dependency
34
34
  name: bundler
35
35
  requirement: !ruby/object:Gem::Requirement
@@ -72,11 +72,11 @@ files:
72
72
  - Rakefile
73
73
  - lib/puma/plugin/heroku.rb
74
74
  - puma-heroku.gemspec
75
- homepage: https://github.com/evanphx/puma-heroku
75
+ homepage: https://github.com/puma/puma-heroku
76
76
  licenses:
77
77
  - MIT
78
78
  metadata: {}
79
- post_install_message:
79
+ post_install_message:
80
80
  rdoc_options: []
81
81
  require_paths:
82
82
  - lib
@@ -91,8 +91,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
91
91
  - !ruby/object:Gem::Version
92
92
  version: '0'
93
93
  requirements: []
94
- rubygems_version: 3.0.3
95
- signing_key:
94
+ rubygems_version: 3.1.4
95
+ signing_key:
96
96
  specification_version: 4
97
97
  summary: Puma integration for Heroku
98
98
  test_files: []