Permalink
Browse files

Merge pull request #168 from guard/fix_extension_regexp

ignore css.map files [fix: #165]
  • Loading branch information...
2 parents dd931cf + 37ce562 commit 38a3f5de16a37f9e99777db203c4bd6dfa0fba3b @e2 e2 committed on GitHub Aug 1, 2016
Showing with 7 additions and 1 deletion.
  1. +1 −1 lib/guard/livereload/templates/Guardfile
  2. +6 −0 spec/lib/guard/livereload/template_spec.rb
@@ -17,7 +17,7 @@ guard 'livereload' do
# file types LiveReload may optimize refresh for
compiled_exts = extensions.values.uniq
- watch(%r{public/.+\.(#{compiled_exts * '|'})})
+ watch(%r{public/.+\.(#{compiled_exts * '|'})\z})
extensions.each do |ext, type|
watch(%r{
@@ -22,6 +22,12 @@
expect(subject.changed('public/foo.jpg')).to eq(%w(public/foo.jpg))
expect(subject.changed('public/foo.jpeg')).to eq(%w(public/foo.jpeg))
end
+
+ context 'when extention does not match exactly' do
+ it 'does not reload' do
+ expect(subject.changed('public/main.css.map')).to eq([])
+ end
+ end
end
context 'with old Rails asset pipeline naming' do

0 comments on commit 38a3f5d

Please sign in to comment.