Merge pull request #835 from artm/need_reload_fix
fix 'needs_to_reload?' regexps
This commit is contained in:
commit
cd539f4e91
|
@ -101,7 +101,7 @@ module Middleman
|
||||||
added_and_modified = (modified + added)
|
added_and_modified = (modified + added)
|
||||||
|
|
||||||
# See if the changed file is config.rb or lib/*.rb
|
# 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
|
reload
|
||||||
else
|
else
|
||||||
added_and_modified.each do |path|
|
added_and_modified.each do |path|
|
||||||
|
@ -164,7 +164,7 @@ module Middleman
|
||||||
@webrick ||= setup_webrick(@options[:debug] || false)
|
@webrick ||= setup_webrick(@options[:debug] || false)
|
||||||
|
|
||||||
start_file_watcher
|
start_file_watcher
|
||||||
|
|
||||||
rack_app = app.class.to_rack_app
|
rack_app = app.class.to_rack_app
|
||||||
|
|
||||||
# Add in the meta pages application
|
# Add in the meta pages application
|
||||||
|
@ -189,8 +189,8 @@ module Middleman
|
||||||
def needs_to_reload?(paths)
|
def needs_to_reload?(paths)
|
||||||
match_against = [
|
match_against = [
|
||||||
%r{^config\.rb},
|
%r{^config\.rb},
|
||||||
%r{^lib/^[^\.](.*)\.rb$},
|
%r{^lib/[^\.](.*)\.rb$},
|
||||||
%r{^helpers/^[^\.](.*)_helper\.rb$}
|
%r{^helpers/[^\.](.*)\.rb$}
|
||||||
]
|
]
|
||||||
|
|
||||||
if @options[:reload_paths]
|
if @options[:reload_paths]
|
||||||
|
|
Loading…
Reference in a new issue