Permalink
Browse files

Fix the Listen plugin.

Closes #372
Closes #370
Closes #362
  • Loading branch information...
1 parent 60a9db3 commit 0a2eafd83ad162a7c878da8fbde4f28f3a00168e @Maher4Ever Maher4Ever committed with nex3 Apr 27, 2012
Showing with 10 additions and 6 deletions.
  1. +2 −0 doc-src/SASS_CHANGELOG.md
  2. +8 −6 lib/sass/plugin/listener.rb
@@ -7,6 +7,8 @@
* Don't crash when calling `#inspect` on an internal Sass tree object in Ruby
1.9.
+* Fix some bugs in `sass --watch` introduces in 3.1.16. Thanks to [Maher
+ Sallam](https://github.com/Maher4Ever).
## 3.1.16
@@ -14,20 +14,22 @@ def initialize
end
def directory(path, events)
- (@directories[path] ||= []) << events
+ (@directories[File.expand_path(path)] ||= []) << events
end
def file(path, events)
file_base = File.basename(path)
directory(File.dirname(path), {
- :modified => file_event_fn(events[:modified], file_base),
- :added => file_event_fn(events[:added], file_base),
- :removed => file_event_fn(events[:removed], file_base)
- })
+ :modified => file_event_fn(events[:modified], file_base),
+ :added => file_event_fn(events[:added], file_base),
+ :removed => file_event_fn(events[:removed], file_base)
+ })
end
def start!
- listener = Listen::MultiListener.new(*@directories.keys) do |modified, added, removed|
+ args = @directories.keys.dup
+ args << {:force_polling => Sass::Util.windows?}
+ listener = Listen::MultiListener.new(*args) do |modified, added, removed|
modified = modified.group_by {|path| File.dirname(path)}
added = added.group_by {|path| File.dirname(path)}
removed = removed.group_by {|path| File.dirname(path)}

0 comments on commit 0a2eafd

Please sign in to comment.