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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: fda9cc3456d2cee73418912b619dcfb975f94399563c7457ed132e7ba9658133
4
- data.tar.gz: 757255818e15cdd69d830332e5cd9e6185dae1e2ae81c2a37f0675b03fd82074
3
+ metadata.gz: 321909d5547837b0eb60faefa347c333f65041ba41c9b4f4de7c929dca135a89
4
+ data.tar.gz: 6a29084ee42abd7993249d47a644b1f1bae509ba80ec3d6649f6da76bfc9b8e7
5
5
  SHA512:
6
- metadata.gz: 991e5d2bf7d2fb607fc095bc5983e0a74770ab528e8ab3747bec6812795f12fe7ae77614ac6d9c33c4f730e814e404fa75d52e34e1e81591eafa67f27f0efd1f
7
- data.tar.gz: d069c27def32d3cb2eb5db0aac061a9df457b6bc8b64055c5b5e1d6776570d8bbadede816131b6d4e37f35cb9c39a272971d7065185282f4a8d67b590861c4f8
6
+ metadata.gz: f2527b0cae2a8f49a5d5d2c753dfff8b1d4ac881190b8168c5c18846005885c6c24cb469148a68e3bcd14900626f03924ea9b3cc50648921b77434d1451ef4ce
7
+ data.tar.gz: 16f2ad6b4f5fe165d7ccbd046d57d9f6462dc3d86035b419b4bdcb0b22f62ea530558a68950dfcbc094d0f7b1e4cc668945a0feb2973ce279e584ae261adcde1
data/CHANGELOG.md ADDED
@@ -0,0 +1,3 @@
1
+ ## 0.3.0
2
+
3
+ * Support Windows
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
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.4.0",
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.4.0"
42
+ version = "2.8.0"
43
43
  source = "registry+https://github.com/rust-lang/crates.io-index"
44
- checksum = "b4682ae6287fcf752ecaabbfcc7b6f9b72aa33933dc23a554d853aea8eea8635"
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.13"
74
+ version = "0.5.15"
75
75
  source = "registry+https://github.com/rust-lang/crates.io-index"
76
- checksum = "33480d6946193aa8033910124896ca395333cae7e2d1113d1fef6c3272217df2"
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.10.2"
129
+ version = "0.11.0"
142
130
  source = "registry+https://github.com/rust-lang/crates.io-index"
