Skip to content

Commit

Permalink
Fix force_encoding check on Ruby 1.8.
Browse files Browse the repository at this point in the history
  • Loading branch information
nex3 committed Sep 27, 2011
1 parent 2277d70 commit ef9435e
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lib/rb-inotify/notifier.rb
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,8 @@ 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|
next if d.dup.force_encoding('BINARY') =~ /\/\.\.?$/ # Current or parent directory
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)
end

Expand Down

0 comments on commit ef9435e

Please sign in to comment.