Method: Listen::Record#file_data
- Defined in:
- lib/listen/record.rb
#file_data(dir, rel_path) ⇒ Object
30 31 32 33 34 35 36 37 38 39 40 41 |
# File 'lib/listen/record.rb', line 30 def file_data(dir, rel_path) root = @paths[dir.to_s] dirname, basename = Pathname(rel_path).split.map(&:to_s) if [nil, '', '.'].include? dirname root[basename] ||= {} root[basename].dup else root[dirname] ||= {} root[dirname][basename] ||= {} root[dirname][basename].dup end end |