143
- checksum = "fdd168d97690d0b8c412d6b6c10360277f4d7ee495c5d0d5d5fe0854923255cc"
131
+ checksum = "f37dccff2791ab604f9babef0ba14fbe0be30bd368dc541e2b08d07c8aa908f3"
144
132
  dependencies = [
145
- "bitflags 1.3.2",
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.0.8"
149
+ version = "1.1.1"
171
150
  source = "registry+https://github.com/rust-lang/crates.io-index"
172
- checksum = "7447f1ca1b7b563588a205fe93dea8df60fd981423a768bc1c0ded35ed147d0c"
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 = "7.0.0"
270
+ version = "8.1.0"
292
271
  source = "registry+https://github.com/rust-lang/crates.io-index"
293
- checksum = "c533b4c39709f9ba5005d8002048266593c1cfaf3c5f0739d5b8ab0c6c504009"
272
+ checksum = "3163f59cd3fa0e9ef8c32f242966a7b9994fd7378366099593e0e73077cd8c97"
294
273
  dependencies = [
295
- "bitflags 2.4.0",
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.52.0",
284
+ "windows-sys 0.60.2",
307
285
  ]
308
286
 
309
287
  [[package]]
310
288
  name = "notify-debouncer-mini"
311
- version = "0.5.0"
289
+ version = "0.6.0"
312
290
  source = "registry+https://github.com/rust-lang/crates.io-index"
313
- checksum = "aaa5a66d07ed97dce782be94dcf5ab4d1b457f4243f7566c7557f15cabc8c799"
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 = "1.0.0"
302
+ version = "2.0.0"
325
303
  source = "registry+https://github.com/rust-lang/crates.io-index"
326
- checksum = "7393c226621f817964ffb3dc5704f9509e107a8b024b489cc2c1b217378785df"
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.102"
338
+ version = "0.9.117"
364
339
  source = "registry+https://github.com/rust-lang/crates.io-index"
365
- checksum = "df4dec4b1d304c3b308a2cd86b1216ea45dd4361f4e9fa056f108332d0a450c1"
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.102"
347
+ version = "0.9.117"
373
348
  source = "registry+https://github.com/rust-lang/crates.io-index"
374
- checksum = "1d71de3e29d174b8fb17b5d4470f27d7aa2605f8a9d05fda0d3aeff30e05a570"
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.4.0",
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.1.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-sys"
553
- version = "0.48.0"
518
+ name = "windows-link"
519
+ version = "0.1.3"
554
520
  source = "registry+https://github.com/rust-lang/crates.io-index"
555
- checksum = "677d2418bec65e3338edb076e806bc1ec15693c5d0104683f2efe857f61056a9"
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-targets"
580
- version = "0.48.5"
542
+ name = "windows-sys"
543
+ version = "0.60.2"
581
544
  source = "registry+https://github.com/rust-lang/crates.io-index"
582
- checksum = "9a2fa6e2155d7247be68c096456083145c183cbbbc2764150dda45a87197940c"
545
+ checksum = "f2f500e4d28234f72040990ec9d39e3a6b950f9f22d3dba18416c35882612bcb"
583
546
  dependencies = [
584
- "windows_aarch64_gnullvm 0.48.5",
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 = "windows_aarch64_gnullvm"
611
- version = "0.48.5"
567
+ name = "windows-targets"
568
+ version = "0.53.3"
612
569
  source = "registry+https://github.com/rust-lang/crates.io-index"
613
- checksum = "2b38e32f0abccf9987a4e3079dfb67dcd799fb61361e53e2882c3cbaf0d905d8"
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 = "windows_aarch64_msvc"
623
- version = "0.48.5"
590
+ name = "windows_aarch64_gnullvm"
591
+ version = "0.53.0"
624
592
  source = "registry+https://github.com/rust-lang/crates.io-index"
625
- checksum = "dc35310971f3b2dbbf3f0690a219f40e2d9afcf64f9ab7cc1be722937c26b4bc"
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 = "windows_i686_gnu"
635
- version = "0.48.5"
602
+ name = "windows_aarch64_msvc"
603
+ version = "0.53.0"
636
604
  source = "registry+https://github.com/rust-lang/crates.io-index"
637
- checksum = "a75915e7def60c94dcef72200b9a8e58e5091744960da64ec734a6c6e9b3743e"
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 = "windows_i686_msvc"
653
- version = "0.48.5"
626
+ name = "windows_i686_gnullvm"
627
+ version = "0.53.0"
654
628
  source = "registry+https://github.com/rust-lang/crates.io-index"
655
- checksum = "8f55c233f70c4b27f66c523580f78f1004e8b5a8b659e05a4eb49d4166cca406"
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 = "windows_x86_64_gnu"
665
- version = "0.48.5"
638
+ name = "windows_i686_msvc"
639
+ version = "0.53.0"
666
640
  source = "registry+https://github.com/rust-lang/crates.io-index"
667
- checksum = "53d40abd2583d23e4718fddf1ebec84dbff8381c07cae67ff7768bbf19c6718e"
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 = "windows_x86_64_gnullvm"
677
- version = "0.48.5"
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 = "0b7b52767868a23d5bab768e390dc5f5c55825b6d30b86c844ff2dc7414044cc"
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 = "windows_x86_64_msvc"
689
- version = "0.48.5"
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 = "ed94fce61571a4006852b7389a063ab983c02eb1bb37b47f8272ce92d06d9538"
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.2.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
- debug (1.9.2)
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
- drb (2.2.1)
15
- ffi (1.17.0-arm64-darwin)
16
- ffi (1.17.0-x86_64-darwin)
17
- ffi (1.17.0-x86_64-linux-gnu)
18
- io-console (0.7.2)
19
- irb (1.14.0)
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.1)
26
- minitest-retry (0.2.3)
29
+ minitest (5.25.5)
30
+ minitest-retry (0.2.5)
27
31
  minitest (>= 5.0)
28
- nokogiri (1.16.7-arm64-darwin)
32
+ nokogiri (1.18.1-arm64-darwin)
29
33
  racc (~> 1.4)
30
- nokogiri (1.16.7-x86_64-darwin)
34
+ nokogiri (1.18.1-x64-mingw-ucrt)
31
35
  racc (~> 1.4)
32
- nokogiri (1.16.7-x86_64-linux)
36
+ nokogiri (1.18.1-x86_64-darwin)
33
37
  racc (~> 1.4)
34
- psych (5.1.2)
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.2.1)
38
- rake-compiler (1.2.8)
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.102)
44
- rdoc (6.7.0)
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.5.10)
59
+ reline (0.6.1)
47
60
  io-console (~> 0.5)
48
- ruby_memcheck (3.0.0)
61
+ ruby_memcheck (3.0.1)
49
62
  nokogiri
