Persist the preview servers options (like port) when reloading

This commit is contained in:
Rico Sta. Cruz 2012-06-16 06:20:40 +08:00
parent f4feda8b93
commit 8a898f8239

View file

@ -40,6 +40,10 @@ module Middleman
register_signal_handlers unless ::Middleman::WINDOWS register_signal_handlers unless ::Middleman::WINDOWS
start_file_watcher unless options[:"disable-watcher"] start_file_watcher unless options[:"disable-watcher"]
# Save the last-used options so it may be re-used when
# reloading later on.
@last_options = options
@webrick.start @webrick.start
end end
@ -56,7 +60,7 @@ module Middleman
# @return [void] # @return [void]
def reload def reload
stop stop
start start @last_options
end end
# Stop the current instance, exit Webrick # Stop the current instance, exit Webrick