From fa98f84e432dda91bdfbca4a8746391a1941afee Mon Sep 17 00:00:00 2001 From: Arie Date: Sun, 2 Jun 2013 13:16:31 +0200 Subject: [PATCH] use configured rackup file or fall back to the default config.ru in the app_configured? check --- lib/puma/configuration.rb | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) diff --git a/lib/puma/configuration.rb b/lib/puma/configuration.rb index 418f3b10..312ffa18 100644 --- a/lib/puma/configuration.rb +++ b/lib/puma/configuration.rb @@ -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|