50
- stringio (3.1.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.5.4
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
- w = Watchcat.watch("/tmp/test") do |e|
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
- w = Watchcat.watch("/tmp/target") do |e|
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."
@@ -1,6 +1,6 @@
1
1
  [package]
2
2
  name = "watchcat"
3
- version = "0.1.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.13"
11
+ crossbeam-channel = "0.5.15"
12
12
  magnus = "0.7"
13
- notify = { version = "7.0.0", features = ["crossbeam-channel"] }
14
- notify-debouncer-mini = { version = "0.5.0", features = ["crossbeam-channel"] }
15
- rb-sys = "0.9.102"
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
+ }
@@ -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
- self.watch_with_debounce(pathnames, mode, ignore_remove, debounce)
66
+ Self::watch_with_debounce_threaded(
67
+ pathnames, mode, ignore_remove, debounce, terminated, rx_clone
68
+ )
57
69
  } else {
58
- self.watch_without_debounce(pathnames, mode, force_polling, poll_interval, ignore_remove)
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 watch_without_debounce(&self, pathnames: Vec<String>, mode: RecursiveMode, force_polling: bool, poll_interval: u64, ignore_remove: bool) -> Result<bool, Error> {
63
- let (tx, rx) = unbounded();
64
- // This variable is needed to keep `watcher` active.
65
- let _watcher = match force_polling {
66
- true => {
67
- let delay = Duration::from_millis(poll_interval);
68
- let config = notify::Config::default().with_poll_interval(delay);
69
- let mut watcher = PollWatcher::new(tx, config)
70
- .map_err(|e| Error::new(magnus::exception::arg_error(), e.to_string()))?;
71
- for pathname in &pathnames {
72
- let path = Path::new(pathname);
73
- watcher
74
- .watch(path, mode)
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
- WatcherEnum::Poll(watcher)
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
- WatcherEnum::Recommended(watcher)
89
- }
90
- };
113
+ };
91
114
 
92
- loop {
93
- select! {
94
- recv(self.rx) -> _res => {
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
- yield_value::<(Vec<String>, Vec<String>, String), Value>(
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
- (WatchatEvent::convert_kind(&event.kind), paths, format!("{:?}", event.kind))
115
- )?;
116
- }
117
- Err(e) => {
118
- return Err(
119
- Error::new(magnus::exception::runtime_error(), e.to_string())
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
- Err(e) => {
125
- return Err(
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 watch_with_debounce(&self, pathnames: Vec<String>, mode: RecursiveMode, ignore_remove: bool, debounce: i64) -> Result<bool, Error> {
136
- let (tx, rx) = unbounded();
137
- let mut debouncer = new_debouncer(Duration::from_millis(debounce.try_into().unwrap()), tx).unwrap();
138
- for pathname in &pathnames {
139
- let path = Path::new(pathname);
140
- debouncer
141
- .watcher()
142
- .watch(path, mode)
143
- .map_err(|e| Error::new(magnus::exception::arg_error(), e.to_string()))?;
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
- loop {
147
- select! {
148
- recv(self.rx) -> _res => {
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
- yield_value::<(Vec<String>, Vec<String>, String), Value>(
162
- (vec![], vec![event.path.to_string_lossy().into_owned()], format!("{:?}", event.kind))
163
- ).unwrap();
164
- });
165
- }
166
- Err(e) => {
167
- return Err(
168
- Error::new(magnus::exception::runtime_error(), e.to_string())
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
- Err(e) => {
174
- return Err(
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)]
@@ -1,13 +1,8 @@
1
- require "drb"
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
- server = Server.new(@block)
23
- @service = DRb.start_service("drbunix:", server)
24
- client = nil
25
- client = build_client if @wait_until_startup
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
- @child_pid = fork do
28
- client = build_client unless @wait_until_startup
29
- Process.setproctitle("watchcat: watcher")
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
- @exit_status = $!.status if $!.is_a?(SystemExit)
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
- begin
43
- Process.kill(:KILL, @child_pid)
44
- rescue Errno::ESRCH
45
- # NOTE: We can ignore this error because there process is already dead.
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 build_client
53
- Client.new(
54
- @service.uri,
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
- debounce: @debounce,
60
- ignore_remove: @ignore_remove
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
@@ -1,3 +1,3 @@
1
1
  module Watchcat
2
- VERSION = "0.2.0"
2
+ VERSION = "0.3.0"
3
3
  end
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.0.0"
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.2.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: 2024-11-20 00:00:00.000000000 Z
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.0.0
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.5.19
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: []
@@ -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
@@ -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