Permalink
Browse files

fix(ignore): ignore files specificed in :ignore config

  • Loading branch information...
jessepollak committed May 4, 2016
1 parent 0f0d711 commit d0ac967ef9de07a1eca637abab7d956d978c3daf
Showing with 9 additions and 2 deletions.
  1. +9 −2 lib/middleman-livereload/extension_3_1.rb
@@ -35,15 +35,22 @@ def initialize(app, options_hash={}, &block)
livereload_css_target = options.livereload_css_target
livereload_css_pattern = options.livereload_css_pattern

extension = self

app.ready do
if @reactor
@reactor.app = self
else
@reactor = ::Middleman::LiveReload::Reactor.new(options_hash, self)
end

ignored = lambda do |file|
return true if files.respond_to?(:ignored) && files.send(:ignored?, file)
extension.options.ignore.any? { |i| file.to_s.match(i) }
end

files.changed do |file|
next if files.respond_to?(:ignored?) && files.send(:ignored?, file)
next if ignored.call(file)

logger.debug "LiveReload: File changed - #{file}"

@@ -68,7 +75,7 @@ def initialize(app, options_hash={}, &block)
end

files.deleted do |file|
next if files.respond_to?(:ignored?) && files.send(:ignored?, file)
next if ignored.call(file)

logger.debug "LiveReload: File deleted - #{file}"

0 comments on commit d0ac967

Please sign in to comment.