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
|
# Indicate if there is a properly configured app
|
||||||
#
|
#
|
||||||
def app_configured?
|
def app_configured?
|
||||||
return true if @options[:app]
|
@options[:app] || File.exists?(rackup)
|
||||||
if path = @options[:rackup]
|
end
|
||||||
return File.exists?(path)
|
|
||||||
end
|
|
||||||
|
|
||||||
false
|
def rackup
|
||||||
|
@options[:rackup] || DefaultRackup
|
||||||
end
|
end
|
||||||
|
|
||||||
# Load the specified rackup file, pull an options from
|
# Load the specified rackup file, pull an options from
|
||||||
|
@ -85,13 +84,11 @@ module Puma
|
||||||
app = @options[:app]
|
app = @options[:app]
|
||||||
|
|
||||||
unless app
|
unless app
|
||||||
path = @options[:rackup] || DefaultRackup
|
unless File.exists?(rackup)
|
||||||
|
raise "Missing rackup file '#{rackup}'"
|
||||||
unless File.exists?(path)
|
|
||||||
raise "Missing rackup file '#{path}'"
|
|
||||||
end
|
end
|
||||||
|
|
||||||
app, options = Rack::Builder.parse_file path
|
app, options = Rack::Builder.parse_file rackup
|
||||||
@options.merge! options
|
@options.merge! options
|
||||||
|
|
||||||
options.each do |key,val|
|
options.each do |key,val|
|
||||||
|
|
Loading…
Add table
Reference in a new issue