hiiro 0.1.270 → 0.1.272

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: 8f1d28f0107940fe6255205f31ae4293acbcfc81463f89d842212a9b10363bb0
4
- data.tar.gz: 1f47347f56f43b346a3a1168ebd423280cdde45151067eb3b08929dfa76424d0
3
+ metadata.gz: e5b6bf6b9a6ac5ef1a816f32f071b301aba4b4649b4a980f51d503749997554d
4
+ data.tar.gz: f1b46d52bfc0762bdbc3ba5a9a06ee32179b3eb7cbe27de2ad4720ee7d26129b
5
5
  SHA512:
6
- metadata.gz: e97db54794ca0f8a731503973fa353f9ca4af8048f09604aa91f5c44a4ef419ed1261e921d390e00a0ad9a12613cf80a155960714f4cd9b2c1e5c558cef3ff63
7
- data.tar.gz: 502d0bdab8d536f5c0c9d207b798f789428403a329c8b4ca5a4b56f9748852959371b421d05f552fa6762d56dfb27130c87fe29d5b1ad47422d942a6a9675a9f
6
+ metadata.gz: 6ab66bcd87f995a2fa549dc95a3ebee3fa7bc78b5bb58940e8af929806341eb5b0803aad5e094584f4452d084160f268c474ed89444528b41b82fe0db960fbb8
7
+ data.tar.gz: e055d1c6b39d74ee920281d1f1e00e42cacd43c22cecbbbf731bf6e22c59fb790c9d2b2aea73b78f8265f95055ba949eb4cacacdbd2724e947eb3c4c77f1446e
data/CHANGELOG.md CHANGED
@@ -1 +1 @@
1
- Invalid API key · Please run /login
1
+ Done. CHANGELOG.md updated with v0.1.272.
data/bin/h-claude CHANGED
@@ -107,7 +107,8 @@ add_subcmd(:env) { |*args|
107
107
 
108
108
  add_subcmd(:skills) {
109
109
  dir = File.expand_path('~/.claude/skills')
110
- dirs = Dir.glob("#{dir}/*/").sort
110
+ plugin_dir = File.expand_path('~/.claude/plugins/local/skills')
111
+ dirs = Dir.glob("{#{dir},#{plugin_dir}}/*/").sort
111
112
  dirs.each { |d| puts File.basename(d) }
112
113
  }
113
114
 
data/bin/h-config CHANGED
@@ -20,6 +20,10 @@ Hiiro.run(*ARGV) {
20
20
  open_config.(dir: '~', file: '.gitconfig')
21
21
  }
22
22
 
23
+ add_subcmd(:ignore) {
24
+ open_config.(dir: '~/.config/git', file: 'ignore')
25
+ }
26
+
23
27
  add_subcmd(:local) {
24
28
  root = `git rev-parse --show-toplevel`.chomp
25
29
  open_config.(dir: root, file: '.git/config')
data/bin/h-pr CHANGED
@@ -593,7 +593,7 @@ Hiiro.run(*ARGV, plugins: [Pins]) do
593
593
  return nil
594
594
  end
595
595
  lines = pinned.each_with_index.each_with_object({}) do |(pr, idx), h|
596
- h[pinned_manager.display_pinned(pr, idx)] = pr.number.to_s
596
+ h[pinned_manager.display_pinned(pr, idx, oneline: true)] = pr.number.to_s
597
597
  end
598
598
  return fuzzyfind_from_map(lines)
599
599
  end
@@ -831,9 +831,9 @@ Hiiro.run(*ARGV, plugins: [Pins]) do
831
831
 
832
832
  add_subcmd(:ls) do |*ls_args|
833
833
  opts = Hiiro::Options.parse(ls_args) {
834
- flag(:update, short: 'u', desc: 'update status before listing')
835
- flag(:oneline, short: '1', desc: 'one line per PR')
836
- flag(:checks, short: 'C', desc: 'show individual check run details')
834
+ flag(:update, short: 'u', desc: 'update status before listing')
835
+ flag(:verbose, short: 'v', desc: 'multi-line output per PR')
836
+ flag(:checks, short: 'C', desc: 'show individual check run details')
837
837
  instance_eval(&FILTER_OPTS)
838
838
  }
839
839
 
@@ -869,7 +869,7 @@ Hiiro.run(*ARGV, plugins: [Pins]) do
869
869
  crs_w = results.map { |pr| [pr.reviews&.dig('changes_requested').to_i.to_s.length, 1].max }.max
870
870
  widths = { slot: slot_w, succ: succ_w, total: total_w, as: as_w, crs: crs_w }
871
871
  results.each_with_index do |pr, idx|
872
- puts pinned_manager.display_pinned(pr, idx, widths: widths, oneline: opts.oneline)
872
+ puts pinned_manager.display_pinned(pr, idx, widths: widths, oneline: !opts.verbose)
873
873
  pinned_manager.display_check_runs(pr) if opts.checks
874
874
  end
875
875
  last_checked = pinned.filter_map(&:last_checked).max
@@ -1182,7 +1182,7 @@ Hiiro.run(*ARGV, plugins: [Pins]) do
1182
1182
 
1183
1183
  if ref.nil?
1184
1184
  lines = pinned.each_with_index.each_with_object({}) do |(pr, idx), h|
1185
- h[pinned_manager.display_pinned(pr, idx)] = pr.number.to_s
1185
+ h[pinned_manager.display_pinned(pr, idx, oneline: true)] = pr.number.to_s
1186
1186
  end
1187
1187
 
1188
1188
  pr_number = fuzzyfind_from_map(lines)
@@ -1262,7 +1262,7 @@ Hiiro.run(*ARGV, plugins: [Pins]) do
1262
1262
  next
1263
1263
  end
1264
1264
  lines = candidates.each_with_index.each_with_object({}) do |(pr, idx), h|
1265
- h[pinned_manager.display_pinned(pr, idx)] = pr
1265
+ h[pinned_manager.display_pinned(pr, idx, oneline: true)] = pr
1266
1266
  end
1267
1267
  selected = fuzzyfind_from_map(lines)
1268
1268
  next unless selected
data/lib/hiiro/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  class Hiiro
2
- VERSION = "0.1.270"
2
+ VERSION = "0.1.272"
3
3
  end
data/lib/hiiro.rb CHANGED
@@ -214,6 +214,8 @@ class Hiiro
214
214
  end
215
215
 
216
216
  def run
217
+ auto_tag_branch_with_task if tasks_enabled?
218
+
217
219
  run_args = runners.using_default? ? [subcmd, *args].compact : args
218
220
  result = runner.run(*run_args)
219
221
 
@@ -232,6 +234,22 @@ class Hiiro
232
234
  exit 1
233
235
  end
234
236
 
237
+ def auto_tag_branch_with_task
238
+ task = environment.task
239
+ return unless task
240
+
241
+ branch = environment.tree&.branch
242
+ return if branch.nil? || branch.empty?
243
+ return if %w[master main].include?(branch)
244
+
245
+ tag_store = Tags.new(:branch)
246
+ return if tag_store.get(branch).include?(task.name)
247
+
248
+ tag_store.add(branch, task.name)
249
+ rescue
250
+ # never let auto-tagging break a command
251
+ end
252
+
235
253
  def runnable?
236
254
  runner
237
255
  end
data/script/diff ADDED
@@ -0,0 +1,56 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ require 'json'
4
+ require 'hiiro/options'
5
+
6
+ opts = Hiiro::Options.parse(ARGV) do
7
+ flag(:repo, short: :r)
8
+ end
9
+
10
+ if opts.help?
11
+ puts opts.help_text
12
+ exit 1
13
+ end
14
+
15
+ dest_dir =
16
+ if opts.repo
17
+ `git rev-parse --show-toplevel`.strip
18
+ else
19
+ Dir.home
20
+ end
21
+ context = {
22
+ script_path: File.dirname(__FILE__),
23
+ script_dir: __dir__,
24
+ files: opts.args.flat_map { |arg|
25
+ Dir.glob("{bin,lib,plugins}/**/*#{arg}*").tap do |mfiles|
26
+ mfiles.each do |mfile|
27
+ if mfile.match?(/h-/)
28
+ puts "ARG MATCHES bin-style name => #{mfile}"
29
+ end
30
+ end
31
+ end
32
+ }.each_with_object({}) { |file, h|
33
+ case file
34
+ when /^bin/ then h[file] = File.join(Dir.home, file)
35
+ when /^lib/
36
+ ilib = `gem which hiiro`.strip
37
+ basename = File.basename(ilib)
38
+ dirname = File.dirname(ilib)
39
+ 6.times do
40
+ break if basename == 'lib'
41
+ basename = File.basename(dirname)
42
+ dirname = File.dirname(dirname)
43
+ end
44
+ h[file] = File.join(dirname, file)
45
+ when /^plug/ then h[file] = File.join(Dir.home, '.config/hiiro', file)
46
+ end
47
+ },
48
+ }
49
+
50
+ files = opts.repo ? context[:files].invert : context[:files]
51
+ files = files.to_a.flatten
52
+
53
+
54
+ system('safe_nvim', '-O2', *files)
55
+ puts JSON.pretty_generate(context)
56
+
data/script/diffhome ADDED
@@ -0,0 +1,6 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ diff_bin = File.join(__dir__, 'diff')
4
+
5
+ system(diff_bin, *ARGV)
6
+
data/script/diffrepo ADDED
@@ -0,0 +1,7 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ diff_bin = File.join(__dir__, 'diff')
4
+
5
+ system(diff_bin, '-r', *ARGV)
6
+
7
+
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.270
4
+ version: 0.1.272
5
5
  platform: ruby
6
6
  authors:
7
7
  - Joshua Toyota
@@ -294,6 +294,9 @@ files:
294
294
  - plugins/project.rb
295
295
  - record-demo.sh
296
296
  - script/compare
297
+ - script/diff
298
+ - script/diffhome
299
+ - script/diffrepo
297
300
  - script/install
298
301
  - script/publish
299
302
  - script/sync