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 bc02bad
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)
dir = Pathname.new(child.to_s).dirname
full_path = Pathname.new(child.to_s)
if full_path.directory?
p [:dir, dir]
_queue_change(:dir, dir, '.', recursive: true)
elsif full_path.exist?
path = full_path.relative_path_from(dir)
p [:file, dir, path.to_s]
_queue_change(:file, dir, path.to_s, {})
end
end
end
valid = key.reset
Expand Down

0 comments on commit bc02bad

Please sign in to comment.