diff --git a/lib/listen/directory.rb b/lib/listen/directory.rb index 840c8863..19178b3e 100644 --- a/lib/listen/directory.rb +++ b/lib/listen/directory.rb @@ -36,7 +36,7 @@ def self.scan(snapshot, rel_path, options) end # TODO: this is not tested properly - previous = previous.reject { |entry, _| current.include? path + entry } + previous = previous.reject { |entry, _| current.include?(path + entry) } _async_changes(snapshot, Pathname.new(rel_path), previous, options) rescue Errno::ENOENT, Errno::EHOSTDOWN diff --git a/lib/listen/record.rb b/lib/listen/record.rb index e34ae275..7cdb5662 100644 --- a/lib/listen/record.rb +++ b/lib/listen/record.rb @@ -35,7 +35,7 @@ def unset_path(rel_path) def file_data(rel_path) dirname, basename = Pathname(rel_path).split.map(&:to_s) - if [nil, '', '.'].include? dirname + if [nil, '', '.'].include?(dirname) @tree[basename] ||= {} @tree[basename].dup else @@ -46,7 +46,7 @@ def file_data(rel_path) end def dir_entries(rel_path) - subtree = if ['', '.'].include? rel_path.to_s + subtree = if ['', '.'].include?(rel_path.to_s) @tree else @tree[rel_path.to_s] ||= _auto_hash