hiiro 0.1.373 → 0.1.374

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: 20aa34021bb82c2fc10ecd805e991d93fd555502ca17efe9817acc077759e9c9
4
- data.tar.gz: d09d4366627e7ceeab982e147f08ddd0e7a650ccaa0264dd409ea102e80741d6
3
+ metadata.gz: 2eeea73b7e9f5a66d4156b20253a3b5815802c65c1ca9740694647fd9e2347e4
4
+ data.tar.gz: 3f79d0998110b47a4bc98f27764042a0ac48f263a6a2abb1ed8d59a6ddf512c3
5
5
  SHA512:
6
- metadata.gz: fb229c4ba5594b4c04ff0099a8ddde05a4ba690acc10fa2d35c821b9636e52656a7903b1e4460f1e69695f10731509933f0d89452439883e275a09512da9bfb6
7
- data.tar.gz: c5f5055c742cbe17f6d67ad01decfdafac89a7132144c62b9e95fd76f05e1f951bdb01f2b5697ddca5acadcd0679aeb4aa2f81f1699115ca70c744c7607745b1
6
+ metadata.gz: b023e9228aa0f2bc9053df47ce1fb37ad81b545c4ddbbb81735e0a32da501641252b61ed86ecd9319188b2838c90c9183283f3233087c825799e48905cb5d0bb
7
+ data.tar.gz: 5c952b79fb9bcf1697e7a1b88d86f097e6ba91220db03dc682ced02475ec10fa638da33578019e55fa2cfc441665a3808cee2ba7b45107056a8676cedf23ab2d
data/CHANGELOG.md CHANGED
@@ -2,6 +2,14 @@
2
2
 
3
3
  ## [Unreleased]
4
4
 
5
+ ## [0.1.374] - 2026-09-14
6
+
7
+ ### Changed
8
+ - `h alert` plays sounds through terminal-notifier's `-sound` (macOS system sound names, `none` for silent, `-S` accepted as an alias for `-s`) instead of a separate `afplay` process
9
+
10
+ ### Removed
11
+ - Support for custom sound files in `~/.config/hiiro/sounds/`
12
+
5
13
  ## [0.1.372] - 2026-09-14
6
14
 
7
15
  ### Changed
data/CLAUDE.md CHANGED
@@ -331,7 +331,7 @@ macOS notification wrapper using terminal-notifier:
331
331
 
332
332
  ```ruby
333
333
  Hiiro::Notification.show(hiiro) # Show notification based on hiiro.args
334
- # Supports: -m message, -t title, -l link, -c command, -s sound
334
+ # Supports: -m message, -t title, -l link, -c command, -s sound (macOS system sound name via terminal-notifier -sound; none for silent)
335
335
  ```
336
336
 
337
337
  ### Hiiro::Queue (lib/hiiro/queue.rb)
@@ -13,7 +13,8 @@ class Hiiro
13
13
 
14
14
  def options
15
15
  @options ||= Options.parse(args) do
16
- option(:sound, short: :s, default: 'basso', desc: 'sound name')
16
+ option(:sound, short: :s, default: 'Basso', desc: 'macOS system sound name, or none')
17
+ option(:sound_alias, short: :S, desc: 'alias for -s')
17
18
  option(:title, short: :t, desc: 'title')
18
19
  option(:message, short: :m, desc: 'message')
19
20
  option(:link, short: :l, desc: 'link to open')
@@ -25,32 +26,28 @@ class Hiiro
25
26
  @args ||= hiiro.args
26
27
  end
27
28
 
28
- def sounds
29
- custom = Dir.glob(File.join(Dir.home, '.config/hiiro/sounds/*'))
30
-
31
- @sounds ||= custom.each_with_object({}) do |fn, h|
32
- basename = File.basename(fn, File.extname(fn))
33
- h[basename.downcase] = fn
34
- end
29
+ # System sound name for terminal-notifier's -sound, or nil for silent.
30
+ # Herdr has its own sounds, so no separate afplay process is started.
31
+ def sound
32
+ name = (options.sound_alias || options.sound).to_s.strip
33
+ return nil if name.empty? || name.casecmp?('none')
34
+ name == 'default' ? name : name.capitalize
35
35
  end
36
36
 
37
- def show
38
- return unless has_cmd?
39
-
37
+ def command
40
38
  cmd = [binpath]
41
39
  cmd += ['-message', options.message] if options.message
42
40
  cmd += ['-title', options.title.tr('()[]', '')] if options.title
43
41
  cmd += ['-open', options.link] if options.link
44
42
  cmd += ['-execute', options.command] if options.command
45
- Process.detach(spawn(*cmd))
46
-
47
- play_sound
43
+ cmd += ['-sound', sound] if sound
44
+ cmd
48
45
  end
49
46
 
50
- def play_sound
51
- if options.sound && sounds[options.sound]
52
- Process.detach(spawn('afplay', sounds[options.sound.downcase]))
53
- end
47
+ def show
48
+ return unless has_cmd?
49
+
50
+ Process.detach(spawn(*command))
54
51
  end
55
52
 
56
53
  def binpath
data/lib/hiiro/version.rb CHANGED
@@ -1,4 +1,4 @@
1
1
  class Hiiro
2
- VERSION = "0.1.373"
2
+ VERSION = "0.1.374"
3
3
  SUPPORTED_RUBY_VERSION = ">= 3.2.0"
4
4
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: hiiro
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.373
4
+ version: 0.1.374
5
5
  platform: ruby
6
6
  authors:
7
7
  - Joshua Toyota