Skip to content

Commit

Permalink
issue #548: refactor to add () around include? args
Browse files Browse the repository at this point in the history
  • Loading branch information
ColinDKelley committed Jan 13, 2022
1 parent 177125d commit 79db32e
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion lib/listen/directory.rb
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions lib/listen/record.rb
Expand Up @@ -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
Expand All @@ -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
Expand Down

0 comments on commit 79db32e

Please sign in to comment.