From 8a898f823905df295eec6b79a9ef1200452fec9a Mon Sep 17 00:00:00 2001 From: "Rico Sta. Cruz" Date: Sat, 16 Jun 2012 06:20:40 +0800 Subject: [PATCH] Persist the preview servers options (like port) when reloading --- middleman-core/lib/middleman-core/preview_server.rb | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/middleman-core/lib/middleman-core/preview_server.rb b/middleman-core/lib/middleman-core/preview_server.rb index ed4bdb47..7ead903c 100644 --- a/middleman-core/lib/middleman-core/preview_server.rb +++ b/middleman-core/lib/middleman-core/preview_server.rb @@ -40,6 +40,10 @@ module Middleman register_signal_handlers unless ::Middleman::WINDOWS 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 end @@ -56,7 +60,7 @@ module Middleman # @return [void] def reload stop - start + start @last_options end # Stop the current instance, exit Webrick