watchcat 0.4.0-aarch64-linux → 0.5.1-aarch64-linux
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/CHANGELOG.md +9 -0
- data/Gemfile.lock +4 -1
- data/README.md +5 -1
- data/lib/watchcat/3.1/watchcat.so +0 -0
- data/lib/watchcat/3.2/watchcat.so +0 -0
- data/lib/watchcat/3.3/watchcat.so +0 -0
- data/lib/watchcat/3.4/watchcat.so +0 -0
- data/lib/watchcat/cli/config.rb +36 -1
- data/lib/watchcat/cli/watcher.rb +2 -3
- data/lib/watchcat/cli.rb +16 -3
- data/lib/watchcat/executor.rb +11 -4
- data/lib/watchcat/version.rb +1 -1
- metadata +18 -3
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 4cae51fb9f8c80b3e8d550da8200b24ba78f0a71ddce814b7aa51c81e4d1ef29
|
|
4
|
+
data.tar.gz: 51a5907459c3dea9ef3b851991ce4fab82c77a6918edee8879b2314156f38848
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: aa8c40827819379a0846b8fa0241d8f638f43b588ec2cfe26bf35838d0cc012d7d07143b86e65911fa776110317013b87bc6f80d12400390a5befae9d2944f4f
|
|
7
|
+
data.tar.gz: c2d5a02016c8d2d1bc74952db52372a79f70af4b2fe812cf9561b4acff42e6e81c73cee742ad6863838c23c952237b6553720e73947021d529a260609ac38b76
|
data/CHANGELOG.md
CHANGED
data/Gemfile.lock
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
PATH
|
|
2
2
|
remote: .
|
|
3
3
|
specs:
|
|
4
|
-
watchcat (0.
|
|
4
|
+
watchcat (0.5.1)
|
|
5
5
|
psych
|
|
6
6
|
rb_sys
|
|
7
7
|
|
|
@@ -28,6 +28,8 @@ GEM
|
|
|
28
28
|
rb-fsevent (~> 0.10, >= 0.10.3)
|
|
29
29
|
rb-inotify (~> 0.9, >= 0.9.10)
|
|
30
30
|
minitest (5.25.5)
|
|
31
|
+
minitest-fail-fast (0.1.0)
|
|
32
|
+
minitest (~> 5)
|
|
31
33
|
minitest-retry (0.2.5)
|
|
32
34
|
minitest (>= 5.0)
|
|
33
35
|
nokogiri (1.18.1-arm64-darwin)
|
|
@@ -75,6 +77,7 @@ DEPENDENCIES
|
|
|
75
77
|
debug
|
|
76
78
|
listen
|
|
77
79
|
minitest
|
|
80
|
+
minitest-fail-fast
|
|
78
81
|
minitest-retry
|
|
79
82
|
rake
|
|
80
83
|
rake-compiler
|
data/README.md
CHANGED
|
@@ -120,7 +120,11 @@ end
|
|
|
120
120
|
### Usage
|
|
121
121
|
|
|
122
122
|
```
|
|
123
|
+
# Run watchcat with a config file
|
|
123
124
|
$ watchcat -C config.yml
|
|
125
|
+
|
|
126
|
+
# Generate a template config file
|
|
127
|
+
$ watchcat --init config.yml
|
|
124
128
|
```
|
|
125
129
|
|
|
126
130
|
### Configuration File
|
|
@@ -150,7 +154,7 @@ Each watch entry supports the following options:
|
|
|
150
154
|
|-------------|--------------------------------------------------------|---------|
|
|
151
155
|
| path | Directory or file path to watch (required) | - |
|
|
152
156
|
| recursive | Watch a directory recursively or not | `true` |
|
|
153
|
-
| debounce | Debounce events for the same file (in milliseconds) | `
|
|
157
|
+
| debounce | Debounce events for the same file (in milliseconds) | `-1` |
|
|
154
158
|
| filters | Event filters (same as library filters option) | `{}` |
|
|
155
159
|
| patterns | File patterns to match (using File.fnmatch) | `[]` |
|
|
156
160
|
| actions | Commands to execute when files change | `[]` |
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
data/lib/watchcat/cli/config.rb
CHANGED
|
@@ -22,6 +22,41 @@ module Watchcat
|
|
|
22
22
|
end
|
|
23
23
|
end
|
|
24
24
|
|
|
25
|
+
def self.generate_template(file_path)
|
|
26
|
+
template = <<~YAML
|
|
27
|
+
# Watchcat Configuration File
|
|
28
|
+
|
|
29
|
+
watches:
|
|
30
|
+
- path: "./src"
|
|
31
|
+
recursive: true
|
|
32
|
+
debounce: 300
|
|
33
|
+
filters:
|
|
34
|
+
ignore_access: true
|
|
35
|
+
patterns:
|
|
36
|
+
- "*.js"
|
|
37
|
+
- "*.ts"
|
|
38
|
+
- "*.css"
|
|
39
|
+
actions:
|
|
40
|
+
- command: "echo 'File changed: {{file_path}}'"
|
|
41
|
+
|
|
42
|
+
- path: "./docs"
|
|
43
|
+
recursive: true
|
|
44
|
+
filters:
|
|
45
|
+
ignore_access: true
|
|
46
|
+
patterns:
|
|
47
|
+
- "*.md"
|
|
48
|
+
actions:
|
|
49
|
+
- command: "echo 'Documentation updated: {{file_name}}'"
|
|
50
|
+
YAML
|
|
51
|
+
|
|
52
|
+
if File.exist?(file_path)
|
|
53
|
+
raise Error, "File already exists: #{file_path}. Won't overwrite."
|
|
54
|
+
end
|
|
55
|
+
|
|
56
|
+
File.write(file_path, template)
|
|
57
|
+
puts "Config template generated at #{file_path}"
|
|
58
|
+
end
|
|
59
|
+
|
|
25
60
|
private
|
|
26
61
|
|
|
27
62
|
def parse_watches(watches_data)
|
|
@@ -31,7 +66,7 @@ module Watchcat
|
|
|
31
66
|
recursive: watch_config.fetch("recursive", true),
|
|
32
67
|
patterns: watch_config["patterns"] || [],
|
|
33
68
|
actions: watch_config["actions"] || [],
|
|
34
|
-
debounce: watch_config.fetch("debounce",
|
|
69
|
+
debounce: watch_config.fetch("debounce", -1),
|
|
35
70
|
filters: watch_config["filters"]&.transform_keys(&:to_sym) || {},
|
|
36
71
|
}
|
|
37
72
|
end
|
data/lib/watchcat/cli/watcher.rb
CHANGED
|
@@ -45,6 +45,7 @@ module Watchcat
|
|
|
45
45
|
path,
|
|
46
46
|
recursive: watch_config[:recursive],
|
|
47
47
|
filters: watch_config[:filters],
|
|
48
|
+
debounce: watch_config[:debounce],
|
|
48
49
|
) do |event|
|
|
49
50
|
handle_file_event(event, watch_config)
|
|
50
51
|
end
|
|
@@ -53,12 +54,10 @@ module Watchcat
|
|
|
53
54
|
end
|
|
54
55
|
|
|
55
56
|
def handle_file_event(event, watch_config)
|
|
56
|
-
return if event.kind.access?
|
|
57
|
-
|
|
58
57
|
event.paths.each do |file_path|
|
|
59
58
|
next unless should_process_file?(file_path, watch_config[:patterns])
|
|
60
59
|
|
|
61
|
-
puts "File changed: #{file_path}
|
|
60
|
+
puts "File changed: #{file_path}"
|
|
62
61
|
execute_actions(file_path, event, watch_config[:actions])
|
|
63
62
|
end
|
|
64
63
|
end
|
data/lib/watchcat/cli.rb
CHANGED
|
@@ -9,6 +9,12 @@ module Watchcat
|
|
|
9
9
|
class << self
|
|
10
10
|
def start(argv)
|
|
11
11
|
options = parse(argv)
|
|
12
|
+
|
|
13
|
+
if options[:init]
|
|
14
|
+
Config.generate_template(options[:init])
|
|
15
|
+
return
|
|
16
|
+
end
|
|
17
|
+
|
|
12
18
|
config = Config.load(options[:config])
|
|
13
19
|
watcher = Watcher.new(config)
|
|
14
20
|
watcher.start
|
|
@@ -17,21 +23,28 @@ module Watchcat
|
|
|
17
23
|
end
|
|
18
24
|
|
|
19
25
|
def parse(argv)
|
|
20
|
-
options = {}
|
|
26
|
+
options = { config: 'watchcat.yml' }
|
|
21
27
|
OptionParser.new do |opts|
|
|
22
28
|
opts.banner = "Usage: watchcat [options]"
|
|
23
29
|
|
|
24
|
-
opts.on("-C", "--config PATH", "Path to the config file") do |v|
|
|
30
|
+
opts.on("-C", "--config PATH", "Path to the config file. Default is 'watchcat.yml'.") do |v|
|
|
25
31
|
options[:config] = v
|
|
26
32
|
end
|
|
27
33
|
|
|
34
|
+
opts.on("--init PATH", "Generate a template config file at the specified path") do |v|
|
|
35
|
+
options[:init] = v
|
|
36
|
+
end
|
|
37
|
+
|
|
28
38
|
opts.on("-h", "--help", "Show this help message") do
|
|
29
39
|
puts opts
|
|
30
40
|
exit
|
|
31
41
|
end
|
|
32
42
|
end.parse!(argv)
|
|
33
43
|
|
|
34
|
-
|
|
44
|
+
if !options[:init] && options[:config].nil?
|
|
45
|
+
raise OptionParser::MissingArgument.new("-C")
|
|
46
|
+
end
|
|
47
|
+
|
|
35
48
|
options
|
|
36
49
|
end
|
|
37
50
|
end
|
data/lib/watchcat/executor.rb
CHANGED
|
@@ -9,6 +9,7 @@ module Watchcat
|
|
|
9
9
|
@poll_interval = poll_interval
|
|
10
10
|
@filters = filters || {}
|
|
11
11
|
@debounce = debounce
|
|
12
|
+
@debouncer = Debouncer.new if @debounce > 0
|
|
12
13
|
@block = block
|
|
13
14
|
@watcher = Watchcat::Watcher.new
|
|
14
15
|
@watch_thread = nil
|
|
@@ -46,13 +47,19 @@ module Watchcat
|
|
|
46
47
|
ignore_remove: @filters[:ignore_remove],
|
|
47
48
|
ignore_access: @filters[:ignore_access],
|
|
48
49
|
ignore_create: @filters[:ignore_create],
|
|
49
|
-
ignore_modify: @filters[:ignore_modify]
|
|
50
|
-
debounce: @debounce
|
|
50
|
+
ignore_modify: @filters[:ignore_modify]
|
|
51
51
|
) do |kind, paths, raw_kind|
|
|
52
52
|
break if @stop_requested
|
|
53
53
|
|
|
54
|
-
|
|
55
|
-
|
|
54
|
+
if @debounce > 0 && paths.size == 1
|
|
55
|
+
@debouncer.debounce(paths[0], @debounce) do
|
|
56
|
+
event = Watchcat::Event.new(kind, paths, raw_kind)
|
|
57
|
+
@block.call(event)
|
|
58
|
+
end
|
|
59
|
+
else
|
|
60
|
+
event = Watchcat::Event.new(kind, paths, raw_kind)
|
|
61
|
+
@block.call(event)
|
|
62
|
+
end
|
|
56
63
|
end
|
|
57
64
|
end
|
|
58
65
|
end
|
data/lib/watchcat/version.rb
CHANGED
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: watchcat
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.
|
|
4
|
+
version: 0.5.1
|
|
5
5
|
platform: aarch64-linux
|
|
6
6
|
authors:
|
|
7
7
|
- Yuji Yaginuma
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: exe
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2025-09-
|
|
11
|
+
date: 2025-09-11 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: psych
|
|
@@ -66,6 +66,20 @@ dependencies:
|
|
|
66
66
|
- - ">="
|
|
67
67
|
- !ruby/object:Gem::Version
|
|
68
68
|
version: '0'
|
|
69
|
+
- !ruby/object:Gem::Dependency
|
|
70
|
+
name: minitest-fail-fast
|
|
71
|
+
requirement: !ruby/object:Gem::Requirement
|
|
72
|
+
requirements:
|
|
73
|
+
- - ">="
|
|
74
|
+
- !ruby/object:Gem::Version
|
|
75
|
+
version: '0'
|
|
76
|
+
type: :development
|
|
77
|
+
prerelease: false
|
|
78
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
79
|
+
requirements:
|
|
80
|
+
- - ">="
|
|
81
|
+
- !ruby/object:Gem::Version
|
|
82
|
+
version: '0'
|
|
69
83
|
- !ruby/object:Gem::Dependency
|
|
70
84
|
name: rake
|
|
71
85
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -125,7 +139,8 @@ dependencies:
|
|
|
125
139
|
description:
|
|
126
140
|
email:
|
|
127
141
|
- yuuji.yaginuma@gmail.com
|
|
128
|
-
executables:
|
|
142
|
+
executables:
|
|
143
|
+
- watchcat
|
|
129
144
|
extensions: []
|
|
130
145
|
extra_rdoc_files: []
|
|
131
146
|
files:
|