Merge pull request #835 from artm/need_reload_fix

fix 'needs_to_reload?' regexps
This commit is contained in:
Thomas Reynolds 2013-03-22 11:13:07 -07:00
commit cd539f4e91

View file

@ -101,7 +101,7 @@ module Middleman
added_and_modified = (modified + added)
# See if the changed file is config.rb or lib/*.rb
if needs_to_reload?(added_and_modified) || needs_to_reload?(removed)
if needs_to_reload?(added_and_modified + removed)
reload
else
added_and_modified.each do |path|
@ -164,7 +164,7 @@ module Middleman
@webrick ||= setup_webrick(@options[:debug] || false)
start_file_watcher
rack_app = app.class.to_rack_app
# Add in the meta pages application
@ -189,8 +189,8 @@ module Middleman
def needs_to_reload?(paths)
match_against = [
%r{^config\.rb},
%r{^lib/^[^\.](.*)\.rb$},
%r{^helpers/^[^\.](.*)_helper\.rb$}
%r{^lib/[^\.](.*)\.rb$},
%r{^helpers/[^\.](.*)\.rb$}
]
if @options[:reload_paths]