Skip to content
Browse files

Update lib/rb-inotify/notifier.rb

Avoid needing to escape glob patterns in directory names
  • Loading branch information...
1 parent 3255dca commit aca171497f492b3846263401ba452210887480c1 @geoffyoungs committed Dec 5, 2012
Showing with 2 additions and 1 deletion.
  1. +2 −1 lib/rb-inotify/notifier.rb
View
3 lib/rb-inotify/notifier.rb
@@ -189,7 +189,8 @@ def to_io
def watch(path, *flags, &callback)
return Watcher.new(self, path, *flags, &callback) unless flags.include?(:recursive)
- Dir.glob(File.join(path, '*'), File::FNM_DOTMATCH).each do |d|
+ Dir.new(path).each do |base|
+ d = File.join(path, base)
binary_d = d.respond_to?(:force_encoding) ? d.dup.force_encoding('BINARY') : d
next if binary_d =~ /\/\.\.?$/ # Current or parent directory
watch(d, *flags, &callback) if !RECURSIVE_BLACKLIST.include?(d) && File.directory?(d)

0 comments on commit aca1714

Please sign in to comment.
Something went wrong with that request. Please try again.