1
0
Fork 0
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:
Arie 2013-06-02 13:16:31 +02:00
parent 10b6667403
commit fa98f84e43

View file

@ -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)
end
@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|