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 +4 -4
- data/lib/driskell-listen/directory.rb +10 -7
- data/lib/driskell-listen/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: dffb8bdb5fce6db954a0ac43cfb4fd97ef6773e7
|
4
|
+
data.tar.gz: d07581a5ce6678d8b44298057694bead50c797f8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
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 |
|
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?(
|
27
|
-
old = previous.delete(
|
28
|
-
old_type = old.key?(:mtime) ? :
|
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 =
|
34
|
-
if detect_type(
|
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
|