1
0
Fork 0
mirror of https://github.com/sinatra/sinatra synced 2023-03-27 23:18:01 -04:00

don't run if we are already running, closes #31

This commit is contained in:
Gabriel Andretta 2012-01-21 00:09:32 -03:00
parent 3cfef30d02
commit ec72568733

View file

@ -232,6 +232,15 @@ module Sinatra
# Contains the methods defined in Sinatra::Base that are overriden. # Contains the methods defined in Sinatra::Base that are overriden.
module BaseMethods module BaseMethods
# Protects Sinatra::Base.run! from being called more than once.
def run!(*args)
if settings.reloader?
super unless running?
else
super
end
end
# Does everything Sinatra::Base#route does, but it also tells the # Does everything Sinatra::Base#route does, but it also tells the
# +Watcher::List+ for the Sinatra application to watch the defined # +Watcher::List+ for the Sinatra application to watch the defined
# route. # route.