listen 3.6.0 → 3.7.0
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/listen/adapter/base.rb +1 -1
- data/lib/listen/adapter/linux.rb +3 -6
- data/lib/listen/error.rb +1 -0
- data/lib/listen/record.rb +4 -1
- data/lib/listen/silencer.rb +5 -7
- data/lib/listen/version.rb +1 -1
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ff9bdc7fe6e17c76745c2bd710f79322f22ebd7f7274241403f4132a575d2a7a
|
4
|
+
data.tar.gz: 3868e870e71badf618acb9f50a6d36227f722dd592360e894bb7cc9e2b5feb67
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: dbdddb8b8196ed73ae3e23c1bcea1396451bfd2fa36524778bbfbb98dc4565fd248d9035226c286c9feab1b92fddc61c2f0903159c8b4717c9983c535a06da70
|
7
|
+
data.tar.gz: 9942df50a62c7a88fafe9eea748e611618251db4ca5bf94850585e0529b3c6812f6658c2221c39a7160d72f5f0ce26a207e2fb1feedd404e20a9f0c34365979f
|
data/lib/listen/adapter/base.rb
CHANGED
@@ -51,7 +51,7 @@ module Listen
|
|
51
51
|
# TODO: separate config per directory (some day maybe)
|
52
52
|
change_config = Change::Config.new(config.queue, config.silencer)
|
53
53
|
config.directories.each do |dir|
|
54
|
-
record = Record.new(dir)
|
54
|
+
record = Record.new(dir, config.silencer)
|
55
55
|
snapshot = Change.new(change_config, record)
|
56
56
|
@snapshots[dir] = snapshot
|
57
57
|
end
|
data/lib/listen/adapter/linux.rb
CHANGED
@@ -24,17 +24,14 @@ module Listen
|
|
24
24
|
README_URL = 'https://github.com/guard/listen'\
|
25
25
|
'/blob/master/README.md#increasing-the-amount-of-inotify-watchers'
|
26
26
|
|
27
|
-
INOTIFY_LIMIT_MESSAGE = <<-EOS
|
28
|
-
FATAL: Listen error: unable to monitor directories for changes.
|
29
|
-
Visit #{README_URL} for info on how to fix this.
|
30
|
-
EOS
|
31
|
-
|
32
27
|
def _configure(directory, &callback)
|
33
28
|
require 'rb-inotify'
|
34
29
|
@worker ||= ::INotify::Notifier.new
|
35
30
|
@worker.watch(directory.to_s, *options.events, &callback)
|
36
31
|
rescue Errno::ENOSPC
|
37
|
-
|
32
|
+
raise ::Listen::Error::INotifyMaxWatchesExceeded, <<~EOS
|
33
|
+
Unable to monitor directories for changes because iNotify max watches exceeded. See #{README_URL} .
|
34
|
+
EOS
|
38
35
|
end
|
39
36
|
|
40
37
|
def _run
|
data/lib/listen/error.rb
CHANGED
data/lib/listen/record.rb
CHANGED
@@ -11,9 +11,10 @@ module Listen
|
|
11
11
|
|
12
12
|
attr_reader :root
|
13
13
|
|
14
|
-
def initialize(directory)
|
14
|
+
def initialize(directory, silencer)
|
15
15
|
@tree = _auto_hash
|
16
16
|
@root = directory.to_s
|
17
|
+
@silencer = silencer
|
17
18
|
end
|
18
19
|
|
19
20
|
def add_dir(rel_path)
|
@@ -98,6 +99,8 @@ module Listen
|
|
98
99
|
|
99
100
|
def _fast_build_dir(remaining, symlink_detector)
|
100
101
|
entry = remaining.pop
|
102
|
+
return if @silencer.silenced?(entry.record_dir_key, :dir)
|
103
|
+
|
101
104
|
children = entry.children # NOTE: children() implicitly tests if dir
|
102
105
|
symlink_detector.verify_unwatched!(entry)
|
103
106
|
children.each { |child| remaining << child }
|
data/lib/listen/silencer.rb
CHANGED
@@ -57,23 +57,21 @@ module Listen
|
|
57
57
|
| ~
|
58
58
|
)$}x.freeze
|
59
59
|
|
60
|
+
# TODO: deprecate these mutators; use attr_reader instead
|
60
61
|
attr_accessor :only_patterns, :ignore_patterns
|
61
62
|
|
62
|
-
def initialize
|
63
|
-
configure(
|
63
|
+
def initialize(**options)
|
64
|
+
configure(options)
|
64
65
|
end
|
65
66
|
|
67
|
+
# TODO: deprecate this mutator
|
66
68
|
def configure(options)
|
67
69
|
@only_patterns = options[:only] ? Array(options[:only]) : nil
|
68
70
|
@ignore_patterns = _init_ignores(options[:ignore], options[:ignore!])
|
69
71
|
end
|
70
72
|
|
71
|
-
# Note: relative_path is temporarily expected to be a relative Pathname to
|
72
|
-
# make refactoring easier (ideally, it would take a string)
|
73
|
-
|
74
|
-
# TODO: switch type and path places - and verify
|
75
73
|
def silenced?(relative_path, type)
|
76
|
-
path = relative_path.to_s
|
74
|
+
path = relative_path.to_s # in case it is a Pathname
|
77
75
|
|
78
76
|
_ignore?(path) || (only_patterns && type == :file && !_only?(path))
|
79
77
|
end
|
data/lib/listen/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: listen
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 3.
|
4
|
+
version: 3.7.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Thibaud Guillaume-Gentil
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-
|
11
|
+
date: 2021-08-19 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rb-fsevent
|
@@ -103,9 +103,9 @@ metadata:
|
|
103
103
|
allowed_push_host: https://rubygems.org
|
104
104
|
bug_tracker_uri: https://github.com/guard/listen/issues
|
105
105
|
changelog_uri: https://github.com/guard/listen/releases
|
106
|
-
documentation_uri: https://www.rubydoc.info/gems/listen/3.
|
106
|
+
documentation_uri: https://www.rubydoc.info/gems/listen/3.7.0
|
107
107
|
homepage_uri: https://github.com/guard/listen
|
108
|
-
source_code_uri: https://github.com/guard/listen/tree/v3.
|
108
|
+
source_code_uri: https://github.com/guard/listen/tree/v3.7.0
|
109
109
|
post_install_message:
|
110
110
|
rdoc_options: []
|
111
111
|
require_paths:
|