mirror of
https://github.com/puma/puma.git
synced 2022-11-09 13:48:40 -05:00
use configured rackup file or fall back to the default config.ru in the app_configured? check
This commit is contained in:
parent
10b6667403
commit
fa98f84e43
1 changed files with 7 additions and 10 deletions
|
@ -70,12 +70,11 @@ module Puma
|
|||
# Indicate if there is a properly configured app
|
||||
#
|
||||
def app_configured?
|
||||
return true if @options[:app]
|
||||
if path = @options[:rackup]
|
||||
return File.exists?(path)
|
||||
@options[:app] || File.exists?(rackup)
|
||||
end
|
||||
|
||||
false
|
||||
def rackup
|
||||
@options[:rackup] || DefaultRackup
|
||||
end
|
||||
|
||||
# Load the specified rackup file, pull an options from
|
||||
|
@ -85,13 +84,11 @@ module Puma
|
|||
app = @options[:app]
|
||||
|
||||
unless app
|
||||
path = @options[:rackup] || DefaultRackup
|
||||
|
||||
unless File.exists?(path)
|
||||
raise "Missing rackup file '#{path}'"
|
||||
unless File.exists?(rackup)
|
||||
raise "Missing rackup file '#{rackup}'"
|
||||
end
|
||||
|
||||
app, options = Rack::Builder.parse_file path
|
||||
app, options = Rack::Builder.parse_file rackup
|
||||
@options.merge! options
|
||||
|
||||
options.each do |key,val|
|
||||
|
|
Loading…
Add table
Reference in a new issue