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 # 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|