hiiro 0.1.245 → 0.1.246

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.
Files changed (5) hide show
  1. checksums.yaml +4 -4
  2. data/bin/h-claude +13 -0
  3. data/bin/h-pr +8 -3
  4. data/lib/hiiro/version.rb +1 -1
  5. metadata +1 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 07d46822be5511ac65285e5499d50ccd442de23e38c7d4bf99f1e349e214a14f
4
- data.tar.gz: d5a37c09e78895a1d354ac3ed0bf94afe4543c4b2ede4bafff1e9a3cd144cdda
3
+ metadata.gz: 3bfe4b9c356a502d288415cb04d05d63eaa5ba590e5cd65a6146ae9c538d4d63
4
+ data.tar.gz: 12cf7e0c27e3f6c1dadb19400a930f340b4c927eccf056f2d153f134b6477fe2
5
5
  SHA512:
6
- metadata.gz: 0e702bc3617d434c65251a5d96cef34b3d760c69b625ac30094bd6f3567096a11a8ad93ea3e1191b2ee922f8b766fce66df9c792818a5b06ba1c871db3a748d1
7
- data.tar.gz: 7f5678dde901168d0376dbf93d75972f5968120a3c37caebba0997bd71848325b8742703363055f83d349bd4fc5c3ea28f5c3b4b7811afd8537c778a87300b00
6
+ metadata.gz: 5e73eadaf5b66a61f72baa404788a83fa513b15f2633ea2f8f0ae1955c792a6194b0e19f14a5f4b85d55a57696cfce103e0746be1276523bdfdf4849ace440a8
7
+ data.tar.gz: e19abec87d466385cd3c01fbf75d21818b57f1f4f9688e9648e70bc8a0a2da871d6b300916cc0316aea0a23fdfaf72f3bd48e1d29037b8589bb21af44580eee4
data/bin/h-claude CHANGED
@@ -78,6 +78,19 @@ Hiiro.run(*ARGV, plugins: [Pins]) {
78
78
  IO.popen(['claude', '-p'], 'w') { |io| io.write(prompt) }
79
79
  }
80
80
 
81
+ add_default {
82
+ tmpfile = Tempfile.new(['claude-', '.md'])
83
+ tmpfile.close
84
+ edit_files(tmpfile.path)
85
+ prompt = File.read(tmpfile.path).strip
86
+ tmpfile.unlink
87
+ if prompt.empty?
88
+ puts "Aborted (empty file)"
89
+ next
90
+ end
91
+ IO.popen(['claude', '-p'], 'w') { |io| io.write(prompt) }
92
+ }
93
+
81
94
  add_subcmd(:loop) { |*args|
82
95
  separator = "-" * 72
83
96
  history = []
data/bin/h-pr CHANGED
@@ -341,7 +341,7 @@ class PinnedPRManager
341
341
  { 'approved' => approved, 'changes_requested' => changes_requested, 'commented' => commented, 'reviewers' => latest_by_author }
342
342
  end
343
343
 
344
- def display_pinned(pr, idx = nil, widths: {})
344
+ def display_pinned(pr, idx = nil, widths: {}, oneline: false)
345
345
  slot_w = widths[:slot] || 1
346
346
  succ_w = widths[:succ] || 1
347
347
  total_w = widths[:total] || 1
@@ -407,7 +407,11 @@ class PinnedPRManager
407
407
  line3 = pr['url'] ? "#{indent}#{pr['url']}" : nil
408
408
  line4 = tags_str ? "#{indent}#{tags_str}" : nil
409
409
 
410
- [line1, line2, line3, line4].compact.join("\n")
410
+ if oneline
411
+ "#{line1} #{repo_label}#{pr['title']}"
412
+ else
413
+ [line1, line2, line3, line4].compact.join("\n")
414
+ end
411
415
  end
412
416
 
413
417
  def filter_active?(opts)
@@ -759,6 +763,7 @@ Hiiro.run(*ARGV, plugins: [Pins]) do
759
763
  add_subcmd(:ls) do |*ls_args|
760
764
  opts = Hiiro::Options.parse(ls_args) {
761
765
  flag(:update, short: 'u', desc: 'update status before listing')
766
+ flag(:oneline, short: '1', desc: 'one line per PR')
762
767
  instance_eval(&FILTER_OPTS)
763
768
  }
764
769
 
@@ -793,7 +798,7 @@ Hiiro.run(*ARGV, plugins: [Pins]) do
793
798
  as_w = results.map { |pr| [pr.dig('reviews', 'approved').to_i.to_s.length, 1].max }.max
794
799
  crs_w = results.map { |pr| [pr.dig('reviews', 'changes_requested').to_i.to_s.length, 1].max }.max
795
800
  widths = { slot: slot_w, succ: succ_w, total: total_w, as: as_w, crs: crs_w }
796
- results.each_with_index { |pr, idx| puts pinned_manager.display_pinned(pr, idx, widths: widths) }
801
+ results.each_with_index { |pr, idx| puts pinned_manager.display_pinned(pr, idx, widths: widths, oneline: opts.oneline) }
797
802
  last_checked = pinned.filter_map { |pr| pr['last_checked'] }.max
798
803
  puts "---"
799
804
  puts "Last updated: #{last_checked || 'never'}"
data/lib/hiiro/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  class Hiiro
2
- VERSION = "0.1.245"
2
+ VERSION = "0.1.246"
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.245
4
+ version: 0.1.246
5
5
  platform: ruby
6
6
  authors:
7
7
  - Joshua Toyota