1
0
Fork 0
mirror of https://github.com/puma/puma.git synced 2022-11-09 13:48:40 -05:00

Error out early if there is no app configured

This commit is contained in:
Evan Phoenix 2013-05-31 09:59:45 -07:00
parent 93ed2480d8
commit bc6b825128
2 changed files with 21 additions and 0 deletions

View file

@ -419,6 +419,11 @@ module Puma
@binder.parse @options[:binds], self
unless @config.app_configured?
error "No application configured, nothing to run"
exit 1
end
if @options[:daemon]
Process.daemon(true, @io_redirected)
end
@ -651,6 +656,11 @@ module Puma
@binder.parse @options[:binds], self
unless @config.app_configured?
error "No application configured, nothing to run"
exit 1
end
read, write = Puma::Util.pipe
Signal.trap "SIGCHLD" do

View file

@ -67,6 +67,17 @@ module Puma
end
end
# 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
false
end
# Load the specified rackup file, pull an options from
# the rackup file, and set @app.
#