driskell-listen 3.0.6.10 → 3.0.6.11

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 1b754e9ebee0d0d18528b37fce13049f588fcd6b
4
- data.tar.gz: a60593e7ee856b6b283c3745581efd3a6c6d7d6c
3
+ metadata.gz: dffb8bdb5fce6db954a0ac43cfb4fd97ef6773e7
4
+ data.tar.gz: d07581a5ce6678d8b44298057694bead50c797f8
5
5
  SHA512:
6
- metadata.gz: 45d904cf82eb65198fa77a329dfcec72605c88bcabdd7adfff755e2e10b39bab31b5969296cc4b6520d958be335d448d5252a36f53a5bdfcceada4be641d7251
7
- data.tar.gz: f979e13bfd024ebaff176e4079af627d8e3fdb0821040d35ebee7a05823f07ae242712c6f3db293e53ea90e2438087c15b7c5d3d6f59fdc75c950cfc8c588c49
6
+ metadata.gz: 8ee2407d4f7ff92f316a2a07a3c2ab2ed26fcbbbfca39659cccbfd75e9bf8232def6a0bd6aae54ba502f7c8ab51dd66af8066acc3b94f8b77f190acba561cf8b
7
+ data.tar.gz: 0f356bb1cd066400a5f910f1edf5a86bda18fc768937d77d64e5150daefc4fafc9fe1fd396d3229f8e53e60f1ac400f17dbeb5837b68fd59203167804441d410
@@ -6,7 +6,8 @@ module Driskell::Listen
6
6
  def self.scan(snapshot, rel_path, options)
7
7
  record = snapshot.record
8
8
 
9
- previous = record.dir_entries(rel_path)
9
+ # Grab previous entries - and dup so we don't tamper with original list
10
+ previous = record.dir_entries(rel_path).dup
10
11
 
11
12
  dir = Pathname.new(record.root)
12
13
  path = dir + rel_path
@@ -20,18 +21,20 @@ module Driskell::Listen
20
21
 
21
22
  record.update_dir(rel_path)
22
23
 
23
- current.each do |full_path|
24
+ current.each do |item_full_path|
25
+ item_basename = item_full_path.basename.to_s
26
+
24
27
  # Find old type so we can ensure we invalidate directory contents
25
28
  # if we were previously a file, and vice versa
26
- if previous.key?(full_path.basename)
27
- old = previous.delete(full_path.basename)
28
- old_type = old.key?(:mtime) ? :dir : :file
29
+ if previous.key?(item_basename)
30
+ old = previous.delete(item_basename)
31
+ old_type = old.key?(:mtime) ? :file : :dir
29
32
  else
30
33
  old_type = nil
31
34
  end
32
35
 
33
- item_rel_path = full_path.relative_path_from(dir).to_s
34
- if detect_type(full_path) == :dir
36
+ item_rel_path = item_full_path.relative_path_from(dir).to_s
37
+ if detect_type(item_full_path) == :dir
35
38
  if old_type == :file
36
39
  snapshot.invalidate(:file, item_rel_path, options)
37
40
  end
@@ -1,5 +1,5 @@
1
1
  module Driskell
2
2
  module Listen
3
- VERSION = '3.0.6.10'
3
+ VERSION = '3.0.6.11'
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: driskell-listen
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.0.6.10
4
+ version: 3.0.6.11
5
5
  platform: ruby
6
6
  authors:
7
7
  - Thibaud Guillaume-Gentil (With modifications by Jason Woods)