hiiro 0.1.284 → 0.1.285

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: c11001ebe9c6d60bad456719af866219ae6d2c13fde14019cb1a97f05feb4996
4
- data.tar.gz: ae2c4644c8dd9a2dfb0c97fad2ca9870f4a35eddf70ebbc04ba3e40df49e6480
3
+ metadata.gz: f63f8399ddfacf12854cff5d3f8e9a786b0188eeabda624468851f96cb43f6e1
4
+ data.tar.gz: 013c8686325af9c8eb5e5c2bf7f66c5ec030913ec5b4580ddf1e29d74691e0e1
5
5
  SHA512:
6
- metadata.gz: b9b748ffd9b8446976815ae76fd0e6540d6c008397b61d1476ce65d32490a60645c00b1c64c2136e79bb5f287c6adb08c7032eca9547525495d727711e77063d
7
- data.tar.gz: 8e1d1d6fc0361d7ee516ff1e2166b3e4158cd1cf77f6fd273f37f628e1a20f4014b6108efcbd38dc6d9d6d195b9aadcd167f813ae87aa6802096bbfbbde043ca
6
+ metadata.gz: c5268fac1b751f46c3a33fcb1a4ae97fe55076fe43cbeca9e5e14d44c39e5d03a32e723ec98a8604103bf954ef18cc3cc9916d9c976fa38dc20e0c370e916b0d
7
+ data.tar.gz: b72dca5b28255f364cad6430946edbbd1daf71361aff323906313bc35373bfc8b2055c7e90e1112e0279c88e2d6375d758f874b8e4276ad48bbc935c028b3a80
data/CHANGELOG.md CHANGED
@@ -1,3 +1,13 @@
1
+ ```markdown
2
+ ## Unreleased
3
+
4
+ ## [0.1.285] - 2026-03-26
5
+
6
+ ### Fixed
7
+ - **h notify**: Resolve terminal-notifier path dynamically instead of hardcoding, improving portability across different system configurations
8
+ - **h queue sadd**: Auto-detect current task from environment when no explicit `-f`/`-t` flag given, so frontmatter is populated without needing to pass a flag when already in a task session
9
+ - **h queue sadd**: Fixed task context being lost — was using `exec` which replaced the process; now calls `do_add` directly so `task_info` closure is preserved
10
+
1
11
  ## [0.1.284] - 2026-03-25
2
12
 
3
13
  ### Added
@@ -18,3 +28,4 @@
18
28
  - **TaskManager#send_cd**: Promoted from private to public method
19
29
 
20
30
  ## [0.1.281] - Previous release
31
+ ```
data/bin/h-notify CHANGED
@@ -98,7 +98,8 @@ Hiiro.run(*ARGV, tasks: true) do
98
98
  data[session].unshift(entry)
99
99
  write_log(data)
100
100
 
101
- system('terminal-notifier',
101
+ binpath = `command -v terminal-notifier`
102
+ system(binpath,
102
103
  '-title', @preset[:title],
103
104
  '-message', message,
104
105
  '-sound', @preset[:sound])
data/bin/h-pr CHANGED
@@ -47,10 +47,10 @@ Hiiro.run(*ARGV, plugins: [Pins]) do
47
47
 
48
48
  if result
49
49
  system('say', 'pr good')
50
- system('terminal-notifier', '-title', 'PR Good', '-message', "##{pr_num}: #{pr_title}", '-open', pr_url)
50
+ system('/opt/homebrew/bin/terminal-notifier', '-title', 'PR Good', '-message', "##{pr_num}: #{pr_title}", '-open', pr_url)
51
51
  else
52
52
  system('say', 'pr bad')
53
- system('terminal-notifier', '-title', 'PR Bad', '-message', "##{pr_num}: #{pr_title}", '-open', pr_url)
53
+ system('/opt/homebrew/bin/terminal-notifier', '-title', 'PR Bad', '-message', "##{pr_num}: #{pr_title}", '-open', pr_url)
54
54
  end
55
55
  }
56
56
 
@@ -37,7 +37,7 @@ class Hiiro
37
37
  def show
38
38
  return unless has_cmd?
39
39
 
40
- cmd = ['terminal-notifier']
40
+ cmd = [binpath]
41
41
  cmd += ['-message', options.message] if options.message
42
42
  cmd += ['-title', options.title.tr('()[]', '')] if options.title
43
43
  cmd += ['-open', options.link] if options.link
@@ -53,6 +53,10 @@ class Hiiro
53
53
  end
54
54
  end
55
55
 
56
+ def binpath
57
+ `command -v terminal-notifier`
58
+ end
59
+
56
60
  def has_cmd?
57
61
  system("command -v terminal-notifier &>/dev/null")
58
62
  end
data/lib/hiiro/queue.rb CHANGED
@@ -547,7 +547,7 @@ class Hiiro
547
547
  Tmux.open_session(TMUX_SESSION, start_directory: work_dir)
548
548
  }
549
549
 
550
- do_add = lambda do |args, split: nil|
550
+ do_add = lambda do |args, split: nil, session: false|
551
551
  q.queue_dirs
552
552
  opts = Hiiro::Options.parse(args) do
553
553
  option(:task, short: :t, desc: 'Task name', flag_ifs: [:find])
@@ -570,7 +570,14 @@ class Hiiro
570
570
  args = opts.args
571
571
  ti = q.resolve_task_info(opts, h, task_info)
572
572
 
573
- if opts.session
573
+ # Auto-detect current task from environment when no explicit context given
574
+ if ti.nil? && !opts.find && opts.task.nil?
575
+ env = Environment.current rescue nil
576
+ auto_task = env&.task
577
+ ti = q.task_info_for(auto_task.name) if auto_task
578
+ end
579
+
580
+ if opts.session || session
574
581
  session_name = h.tmux_client.current_session&.name
575
582
  ti = (ti || {}).merge(session_name: session_name) if session_name
576
583
  end
@@ -692,6 +699,12 @@ class Hiiro
692
699
  args = opts.args
693
700
  ti = q.resolve_task_info(opts, h, task_info)
694
701
 
702
+ if ti.nil? && !opts.find && opts.task.nil?
703
+ env = Environment.current rescue nil
704
+ auto_task = env&.task
705
+ ti = q.task_info_for(auto_task.name) if auto_task
706
+ end
707
+
695
708
  if opts.session
696
709
  session_name = h.tmux_client.current_session&.name
697
710
  ti = (ti || {}).merge(session_name: session_name) if session_name
@@ -828,7 +841,7 @@ class Hiiro
828
841
  }
829
842
 
830
843
  h.add_subcmd(:sadd) { |*args|
831
- exec('h', 'queue', 'add', '-s', *args)
844
+ do_add.call(args, session: true)
832
845
  }
833
846
 
834
847
  h.add_subcmd(:tadd) { |*args|
data/lib/hiiro/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  class Hiiro
2
- VERSION = "0.1.284"
2
+ VERSION = "0.1.285"
3
3
  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.284
4
+ version: 0.1.285
5
5
  platform: ruby
6
6
  authors:
7
7
  - Joshua Toyota