watchcat 0.6.0 → 0.6.1

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: 6edf147a9999a757920046f26d3fadb4e8790f3acda6cb86787af3b6e5e31cce
4
- data.tar.gz: 56ab8e22e361774d92df290073b46a25ee3ae4f8024a1c2e82340d7b8b4617b4
3
+ metadata.gz: 47d2f9766f1eed1bde9cf1a18359a6e0934affe0dcc478dfcacb324444d3b6cd
4
+ data.tar.gz: 10478a5fe06d51a8c0e357f5415dea6fbc8b99203aa2121bd8c080c43a141d09
5
5
  SHA512:
6
- metadata.gz: bf284e712f64ef2f69efce857c08dfb572a134e31857bd6a8d17afbdecd9d3d356609fae7fbf58cd8074cc49464f36f7390f7a897b132ac9626096416dd15b43
7
- data.tar.gz: 66524cb293557d7c6b8a33739ed5d9c41b5d5b62dac5ada964d6b8d97df35d44e526ada232bfecee8375d1cc5cd2c4895c60fe3b0e6b5924eaef7f2005835ad8
6
+ metadata.gz: 81f5cefed399da9270bc610572108f88a2a72cca407c5c6d27bde0848bf3731f2aeced07220bde6bd0f83e02dd91ab1d8a564a3b4a4e83d8f014d865e402b537
7
+ data.tar.gz: ea0c45495eaa61bdbb6d440561e7e0a3bb996f2f31baaec1179cc85d7acf2ae27600e49cf40037d4bd0e38a5e6142e095021c7b0306d53b79c0cd9ae0e6eba48
data/CHANGELOG.md CHANGED
@@ -1,5 +1,10 @@
1
1
  ## Unreleased
2
2
 
3
+ ## 0.6.1
4
+
5
+ * Add `#alive?` to the watcher returned by `Watchcat.watch` for checking whether the background watcher thread is still running.
6
+ * Fix `ignore_access` being a no-op on macOS: FSEvents has no `Access` event kind, so a plain read was surfacing as an unclassified `Modify(Metadata)` event instead and passing the filter unfiltered.
7
+
3
8
  ## 0.6.0
4
9
 
5
10
  * Add `#watch`, `#unwatch`, and `#watched` to the watcher returned by `Watchcat.watch` for dynamically managing watched paths.
@@ -191,7 +191,22 @@ impl WatchcatWatcher {
191
191
  if ignore_remove && matches!(event.kind, notify::event::EventKind::Remove(_)) {
192
192
  continue;
193
193
  }
194
- if ignore_access && matches!(event.kind, notify::event::EventKind::Access(_)) {
194
+
195
+ let macos_ambiguous_metadata_touch = cfg!(target_os = "macos")
196
+ && matches!(
197
+ event.kind,
198
+ notify::event::EventKind::Modify(
199
+ notify::event::ModifyKind::Metadata(
200
+ notify::event::MetadataKind::Any
201
+ )
202
+ )
203
+ );
204
+ if ignore_access
205
+ && (matches!(
206
+ event.kind,
207
+ notify::event::EventKind::Access(_)
208
+ ) || macos_ambiguous_metadata_touch)
209
+ {
195
210
  continue;
196
211
  }
197
212
  if ignore_create && matches!(event.kind, notify::event::EventKind::Create(_)) {
@@ -71,6 +71,12 @@ module Watchcat
71
71
  @paths.dup
72
72
  end
73
73
 
74
+ # Whether the background watcher thread is still running. `false` before
75
+ # `#start` is called, after `#stop`, or if the thread died unexpectedly.
76
+ def alive?
77
+ !@watch_thread.nil? && @watch_thread.alive?
78
+ end
79
+
74
80
  private
75
81
 
76
82
  def start_watching
@@ -1,3 +1,3 @@
1
1
  module Watchcat
2
- VERSION = "0.6.0"
2
+ VERSION = "0.6.1"
3
3
  end
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.6.0
4
+ version: 0.6.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Yuji Yaginuma
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2026-08-03 00:00:00.000000000 Z
11
+ date: 2026-08-08 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rb_sys