Skip to content

Commit

Permalink
WIP: Richer calls to _queue_change
Browse files Browse the repository at this point in the history
  • Loading branch information
floehopper committed Aug 7, 2019
1 parent 87ac6ea commit c63ed31
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions lib/listen/adapter/jruby.rb
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,16 @@ def _run
next if kind == StandardWatchEventKinds::OVERFLOW
name = event.context
child = dir.resolve(name)
p child.to_s
pathname = Pathname.new(child.to_s).dirname
_queue_change(:dir, pathname, '.', recursive: true)
dirname = Pathname.new(child.to_s).dirname
full_path = Pathname.new(child.to_s)
if full_path.directory?
p [:dir, dirname]
_queue_change(:dir, dirname, '.', recursive: true)
elsif full_path.exist?
path = full_path.relative_path_from(dirname)
p [:file, dirname, path.to_s]
_queue_change(:file, dirname, path.to_s, {})
end
end
end
valid = key.reset
Expand Down

0 comments on commit c63ed31

Please sign in to comment.