watchcat 0.2.0 → 0.3.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/CHANGELOG.md +3 -0
- data/Cargo.lock +77 -97
- data/Gemfile.lock +37 -23
- data/README.md +2 -2
- data/ext/watchcat/Cargo.toml +5 -5
- data/ext/watchcat/src/gvl_helpers.rs +65 -0
- data/ext/watchcat/src/lib.rs +144 -98
- data/lib/watchcat/executor.rb +29 -30
- data/lib/watchcat/version.rb +1 -1
- data/watchcat.gemspec +1 -2
- metadata +6 -24
- data/lib/watchcat/client.rb +0 -26
- data/lib/watchcat/server.rb +0 -14
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 321909d5547837b0eb60faefa347c333f65041ba41c9b4f4de7c929dca135a89
|
4
|
+
data.tar.gz: 6a29084ee42abd7993249d47a644b1f1bae509ba80ec3d6649f6da76bfc9b8e7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f2527b0cae2a8f49a5d5d2c753dfff8b1d4ac881190b8168c5c18846005885c6c24cb469148a68e3bcd14900626f03924ea9b3cc50648921b77434d1451ef4ce
|
7
|
+
data.tar.gz: 16f2ad6b4f5fe165d7ccbd046d57d9f6462dc3d86035b419b4bdcb0b22f62ea530558a68950dfcbc094d0f7b1e4cc668945a0feb2973ce279e584ae261adcde1
|
data/CHANGELOG.md
ADDED
data/Cargo.lock
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
# This file is automatically @generated by Cargo.
|
2
2
|
# It is not intended for manual editing.
|
3
|
-
version =
|
3
|
+
version = 4
|
4
4
|
|
5
5
|
[[package]]
|
6
6
|
name = "aho-corasick"
|
@@ -17,7 +17,7 @@ version = "0.69.1"
|
|
17
17
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
18
18
|
checksum = "9ffcebc3849946a7170a05992aac39da343a90676ab392c51a4280981d6379c2"
|
19
19
|
dependencies = [
|
20
|
-
"bitflags 2.
|
20
|
+
"bitflags 2.8.0",
|
21
21
|
"cexpr",
|
22
22
|
"clang-sys",
|
23
23
|
"lazy_static",
|
@@ -39,9 +39,9 @@ checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a"
|
|
39
39
|
|
40
40
|
[[package]]
|
41
41
|
name = "bitflags"
|
42
|
-
version = "2.
|
42
|
+
version = "2.8.0"
|
43
43
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
44
|
-
checksum = "
|
44
|
+
checksum = "8f68f53c83ab957f72c32642f3868eec03eb974d1fb82e453128456482613d36"
|
45
45
|
|
46
46
|
[[package]]
|
47
47
|
name = "cexpr"
|
@@ -71,9 +71,9 @@ dependencies = [
|
|
71
71
|
|
72
72
|
[[package]]
|
73
73
|
name = "crossbeam-channel"
|
74
|
-
version = "0.5.
|
74
|
+
version = "0.5.15"
|
75
75
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
76
|
-
checksum = "
|
76
|
+
checksum = "82b8f8f868b36967f9606790d1903570de9ceaf870a7bf9fbbd3016d636a2cb2"
|
77
77
|
dependencies = [
|
78
78
|
"crossbeam-utils",
|
79
79
|
]
|
@@ -103,18 +103,6 @@ version = "2.1.1"
|
|
103
103
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
104
104
|
checksum = "e8c02a5121d4ea3eb16a80748c74f5549a5665e4c21333c6098f283870fbdea6"
|
105
105
|
|
106
|
-
[[package]]
|
107
|
-
name = "filetime"
|
108
|
-
version = "0.2.22"
|
109
|
-
source = "registry+https://github.com/rust-lang/crates.io-index"
|
110
|
-
checksum = "d4029edd3e734da6fe05b6cd7bd2960760a616bd2ddd0d59a0124746d6272af0"
|
111
|
-
dependencies = [
|
112
|
-
"cfg-if",
|
113
|
-
"libc",
|
114
|
-
"redox_syscall",
|
115
|
-
"windows-sys 0.48.0",
|
116
|
-
]
|
117
|
-
|
118
106
|
[[package]]
|
119
107
|
name = "fsevent-sys"
|
120
108
|
version = "4.1.0"
|
@@ -138,11 +126,11 @@ checksum = "d231dfb89cfffdbc30e7fc41579ed6066ad03abda9e567ccafae602b97ec5024"
|
|
138
126
|
|
139
127
|
[[package]]
|
140
128
|
name = "inotify"
|
141
|
-
version = "0.
|
129
|
+
version = "0.11.0"
|
142
130
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
143
|
-
checksum = "
|
131
|
+
checksum = "f37dccff2791ab604f9babef0ba14fbe0be30bd368dc541e2b08d07c8aa908f3"
|
144
132
|
dependencies = [
|
145
|
-
"bitflags
|
133
|
+
"bitflags 2.8.0",
|
146
134
|
"inotify-sys",
|
147
135
|
"libc",
|
148
136
|
]
|
@@ -156,20 +144,11 @@ dependencies = [
|
|
156
144
|
"libc",
|
157
145
|
]
|
158
146
|
|
159
|
-
[[package]]
|
160
|
-
name = "instant"
|
161
|
-
version = "0.1.13"
|
162
|
-
source = "registry+https://github.com/rust-lang/crates.io-index"
|
163
|
-
checksum = "e0242819d153cba4b4b05a5a8f2a7e9bbf97b6055b2a002b395c96b5ff3c0222"
|
164
|
-
dependencies = [
|
165
|
-
"cfg-if",
|
166
|
-
]
|
167
|
-
|
168
147
|
[[package]]
|
169
148
|
name = "kqueue"
|
170
|
-
version = "1.
|
149
|
+
version = "1.1.1"
|
171
150
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
172
|
-
checksum = "
|
151
|
+
checksum = "eac30106d7dce88daf4a3fcb4879ea939476d5074a9b7ddd0fb97fa4bed5596a"
|
173
152
|
dependencies = [
|
174
153
|
"kqueue-sys",
|
175
154
|
"libc",
|
@@ -288,13 +267,12 @@ dependencies = [
|
|
288
267
|
|
289
268
|
[[package]]
|
290
269
|
name = "notify"
|
291
|
-
version = "
|
270
|
+
version = "8.1.0"
|
292
271
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
293
|
-
checksum = "
|
272
|
+
checksum = "3163f59cd3fa0e9ef8c32f242966a7b9994fd7378366099593e0e73077cd8c97"
|
294
273
|
dependencies = [
|
295
|
-
"bitflags 2.
|
274
|
+
"bitflags 2.8.0",
|
296
275
|
"crossbeam-channel",
|
297
|
-
"filetime",
|
298
276
|
"fsevent-sys",
|
299
277
|
"inotify",
|
300
278
|
"kqueue",
|
@@ -303,14 +281,14 @@ dependencies = [
|
|
303
281
|
"mio",
|
304
282
|
"notify-types",
|
305
283
|
"walkdir",
|
306
|
-
"windows-sys 0.
|
284
|
+
"windows-sys 0.60.2",
|
307
285
|
]
|
308
286
|
|
309
287
|
[[package]]
|
310
288
|
name = "notify-debouncer-mini"
|
311
|
-
version = "0.
|
289
|
+
version = "0.6.0"
|
312
290
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
313
|
-
checksum = "
|
291
|
+
checksum = "a689eb4262184d9a1727f9087cd03883ea716682ab03ed24efec57d7716dccb8"
|
314
292
|
dependencies = [
|
315
293
|
"crossbeam-channel",
|
316
294
|
"log",
|
@@ -321,12 +299,9 @@ dependencies = [
|
|
321
299
|
|
322
300
|
[[package]]
|
323
301
|
name = "notify-types"
|
324
|
-
version = "
|
302
|
+
version = "2.0.0"
|
325
303
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
326
|
-
checksum = "
|
327
|
-
dependencies = [
|
328
|
-
"instant",
|
329
|
-
]
|
304
|
+
checksum = "5e0826a989adedc2a244799e823aece04662b66609d96af8dff7ac6df9a8925d"
|
330
305
|
|
331
306
|
[[package]]
|
332
307
|
name = "once_cell"
|
@@ -360,18 +335,18 @@ dependencies = [
|
|
360
335
|
|
361
336
|
[[package]]
|
362
337
|
name = "rb-sys"
|
363
|
-
version = "0.9.
|
338
|
+
version = "0.9.117"
|
364
339
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
365
|
-
checksum = "
|
340
|
+
checksum = "f900d1ce4629a2ebffaf5de74bd8f9c1188d4c5ed406df02f97e22f77a006f44"
|
366
341
|
dependencies = [
|
367
342
|
"rb-sys-build",
|
368
343
|
]
|
369
344
|
|
370
345
|
[[package]]
|
371
346
|
name = "rb-sys-build"
|
372
|
-
version = "0.9.
|
347
|
+
version = "0.9.117"
|
373
348
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
374
|
-
checksum = "
|
349
|
+
checksum = "ef1e9c857028f631056bcd6d88cec390c751e343ce2223ddb26d23eb4a151d59"
|
375
350
|
dependencies = [
|
376
351
|
"bindgen",
|
377
352
|
"lazy_static",
|
@@ -388,15 +363,6 @@ version = "0.1.2"
|
|
388
363
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
389
364
|
checksum = "a35802679f07360454b418a5d1735c89716bde01d35b1560fc953c1415a0b3bb"
|
390
365
|
|
391
|
-
[[package]]
|
392
|
-
name = "redox_syscall"
|
393
|
-
version = "0.3.5"
|
394
|
-
source = "registry+https://github.com/rust-lang/crates.io-index"
|
395
|
-
checksum = "567664f262709473930a4bf9e51bf2ebf3348f2e748ccc50dea20646858f8f29"
|
396
|
-
dependencies = [
|
397
|
-
"bitflags 1.3.2",
|
398
|
-
]
|
399
|
-
|
400
366
|
[[package]]
|
401
367
|
name = "regex"
|
402
368
|
version = "1.7.1"
|
@@ -426,7 +392,7 @@ version = "0.38.38"
|
|
426
392
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
427
393
|
checksum = "aa260229e6538e52293eeb577aabd09945a09d6d9cc0fc550ed7529056c2e32a"
|
428
394
|
dependencies = [
|
429
|
-
"bitflags 2.
|
395
|
+
"bitflags 2.8.0",
|
430
396
|
"errno",
|
431
397
|
"libc",
|
432
398
|
"linux-raw-sys",
|
@@ -508,7 +474,7 @@ checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423"
|
|
508
474
|
|
509
475
|
[[package]]
|
510
476
|
name = "watchcat"
|
511
|
-
version = "0.
|
477
|
+
version = "0.3.0"
|
512
478
|
dependencies = [
|
513
479
|
"crossbeam-channel",
|
514
480
|
"magnus",
|
@@ -549,13 +515,10 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
549
515
|
checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f"
|
550
516
|
|
551
517
|
[[package]]
|
552
|
-
name = "windows-
|
553
|
-
version = "0.
|
518
|
+
name = "windows-link"
|
519
|
+
version = "0.1.3"
|
554
520
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
555
|
-
checksum = "
|
556
|
-
dependencies = [
|
557
|
-
"windows-targets 0.48.5",
|
558
|
-
]
|
521
|
+
checksum = "5e6ad25900d524eaabdbbb96d20b4311e1e7ae1699af4fb28c17ae66c80d798a"
|
559
522
|
|
560
523
|
[[package]]
|
561
524
|
name = "windows-sys"
|
@@ -576,18 +539,12 @@ dependencies = [
|
|
576
539
|
]
|
577
540
|
|
578
541
|
[[package]]
|
579
|
-
name = "windows-
|
580
|
-
version = "0.
|
542
|
+
name = "windows-sys"
|
543
|
+
version = "0.60.2"
|
581
544
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
582
|
-
checksum = "
|
545
|
+
checksum = "f2f500e4d28234f72040990ec9d39e3a6b950f9f22d3dba18416c35882612bcb"
|
583
546
|
dependencies = [
|
584
|
-
"
|
585
|
-
"windows_aarch64_msvc 0.48.5",
|
586
|
-
"windows_i686_gnu 0.48.5",
|
587
|
-
"windows_i686_msvc 0.48.5",
|
588
|
-
"windows_x86_64_gnu 0.48.5",
|
589
|
-
"windows_x86_64_gnullvm 0.48.5",
|
590
|
-
"windows_x86_64_msvc 0.48.5",
|
547
|
+
"windows-targets 0.53.3",
|
591
548
|
]
|
592
549
|
|
593
550
|
[[package]]
|
@@ -599,7 +556,7 @@ dependencies = [
|
|
599
556
|
"windows_aarch64_gnullvm 0.52.6",
|
600
557
|
"windows_aarch64_msvc 0.52.6",
|
601
558
|
"windows_i686_gnu 0.52.6",
|
602
|
-
"windows_i686_gnullvm",
|
559
|
+
"windows_i686_gnullvm 0.52.6",
|
603
560
|
"windows_i686_msvc 0.52.6",
|
604
561
|
"windows_x86_64_gnu 0.52.6",
|
605
562
|
"windows_x86_64_gnullvm 0.52.6",
|
@@ -607,10 +564,21 @@ dependencies = [
|
|
607
564
|
]
|
608
565
|
|
609
566
|
[[package]]
|
610
|
-
name = "
|
611
|
-
version = "0.
|
567
|
+
name = "windows-targets"
|
568
|
+
version = "0.53.3"
|
612
569
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
613
|
-
checksum = "
|
570
|
+
checksum = "d5fe6031c4041849d7c496a8ded650796e7b6ecc19df1a431c1a363342e5dc91"
|
571
|
+
dependencies = [
|
572
|
+
"windows-link",
|
573
|
+
"windows_aarch64_gnullvm 0.53.0",
|
574
|
+
"windows_aarch64_msvc 0.53.0",
|
575
|
+
"windows_i686_gnu 0.53.0",
|
576
|
+
"windows_i686_gnullvm 0.53.0",
|
577
|
+
"windows_i686_msvc 0.53.0",
|
578
|
+
"windows_x86_64_gnu 0.53.0",
|
579
|
+
"windows_x86_64_gnullvm 0.53.0",
|
580
|
+
"windows_x86_64_msvc 0.53.0",
|
581
|
+
]
|
614
582
|
|
615
583
|
[[package]]
|
616
584
|
name = "windows_aarch64_gnullvm"
|
@@ -619,10 +587,10 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
619
587
|
checksum = "32a4622180e7a0ec044bb555404c800bc9fd9ec262ec147edd5989ccd0c02cd3"
|
620
588
|
|
621
589
|
[[package]]
|
622
|
-
name = "
|
623
|
-
version = "0.
|
590
|
+
name = "windows_aarch64_gnullvm"
|
591
|
+
version = "0.53.0"
|
624
592
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
625
|
-
checksum = "
|
593
|
+
checksum = "86b8d5f90ddd19cb4a147a5fa63ca848db3df085e25fee3cc10b39b6eebae764"
|
626
594
|
|
627
595
|
[[package]]
|
628
596
|
name = "windows_aarch64_msvc"
|
@@ -631,10 +599,10 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
631
599
|
checksum = "09ec2a7bb152e2252b53fa7803150007879548bc709c039df7627cabbd05d469"
|
632
600
|
|
633
601
|
[[package]]
|
634
|
-
name = "
|
635
|
-
version = "0.
|
602
|
+
name = "windows_aarch64_msvc"
|
603
|
+
version = "0.53.0"
|
636
604
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
637
|
-
checksum = "
|
605
|
+
checksum = "c7651a1f62a11b8cbd5e0d42526e55f2c99886c77e007179efff86c2b137e66c"
|
638
606
|
|
639
607
|
[[package]]
|
640
608
|
name = "windows_i686_gnu"
|
@@ -642,6 +610,12 @@ version = "0.52.6"
|
|
642
610
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
643
611
|
checksum = "8e9b5ad5ab802e97eb8e295ac6720e509ee4c243f69d781394014ebfe8bbfa0b"
|
644
612
|
|
613
|
+
[[package]]
|
614
|
+
name = "windows_i686_gnu"
|
615
|
+
version = "0.53.0"
|
616
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
617
|
+
checksum = "c1dc67659d35f387f5f6c479dc4e28f1d4bb90ddd1a5d3da2e5d97b42d6272c3"
|
618
|
+
|
645
619
|
[[package]]
|
646
620
|
name = "windows_i686_gnullvm"
|
647
621
|
version = "0.52.6"
|
@@ -649,10 +623,10 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
649
623
|
checksum = "0eee52d38c090b3caa76c563b86c3a4bd71ef1a819287c19d586d7334ae8ed66"
|
650
624
|
|
651
625
|
[[package]]
|
652
|
-
name = "
|
653
|
-
version = "0.
|
626
|
+
name = "windows_i686_gnullvm"
|
627
|
+
version = "0.53.0"
|
654
628
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
655
|
-
checksum = "
|
629
|
+
checksum = "9ce6ccbdedbf6d6354471319e781c0dfef054c81fbc7cf83f338a4296c0cae11"
|
656
630
|
|
657
631
|
[[package]]
|
658
632
|
name = "windows_i686_msvc"
|
@@ -661,10 +635,10 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
661
635
|
checksum = "240948bc05c5e7c6dabba28bf89d89ffce3e303022809e73deaefe4f6ec56c66"
|
662
636
|
|
663
637
|
[[package]]
|
664
|
-
name = "
|
665
|
-
version = "0.
|
638
|
+
name = "windows_i686_msvc"
|
639
|
+
version = "0.53.0"
|
666
640
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
667
|
-
checksum = "
|
641
|
+
checksum = "581fee95406bb13382d2f65cd4a908ca7b1e4c2f1917f143ba16efe98a589b5d"
|
668
642
|
|
669
643
|
[[package]]
|
670
644
|
name = "windows_x86_64_gnu"
|
@@ -673,10 +647,10 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
673
647
|
checksum = "147a5c80aabfbf0c7d901cb5895d1de30ef2907eb21fbbab29ca94c5b08b1a78"
|
674
648
|
|
675
649
|
[[package]]
|
676
|
-
name = "
|
677
|
-
version = "0.
|
650
|
+
name = "windows_x86_64_gnu"
|
651
|
+
version = "0.53.0"
|
678
652
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
679
|
-
checksum = "
|
653
|
+
checksum = "2e55b5ac9ea33f2fc1716d1742db15574fd6fc8dadc51caab1c16a3d3b4190ba"
|
680
654
|
|
681
655
|
[[package]]
|
682
656
|
name = "windows_x86_64_gnullvm"
|
@@ -685,13 +659,19 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
685
659
|
checksum = "24d5b23dc417412679681396f2b49f3de8c1473deb516bd34410872eff51ed0d"
|
686
660
|
|
687
661
|
[[package]]
|
688
|
-
name = "
|
689
|
-
version = "0.
|
662
|
+
name = "windows_x86_64_gnullvm"
|
663
|
+
version = "0.53.0"
|
690
664
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
691
|
-
checksum = "
|
665
|
+
checksum = "0a6e035dd0599267ce1ee132e51c27dd29437f63325753051e71dd9e42406c57"
|
692
666
|
|
693
667
|
[[package]]
|
694
668
|
name = "windows_x86_64_msvc"
|
695
669
|
version = "0.52.6"
|
696
670
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
697
671
|
checksum = "589f6da84c646204747d1270a2a5661ea66ed1cced2631d546fdfb155959f9ec"
|
672
|
+
|
673
|
+
[[package]]
|
674
|
+
name = "windows_x86_64_msvc"
|
675
|
+
version = "0.53.0"
|
676
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
677
|
+
checksum = "271414315aff87387382ec3d271b52d7ae78726f5d44ac98b4f4030c91880486"
|
data/Gemfile.lock
CHANGED
@@ -1,57 +1,71 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
watchcat (0.
|
5
|
-
drb
|
4
|
+
watchcat (0.3.0)
|
6
5
|
rb_sys
|
7
6
|
|
8
7
|
GEM
|
9
8
|
remote: https://rubygems.org/
|
10
9
|
specs:
|
11
|
-
|
10
|
+
cgi (0.5.0)
|
11
|
+
date (3.4.1)
|
12
|
+
debug (1.11.0)
|
12
13
|
irb (~> 1.10)
|
13
14
|
reline (>= 0.3.8)
|
14
|
-
|
15
|
-
|
16
|
-
ffi (1.17.
|
17
|
-
ffi (1.17.
|
18
|
-
|
19
|
-
|
15
|
+
erb (4.0.4)
|
16
|
+
cgi (>= 0.3.3)
|
17
|
+
ffi (1.17.1-arm64-darwin)
|
18
|
+
ffi (1.17.1-x64-mingw-ucrt)
|
19
|
+
ffi (1.17.1-x86_64-darwin)
|
20
|
+
ffi (1.17.1-x86_64-linux-gnu)
|
21
|
+
io-console (0.8.0)
|
22
|
+
irb (1.15.2)
|
23
|
+
pp (>= 0.6.0)
|
20
24
|
rdoc (>= 4.0.0)
|
21
25
|
reline (>= 0.4.2)
|
22
26
|
listen (3.9.0)
|
23
27
|
rb-fsevent (~> 0.10, >= 0.10.3)
|
24
28
|
rb-inotify (~> 0.9, >= 0.9.10)
|
25
|
-
minitest (5.25.
|
26
|
-
minitest-retry (0.2.
|
29
|
+
minitest (5.25.5)
|
30
|
+
minitest-retry (0.2.5)
|
27
31
|
minitest (>= 5.0)
|
28
|
-
nokogiri (1.
|
32
|
+
nokogiri (1.18.1-arm64-darwin)
|
29
33
|
racc (~> 1.4)
|
30
|
-
nokogiri (1.
|
34
|
+
nokogiri (1.18.1-x64-mingw-ucrt)
|
31
35
|
racc (~> 1.4)
|
32
|
-
nokogiri (1.
|
36
|
+
nokogiri (1.18.1-x86_64-darwin)
|
33
37
|
racc (~> 1.4)
|
34
|
-
|
38
|
+
nokogiri (1.18.1-x86_64-linux-gnu)
|
39
|
+
racc (~> 1.4)
|
40
|
+
pp (0.6.2)
|
41
|
+
prettyprint
|
42
|
+
prettyprint (0.2.0)
|
43
|
+
psych (5.2.6)
|
44
|
+
date
|
35
45
|
stringio
|
36
46
|
racc (1.8.1)
|
37
|
-
rake (13.
|
38
|
-
rake-compiler (1.
|
47
|
+
rake (13.3.0)
|
48
|
+
rake-compiler (1.3.0)
|
39
49
|
rake
|
50
|
+
rake-compiler-dock (1.9.1)
|
40
51
|
rb-fsevent (0.11.2)
|
41
52
|
rb-inotify (0.11.1)
|
42
53
|
ffi (~> 1.0)
|
43
|
-
rb_sys (0.9.
|
44
|
-
|
54
|
+
rb_sys (0.9.117)
|
55
|
+
rake-compiler-dock (= 1.9.1)
|
56
|
+
rdoc (6.14.1)
|
57
|
+
erb
|
45
58
|
psych (>= 4.0.0)
|
46
|
-
reline (0.
|
59
|
+
reline (0.6.1)
|
47
60
|
io-console (~> 0.5)
|
48
|
-
ruby_memcheck (3.0.
|
61
|
+
ruby_memcheck (3.0.1)
|
49
62
|
nokogiri
|
50
|
-
stringio (3.1.
|
63
|
+
stringio (3.1.7)
|
51
64
|
|
52
65
|
PLATFORMS
|
53
66
|
arm64-darwin-22
|
54
67
|
arm64-darwin-23
|
68
|
+
x64-mingw-ucrt
|
55
69
|
x86_64-darwin-19
|
56
70
|
x86_64-darwin-20
|
57
71
|
x86_64-linux
|
@@ -67,4 +81,4 @@ DEPENDENCIES
|
|
67
81
|
watchcat!
|
68
82
|
|
69
83
|
BUNDLED WITH
|
70
|
-
2.
|
84
|
+
2.6.2
|
data/README.md
CHANGED
@@ -27,7 +27,7 @@ Please specify a filename or directory and callback block to `Watchcat.watch`. T
|
|
27
27
|
```ruby
|
28
28
|
require "watchcat"
|
29
29
|
|
30
|
-
|
30
|
+
Watchcat.watch("/tmp/test") do |e|
|
31
31
|
pp e.paths, e.kind
|
32
32
|
end
|
33
33
|
|
@@ -58,7 +58,7 @@ You can know what event is happened with `Watchcat::EventKind`. For example, wha
|
|
58
58
|
```ruby
|
59
59
|
require "watchcat"
|
60
60
|
|
61
|
-
|
61
|
+
Watchcat.watch("/tmp/target") do |e|
|
62
62
|
if e.kind.create?
|
63
63
|
if e.kind.create.file?
|
64
64
|
puts "'#{e.paths[0]}'(File) is added."
|
data/ext/watchcat/Cargo.toml
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
[package]
|
2
2
|
name = "watchcat"
|
3
|
-
version = "0.
|
3
|
+
version = "0.3.0"
|
4
4
|
edition = "2021"
|
5
5
|
publish = false
|
6
6
|
|
@@ -8,8 +8,8 @@ publish = false
|
|
8
8
|
crate-type = ["cdylib"]
|
9
9
|
|
10
10
|
[dependencies]
|
11
|
-
crossbeam-channel = "0.5.
|
11
|
+
crossbeam-channel = "0.5.15"
|
12
12
|
magnus = "0.7"
|
13
|
-
notify = { version = "
|
14
|
-
notify-debouncer-mini = { version = "0.
|
15
|
-
rb-sys = "0.9.
|
13
|
+
notify = { version = "8.1.0", features = ["crossbeam-channel"] }
|
14
|
+
notify-debouncer-mini = { version = "0.6.0", features = ["crossbeam-channel"] }
|
15
|
+
rb-sys = "0.9.116"
|
@@ -0,0 +1,65 @@
|
|
1
|
+
use std::{ffi::c_void, ptr::null_mut};
|
2
|
+
|
3
|
+
use magnus::Ruby;
|
4
|
+
use rb_sys::{
|
5
|
+
rb_thread_call_with_gvl, rb_thread_call_without_gvl
|
6
|
+
};
|
7
|
+
|
8
|
+
pub fn call_without_gvl<F, R>(f: F) -> R
|
9
|
+
where
|
10
|
+
F: FnOnce() -> R,
|
11
|
+
{
|
12
|
+
extern "C" fn trampoline<F, R>(arg: *mut c_void) -> *mut c_void
|
13
|
+
where
|
14
|
+
F: FnOnce() -> R,
|
15
|
+
{
|
16
|
+
let closure_ptr = arg as *mut Option<F>;
|
17
|
+
let closure = unsafe { (*closure_ptr).take().expect("Closure already taken") };
|
18
|
+
|
19
|
+
let result = closure();
|
20
|
+
|
21
|
+
let boxed_result = Box::new(result);
|
22
|
+
Box::into_raw(boxed_result) as *mut c_void
|
23
|
+
}
|
24
|
+
|
25
|
+
let mut closure_opt = Some(f);
|
26
|
+
let closure_ptr = &mut closure_opt as *mut Option<F> as *mut c_void;
|
27
|
+
|
28
|
+
let raw_result_ptr = unsafe {
|
29
|
+
rb_thread_call_without_gvl(
|
30
|
+
Some(trampoline::<F, R>),
|
31
|
+
closure_ptr,
|
32
|
+
None,
|
33
|
+
null_mut(),
|
34
|
+
)
|
35
|
+
};
|
36
|
+
|
37
|
+
let result_box = unsafe { Box::from_raw(raw_result_ptr as *mut R) };
|
38
|
+
*result_box
|
39
|
+
}
|
40
|
+
|
41
|
+
pub fn call_with_gvl<F, R>(f: F) -> R
|
42
|
+
where
|
43
|
+
F: FnOnce(Ruby) -> R,
|
44
|
+
{
|
45
|
+
extern "C" fn trampoline<F, R>(arg: *mut c_void) -> *mut c_void
|
46
|
+
where
|
47
|
+
F: FnOnce(Ruby) -> R,
|
48
|
+
{
|
49
|
+
let closure_ptr = arg as *mut Option<F>;
|
50
|
+
let closure = unsafe { (*closure_ptr).take().expect("Closure already taken") };
|
51
|
+
|
52
|
+
let result = closure(Ruby::get().unwrap());
|
53
|
+
|
54
|
+
let boxed_result = Box::new(result);
|
55
|
+
Box::into_raw(boxed_result) as *mut c_void
|
56
|
+
}
|
57
|
+
|
58
|
+
let mut closure_opt = Some(f);
|
59
|
+
let closure_ptr = &mut closure_opt as *mut Option<F> as *mut c_void;
|
60
|
+
|
61
|
+
let raw_result_ptr = unsafe { rb_thread_call_with_gvl(Some(trampoline::<F, R>), closure_ptr) };
|
62
|
+
|
63
|
+
let result_box = unsafe { Box::from_raw(raw_result_ptr as *mut R) };
|
64
|
+
*result_box
|
65
|
+
}
|
data/ext/watchcat/src/lib.rs
CHANGED
@@ -8,15 +8,18 @@ use magnus::{
|
|
8
8
|
};
|
9
9
|
use notify::{Config, PollWatcher, RecommendedWatcher, RecursiveMode, Watcher};
|
10
10
|
use notify_debouncer_mini::new_debouncer;
|
11
|
-
use std::{path::Path, time::Duration};
|
11
|
+
use std::{path::Path, time::Duration, sync::{Arc, atomic::{AtomicBool, Ordering}}};
|
12
12
|
|
13
13
|
mod event;
|
14
|
+
mod gvl_helpers;
|
14
15
|
use crate::event::WatchatEvent;
|
16
|
+
use crate::gvl_helpers::{call_with_gvl, call_without_gvl};
|
15
17
|
|
16
18
|
#[magnus::wrap(class = "Watchcat::Watcher")]
|
17
19
|
struct WatchcatWatcher {
|
18
20
|
tx: crossbeam_channel::Sender<bool>,
|
19
21
|
rx: crossbeam_channel::Receiver<bool>,
|
22
|
+
terminated: Arc<AtomicBool>,
|
20
23
|
}
|
21
24
|
|
22
25
|
#[derive(Debug)]
|
@@ -33,10 +36,12 @@ impl WatchcatWatcher {
|
|
33
36
|
Self {
|
34
37
|
tx: tx_executor,
|
35
38
|
rx: rx_executor,
|
39
|
+
terminated: Arc::new(AtomicBool::new(false)),
|
36
40
|
}
|
37
41
|
}
|
38
42
|
|
39
43
|
fn close(&self) {
|
44
|
+
self.terminated.store(true, Ordering::SeqCst);
|
40
45
|
self.tx.send(true).unwrap()
|
41
46
|
}
|
42
47
|
|
@@ -52,133 +57,174 @@ impl WatchcatWatcher {
|
|
52
57
|
RecursiveMode::NonRecursive
|
53
58
|
};
|
54
59
|
|
60
|
+
// Clone necessary data for the call_without_gvl
|
61
|
+
let terminated = self.terminated.clone();
|
62
|
+
let rx_clone = self.rx.clone();
|
63
|
+
|
64
|
+
// Start the file watching with GVL released
|
55
65
|
if debounce >= 0 {
|
56
|
-
|
66
|
+
Self::watch_with_debounce_threaded(
|
67
|
+
pathnames, mode, ignore_remove, debounce, terminated, rx_clone
|
68
|
+
)
|
57
69
|
} else {
|
58
|
-
|
70
|
+
Self::watch_without_debounce_threaded(
|
71
|
+
pathnames, mode, force_polling, poll_interval, ignore_remove, terminated, rx_clone
|
72
|
+
)
|
59
73
|
}
|
60
74
|
}
|
61
75
|
|
62
|
-
fn
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
76
|
+
fn watch_without_debounce_threaded(
|
77
|
+
pathnames: Vec<String>,
|
78
|
+
mode: RecursiveMode,
|
79
|
+
force_polling: bool,
|
80
|
+
poll_interval: u64,
|
81
|
+
ignore_remove: bool,
|
82
|
+
terminated: Arc<AtomicBool>,
|
83
|
+
rx: crossbeam_channel::Receiver<bool>
|
84
|
+
) -> Result<bool, Error> {
|
85
|
+
call_without_gvl(move || {
|
86
|
+
let (tx, watcher_rx) = unbounded();
|
87
|
+
// This variable is needed to keep `watcher` active.
|
88
|
+
let _watcher = match force_polling {
|
89
|
+
true => {
|
90
|
+
let delay = Duration::from_millis(poll_interval);
|
91
|
+
let config = notify::Config::default().with_poll_interval(delay);
|
92
|
+
let mut watcher = PollWatcher::new(tx, config)
|
75
93
|
.map_err(|e| Error::new(magnus::exception::arg_error(), e.to_string()))?;
|
94
|
+
for pathname in &pathnames {
|
95
|
+
let path = Path::new(pathname);
|
96
|
+
watcher
|
97
|
+
.watch(path, mode)
|
98
|
+
.map_err(|e| Error::new(magnus::exception::arg_error(), e.to_string()))?;
|
99
|
+
}
|
100
|
+
WatcherEnum::Poll(watcher)
|
76
101
|
}
|
77
|
-
|
78
|
-
|
79
|
-
false => {
|
80
|
-
let mut watcher = RecommendedWatcher::new(tx, Config::default())
|
81
|
-
.map_err(|e| Error::new(magnus::exception::arg_error(), e.to_string()))?;
|
82
|
-
for pathname in &pathnames {
|
83
|
-
let path = Path::new(pathname);
|
84
|
-
watcher
|
85
|
-
.watch(path, mode)
|
102
|
+
false => {
|
103
|
+
let mut watcher = RecommendedWatcher::new(tx, Config::default())
|
86
104
|
.map_err(|e| Error::new(magnus::exception::arg_error(), e.to_string()))?;
|
105
|
+
for pathname in &pathnames {
|
106
|
+
let path = Path::new(pathname);
|
107
|
+
watcher
|
108
|
+
.watch(path, mode)
|
109
|
+
.map_err(|e| Error::new(magnus::exception::arg_error(), e.to_string()))?;
|
110
|
+
}
|
111
|
+
WatcherEnum::Recommended(watcher)
|
87
112
|
}
|
88
|
-
|
89
|
-
}
|
90
|
-
};
|
113
|
+
};
|
91
114
|
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
return Ok(true)
|
115
|
+
loop {
|
116
|
+
if terminated.load(Ordering::SeqCst) {
|
117
|
+
break Ok(true);
|
96
118
|
}
|
97
|
-
recv(rx) -> res => {
|
98
|
-
match res {
|
99
|
-
Ok(event) => {
|
100
|
-
match event {
|
101
|
-
Ok(event) => {
|
102
|
-
let paths = event
|
103
|
-
.paths
|
104
|
-
.iter()
|
105
|
-
.map(|p| p.to_string_lossy().into_owned())
|
106
|
-
.collect::<Vec<_>>();
|
107
|
-
|
108
|
-
if ignore_remove && matches!(event.kind, notify::event::EventKind::Remove(_)) {
|
109
|
-
continue;
|
110
|
-
}
|
111
119
|
|
112
|
-
|
120
|
+
select! {
|
121
|
+
recv(rx) -> _res => {
|
122
|
+
break Ok(true);
|
123
|
+
}
|
124
|
+
recv(watcher_rx) -> res => {
|
125
|
+
match res {
|
126
|
+
Ok(event) => {
|
127
|
+
match event {
|
128
|
+
Ok(event) => {
|
129
|
+
let paths = event
|
130
|
+
.paths
|
131
|
+
.iter()
|
132
|
+
.map(|p| p.to_string_lossy().into_owned())
|
133
|
+
.collect::<Vec<_>>();
|
113
134
|
|
114
|
-
(
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
|
135
|
+
if ignore_remove && matches!(event.kind, notify::event::EventKind::Remove(_)) {
|
136
|
+
continue;
|
137
|
+
}
|
138
|
+
|
139
|
+
// Yield to Ruby with GVL
|
140
|
+
let result = call_with_gvl(|_| {
|
141
|
+
yield_value::<(Vec<String>, Vec<String>, String), Value>(
|
142
|
+
(WatchatEvent::convert_kind(&event.kind), paths, format!("{:?}", event.kind))
|
143
|
+
)
|
144
|
+
});
|
145
|
+
|
146
|
+
if result.is_err() {
|
147
|
+
break Err(Error::new(magnus::exception::runtime_error(), "Error yielding to Ruby block"));
|
148
|
+
}
|
149
|
+
}
|
150
|
+
Err(e) => {
|
151
|
+
break Err(Error::new(magnus::exception::runtime_error(), e.to_string()));
|
152
|
+
}
|
121
153
|
}
|
122
154
|
}
|
123
|
-
|
124
|
-
|
125
|
-
|
126
|
-
Error::new(magnus::exception::runtime_error(), e.to_string())
|
127
|
-
)
|
155
|
+
Err(e) => {
|
156
|
+
break Err(Error::new(magnus::exception::runtime_error(), e.to_string()));
|
157
|
+
}
|
128
158
|
}
|
129
159
|
}
|
130
160
|
}
|
131
161
|
}
|
132
|
-
}
|
162
|
+
})
|
133
163
|
}
|
134
164
|
|
135
|
-
fn
|
136
|
-
|
137
|
-
|
138
|
-
|
139
|
-
|
140
|
-
|
141
|
-
|
142
|
-
|
143
|
-
|
144
|
-
|
165
|
+
fn watch_with_debounce_threaded(
|
166
|
+
pathnames: Vec<String>,
|
167
|
+
mode: RecursiveMode,
|
168
|
+
ignore_remove: bool,
|
169
|
+
debounce: i64,
|
170
|
+
terminated: Arc<AtomicBool>,
|
171
|
+
rx: crossbeam_channel::Receiver<bool>
|
172
|
+
) -> Result<bool, Error> {
|
173
|
+
call_without_gvl(move || {
|
174
|
+
let (tx, watcher_rx) = unbounded();
|
175
|
+
let mut debouncer = new_debouncer(Duration::from_millis(debounce.try_into().unwrap()), tx).unwrap();
|
176
|
+
for pathname in &pathnames {
|
177
|
+
let path = Path::new(pathname);
|
178
|
+
debouncer
|
179
|
+
.watcher()
|
180
|
+
.watch(path, mode)
|
181
|
+
.map_err(|e| Error::new(magnus::exception::arg_error(), e.to_string()))?;
|
182
|
+
}
|
145
183
|
|
146
|
-
|
147
|
-
|
148
|
-
|
149
|
-
return Ok(true)
|
184
|
+
loop {
|
185
|
+
if terminated.load(Ordering::SeqCst) {
|
186
|
+
break Ok(true);
|
150
187
|
}
|
151
|
-
recv(rx) -> res => {
|
152
|
-
match res {
|
153
|
-
Ok(events) => {
|
154
|
-
match events {
|
155
|
-
Ok(events) => {
|
156
|
-
events.iter().for_each(|event| {
|
157
|
-
if ignore_remove && !Path::new(&event.path).exists() {
|
158
|
-
return;
|
159
|
-
}
|
160
188
|
|
161
|
-
|
162
|
-
|
163
|
-
|
164
|
-
|
165
|
-
|
166
|
-
|
167
|
-
|
168
|
-
|
169
|
-
)
|
189
|
+
select! {
|
190
|
+
recv(rx) -> _res => {
|
191
|
+
break Ok(true);
|
192
|
+
}
|
193
|
+
recv(watcher_rx) -> res => {
|
194
|
+
match res {
|
195
|
+
Ok(events) => {
|
196
|
+
match events {
|
197
|
+
Ok(events) => {
|
198
|
+
for event in events.iter() {
|
199
|
+
if ignore_remove && !Path::new(&event.path).exists() {
|
200
|
+
continue;
|
201
|
+
}
|
202
|
+
|
203
|
+
// Yield to Ruby with GVL
|
204
|
+
let result = call_with_gvl(|_| {
|
205
|
+
yield_value::<(Vec<String>, Vec<String>, String), Value>(
|
206
|
+
(vec![], vec![event.path.to_string_lossy().into_owned()], format!("{:?}", event.kind))
|
207
|
+
)
|
208
|
+
});
|
209
|
+
|
210
|
+
if result.is_err() {
|
211
|
+
return Err(Error::new(magnus::exception::runtime_error(), "Error yielding to Ruby block"));
|
212
|
+
}
|
213
|
+
}
|
214
|
+
}
|
215
|
+
Err(e) => {
|
216
|
+
break Err(Error::new(magnus::exception::runtime_error(), e.to_string()));
|
217
|
+
}
|
170
218
|
}
|
171
219
|
}
|
172
|
-
|
173
|
-
|
174
|
-
|
175
|
-
Error::new(magnus::exception::runtime_error(), e.to_string())
|
176
|
-
)
|
220
|
+
Err(e) => {
|
221
|
+
break Err(Error::new(magnus::exception::runtime_error(), e.to_string()));
|
222
|
+
}
|
177
223
|
}
|
178
224
|
}
|
179
225
|
}
|
180
226
|
}
|
181
|
-
}
|
227
|
+
})
|
182
228
|
}
|
183
229
|
|
184
230
|
#[allow(clippy::let_unit_value, clippy::type_complexity)]
|
data/lib/watchcat/executor.rb
CHANGED
@@ -1,13 +1,8 @@
|
|
1
|
-
|
2
|
-
require "drb/unix"
|
3
|
-
require_relative "server"
|
4
|
-
require_relative "client"
|
1
|
+
require_relative "event"
|
5
2
|
|
6
3
|
module Watchcat
|
7
4
|
class Executor
|
8
5
|
def initialize(paths, recursive:, force_polling:, poll_interval:, wait_until_startup:, ignore_remove:, debounce:, block:)
|
9
|
-
@service = nil
|
10
|
-
@child_pid = nil
|
11
6
|
@paths = paths
|
12
7
|
@recursive = recursive
|
13
8
|
@force_polling = force_polling
|
@@ -16,49 +11,53 @@ module Watchcat
|
|
16
11
|
@ignore_remove = ignore_remove
|
17
12
|
@debounce = debounce
|
18
13
|
@block = block
|
14
|
+
@watcher = Watchcat::Watcher.new
|
15
|
+
@watch_thread = nil
|
16
|
+
@stop_requested = false
|
19
17
|
end
|
20
18
|
|
21
19
|
def start
|
22
|
-
|
23
|
-
@
|
24
|
-
|
25
|
-
|
20
|
+
# Always start watching in a background thread to avoid blocking
|
21
|
+
@watch_thread = Thread.new do
|
22
|
+
Thread.current.name = "watchcat-watcher"
|
23
|
+
start_watching
|
24
|
+
end
|
26
25
|
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
client.run
|
26
|
+
# If wait_until_startup is true, give the thread a moment to start
|
27
|
+
if @wait_until_startup
|
28
|
+
sleep 0.1
|
31
29
|
end
|
32
30
|
|
33
|
-
main = Process.pid
|
34
31
|
at_exit do
|
35
|
-
|
36
|
-
stop if Process.pid == main
|
37
|
-
exit @exit_status if @exit_status
|
32
|
+
stop
|
38
33
|
end
|
39
34
|
end
|
40
35
|
|
41
36
|
def stop
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
#
|
37
|
+
@stop_requested = true
|
38
|
+
@watcher.close
|
39
|
+
if @watch_thread && @watch_thread.alive?
|
40
|
+
@watch_thread.join(1) # Wait up to 1 second for thread to finish
|
46
41
|
end
|
47
|
-
@service.stop_service
|
48
42
|
end
|
49
43
|
|
50
44
|
private
|
51
45
|
|
52
|
-
def
|
53
|
-
|
54
|
-
@
|
55
|
-
paths: @paths,
|
46
|
+
def start_watching
|
47
|
+
@watcher.watch(
|
48
|
+
@paths,
|
56
49
|
recursive: @recursive,
|
57
50
|
force_polling: @force_polling,
|
58
51
|
poll_interval: @poll_interval,
|
59
|
-
|
60
|
-
|
61
|
-
)
|
52
|
+
ignore_remove: @ignore_remove,
|
53
|
+
debounce: @debounce
|
54
|
+
) do |kind, paths, raw_kind|
|
55
|
+
break if @stop_requested
|
56
|
+
|
57
|
+
# Create an event object and call the block
|
58
|
+
event = Watchcat::Event.new(kind, paths, raw_kind)
|
59
|
+
@block.call(event)
|
60
|
+
end
|
62
61
|
end
|
63
62
|
end
|
64
63
|
end
|
data/lib/watchcat/version.rb
CHANGED
data/watchcat.gemspec
CHANGED
@@ -11,7 +11,7 @@ Gem::Specification.new do |spec|
|
|
11
11
|
spec.summary = "Simple filesystem notification library for Ruby. "
|
12
12
|
spec.homepage = "https://github.com/y-yagi/watchcat"
|
13
13
|
spec.license = "MIT"
|
14
|
-
spec.required_ruby_version = ">= 3.
|
14
|
+
spec.required_ruby_version = ">= 3.1.0"
|
15
15
|
|
16
16
|
spec.metadata["homepage_uri"] = spec.homepage
|
17
17
|
spec.metadata["rubygems_mfa_required"] = "true"
|
@@ -27,7 +27,6 @@ Gem::Specification.new do |spec|
|
|
27
27
|
spec.extensions = ["ext/watchcat/extconf.rb"]
|
28
28
|
|
29
29
|
spec.add_dependency "rb_sys"
|
30
|
-
spec.add_dependency "drb"
|
31
30
|
spec.add_development_dependency "debug"
|
32
31
|
spec.add_development_dependency "minitest"
|
33
32
|
spec.add_development_dependency "minitest-retry"
|
metadata
CHANGED
@@ -1,14 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: watchcat
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.3.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Yuji Yaginuma
|
8
|
-
autorequire:
|
9
8
|
bindir: bin
|
10
9
|
cert_chain: []
|
11
|
-
date:
|
10
|
+
date: 1980-01-02 00:00:00.000000000 Z
|
12
11
|
dependencies:
|
13
12
|
- !ruby/object:Gem::Dependency
|
14
13
|
name: rb_sys
|
@@ -24,20 +23,6 @@ dependencies:
|
|
24
23
|
- - ">="
|
25
24
|
- !ruby/object:Gem::Version
|
26
25
|
version: '0'
|
27
|
-
- !ruby/object:Gem::Dependency
|
28
|
-
name: drb
|
29
|
-
requirement: !ruby/object:Gem::Requirement
|
30
|
-
requirements:
|
31
|
-
- - ">="
|
32
|
-
- !ruby/object:Gem::Version
|
33
|
-
version: '0'
|
34
|
-
type: :runtime
|
35
|
-
prerelease: false
|
36
|
-
version_requirements: !ruby/object:Gem::Requirement
|
37
|
-
requirements:
|
38
|
-
- - ">="
|
39
|
-
- !ruby/object:Gem::Version
|
40
|
-
version: '0'
|
41
26
|
- !ruby/object:Gem::Dependency
|
42
27
|
name: debug
|
43
28
|
requirement: !ruby/object:Gem::Requirement
|
@@ -136,7 +121,6 @@ dependencies:
|
|
136
121
|
- - ">="
|
137
122
|
- !ruby/object:Gem::Version
|
138
123
|
version: '0'
|
139
|
-
description:
|
140
124
|
email:
|
141
125
|
- yuuji.yaginuma@gmail.com
|
142
126
|
executables: []
|
@@ -144,6 +128,7 @@ extensions:
|
|
144
128
|
- ext/watchcat/extconf.rb
|
145
129
|
extra_rdoc_files: []
|
146
130
|
files:
|
131
|
+
- CHANGELOG.md
|
147
132
|
- Cargo.lock
|
148
133
|
- Cargo.toml
|
149
134
|
- Gemfile
|
@@ -156,13 +141,12 @@ files:
|
|
156
141
|
- ext/watchcat/Cargo.toml
|
157
142
|
- ext/watchcat/extconf.rb
|
158
143
|
- ext/watchcat/src/event.rs
|
144
|
+
- ext/watchcat/src/gvl_helpers.rs
|
159
145
|
- ext/watchcat/src/lib.rs
|
160
146
|
- lib/watchcat.rb
|
161
|
-
- lib/watchcat/client.rb
|
162
147
|
- lib/watchcat/event.rb
|
163
148
|
- lib/watchcat/executor.rb
|
164
149
|
- lib/watchcat/kind.rb
|
165
|
-
- lib/watchcat/server.rb
|
166
150
|
- lib/watchcat/version.rb
|
167
151
|
- watchcat.gemspec
|
168
152
|
homepage: https://github.com/y-yagi/watchcat
|
@@ -171,7 +155,6 @@ licenses:
|
|
171
155
|
metadata:
|
172
156
|
homepage_uri: https://github.com/y-yagi/watchcat
|
173
157
|
rubygems_mfa_required: 'true'
|
174
|
-
post_install_message:
|
175
158
|
rdoc_options: []
|
176
159
|
require_paths:
|
177
160
|
- lib
|
@@ -179,15 +162,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
179
162
|
requirements:
|
180
163
|
- - ">="
|
181
164
|
- !ruby/object:Gem::Version
|
182
|
-
version: 3.
|
165
|
+
version: 3.1.0
|
183
166
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
184
167
|
requirements:
|
185
168
|
- - ">="
|
186
169
|
- !ruby/object:Gem::Version
|
187
170
|
version: '0'
|
188
171
|
requirements: []
|
189
|
-
rubygems_version: 3.
|
190
|
-
signing_key:
|
172
|
+
rubygems_version: 3.6.7
|
191
173
|
specification_version: 4
|
192
174
|
summary: Simple filesystem notification library for Ruby.
|
193
175
|
test_files: []
|
data/lib/watchcat/client.rb
DELETED
@@ -1,26 +0,0 @@
|
|
1
|
-
module Watchcat
|
2
|
-
class Client
|
3
|
-
def initialize(uri, paths:, recursive:, force_polling:, poll_interval:, ignore_remove:, debounce:)
|
4
|
-
DRb.start_service
|
5
|
-
@watcher = Watchcat::Watcher.new
|
6
|
-
@server = DRbObject.new_with_uri(uri)
|
7
|
-
@paths = paths
|
8
|
-
@recursive = recursive
|
9
|
-
@force_polling = force_polling
|
10
|
-
@poll_interval = poll_interval
|
11
|
-
@ignore_remove = ignore_remove
|
12
|
-
@debounce = debounce
|
13
|
-
end
|
14
|
-
|
15
|
-
def run
|
16
|
-
@watcher.watch(
|
17
|
-
@paths,
|
18
|
-
recursive: @recursive,
|
19
|
-
force_polling: @force_polling,
|
20
|
-
poll_interval: @poll_interval,
|
21
|
-
ignore_remove: @ignore_remove,
|
22
|
-
debounce: @debounce
|
23
|
-
) { |notification| @server.execute(notification) }
|
24
|
-
end
|
25
|
-
end
|
26
|
-
end
|
data/lib/watchcat/server.rb
DELETED
@@ -1,14 +0,0 @@
|
|
1
|
-
require "watchcat/event"
|
2
|
-
|
3
|
-
module Watchcat
|
4
|
-
class Server
|
5
|
-
def initialize(block)
|
6
|
-
@block = block
|
7
|
-
end
|
8
|
-
|
9
|
-
def execute(notification)
|
10
|
-
event = Watchcat::Event.new(notification[0], notification[1], notification[2])
|
11
|
-
@block.call(event)
|
12
|
-
end
|
13
|
-
end
|
14
|
-
end
|