Skip to content

Commit

Permalink
Switch to puma for web server
Browse files Browse the repository at this point in the history
  • Loading branch information
nertzy committed May 16, 2024
1 parent 9da0542 commit 2b63f9a
Show file tree
Hide file tree
Showing 6 changed files with 61 additions and 8 deletions.
2 changes: 1 addition & 1 deletion Procfile
Original file line number Diff line number Diff line change
@@ -1 +1 @@
web: bin/rackup config.ru -p ${PORT:-5000}
web: bin/puma
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ This reduces the amount of http calls that are needed to poll for changes.

```
bundle install
bundle exec rackup -p 4567 config.ru
bin/puma
open http://localhost:4567
```

Expand Down
27 changes: 27 additions & 0 deletions bin/puma
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
#!/usr/bin/env ruby
# frozen_string_literal: true

#
# This file was generated by Bundler.
#
# The application 'puma' is installed as part of a gem, and
# this file is here to facilitate running it.
#

ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../Gemfile", __dir__)

bundle_binstub = File.expand_path("bundle", __dir__)

if File.file?(bundle_binstub)
if File.read(bundle_binstub, 300).include?("This file was generated by Bundler")
load(bundle_binstub)
else
abort("Your `bin/bundle` was not generated by Bundler, so this binstub cannot run.
Replace `bin/bundle` by running `bundle binstubs bundler --force`, then run this command again.")
end
end

require "rubygems"
require "bundler/setup"

load Gem.bin_path("puma", "puma")
27 changes: 27 additions & 0 deletions bin/pumactl
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
#!/usr/bin/env ruby
# frozen_string_literal: true

#
# This file was generated by Bundler.
#
# The application 'pumactl' is installed as part of a gem, and
# this file is here to facilitate running it.
#

ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../Gemfile", __dir__)

bundle_binstub = File.expand_path("bundle", __dir__)

if File.file?(bundle_binstub)
if File.read(bundle_binstub, 300).include?("This file was generated by Bundler")
load(bundle_binstub)
else
abort("Your `bin/bundle` was not generated by Bundler, so this binstub cannot run.
Replace `bin/bundle` by running `bundle binstubs bundler --force`, then run this command again.")
end
end

require "rubygems"
require "bundler/setup"

load Gem.bin_path("puma", "pumactl")
10 changes: 4 additions & 6 deletions bin/rackup
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,12 @@
# this file is here to facilitate running it.
#

require "pathname"
ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../../Gemfile",
Pathname.new(__FILE__).realpath)
ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../Gemfile", __dir__)

bundle_binstub = File.expand_path("../bundle", __FILE__)
bundle_binstub = File.expand_path("bundle", __dir__)

if File.file?(bundle_binstub)
if File.read(bundle_binstub, 300) =~ /This file was generated by Bundler/
if File.read(bundle_binstub, 300).include?("This file was generated by Bundler")
load(bundle_binstub)
else
abort("Your `bin/bundle` was not generated by Bundler, so this binstub cannot run.
Expand All @@ -26,4 +24,4 @@ end
require "rubygems"
require "bundler/setup"

load Gem.bin_path("rack", "rackup")
load Gem.bin_path("rackup", "rackup")
1 change: 1 addition & 0 deletions lib/github/client.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
require "srp/api"
require "active_support"
require "active_support/isolated_execution_state" # See https://github.com/rails/rails/issues/43851
require "active_support/core_ext/numeric/time"
require_relative "../redis_cache"
Expand Down

0 comments on commit 2b63f9a

Please sign in to comment.