hiiro 0.1.317 → 0.1.318

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: 40fb2f5a3860a728d6f9a39ae41a6444caac0c04234d8e1a77ca2358eada9918
4
- data.tar.gz: 3d794ed032025dd96e062ca2c3cdfed49bc2bf036a19f120f7c32364048dc7b5
3
+ metadata.gz: 18a7b5de061af02dfb8d60a1dd50eaf91e790937976ab598120439f99170bad3
4
+ data.tar.gz: ca79b1405eaec4fb5ba0b8d43bd48ce6ff1b52136a806e08ddb7b4aa09bfb055
5
5
  SHA512:
6
- metadata.gz: a440caaacfcdeb5d39bca4ebb3b584766eb33a7e59df02ba7285107501654c931a26ed02590b9f1102e153112c8731f44f0d4e8d6fb5cc46cb49e6ce952e57c0
7
- data.tar.gz: e62b2ca724d4584f5b6e8962daf4de24fdd7b303c535fd7f4e1cc4ca5fdbe2aba61a203b7f80c70edcda205e87626396990a6565594fcc0e25202437235e9237
6
+ metadata.gz: e32866b673ce6ec24d27c453653853c6a594aa331d714712b19a817a2138ea56dac74eecc546289c9405819c5631cc1f8f5970b98f7d2d10828ccfce707a6487
7
+ data.tar.gz: 27f8163a315a7aa03e95cea498b57aadca0f22f2b2e09fdfe38f3cc760706be2ebf4cf54732f500c8b0a4174589ce56d44231fb8937f8a6820cd9e6f3c9250e8
data/CHANGELOG.md CHANGED
@@ -1,5 +1,18 @@
1
1
  # Changelog
2
2
 
3
+ ## [0.1.318] - 2026-04-01
4
+
5
+ ### Added
6
+ - `registry_pick` helper method for interactive registry entry selection via fuzzyfinder
7
+
8
+ ### Changed
9
+ - Simplify gem installation logic: always use `gem install -u` instead of checking installation state and branching between `gem install` and `gem update`
10
+ - Remove `--clear-sources` and `--source` flags in favor of gem's built-in source cache handling
11
+ - Improve gem version regex in publish script to match only the first (latest) version from `gem list` output
12
+
13
+ ### Fixed
14
+ - Ensure gem installation works reliably across all rbenv Ruby versions by using `-u` flag for consistent update behavior
15
+
3
16
  ## [0.1.317] - 2026-04-01
4
17
 
5
18
  ### Changed
data/lib/hiiro/rbenv.rb CHANGED
@@ -69,15 +69,11 @@ class Hiiro
69
69
  end
70
70
 
71
71
  # Install or update a gem in the given version.
72
- # Passes --clear-sources --source rubygems.org to bypass the local index cache.
72
+ # Always uses gem install (handles both fresh installs and updates to the latest
73
+ # version) and pins to rubygems.org to bypass the local source cache.
73
74
  def install_gem(gem_name, version: current_version, pre: false)
74
- source_flags = ['--clear-sources', '--source', 'https://rubygems.org']
75
- pre_flag = pre ? ['--pre'] : []
76
- if gem_installed?(gem_name, version: version)
77
- run('gem', 'update', gem_name, *source_flags, *pre_flag, version: version)
78
- else
79
- run('gem', 'install', gem_name, *source_flags, *pre_flag, version: version)
80
- end
75
+ pre_flag = pre ? ['--pre'] : []
76
+ run('gem', 'install', gem_name, '-u', *pre_flag, version: version)
81
77
  end
82
78
 
83
79
  # Install or update a gem across all installed versions.
@@ -64,3 +64,17 @@ class Hiiro
64
64
  end
65
65
  end
66
66
  end
67
+
68
+ class Hiiro
69
+ # Pick a registry entry by fuzzyfinder. Returns the canonical name string, or nil.
70
+ # Usage inside a subcommand block:
71
+ # task = opts.task || registry_pick('isc_task')
72
+ def registry_pick(type = nil)
73
+ lines = Hiiro::RegistryEntry.fuzzy_lines(type: type)
74
+ return nil if lines.empty?
75
+ chosen = fuzzyfind(lines)
76
+ return nil unless chosen
77
+ # fuzzy_line format: "type short name # desc" — name is 3rd column
78
+ chosen.strip.split(/\s{2,}/)[2]
79
+ end
80
+ end
data/lib/hiiro/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  class Hiiro
2
- VERSION = "0.1.317"
2
+ VERSION = "0.1.318"
3
3
  end
data/lib/hiiro.rb CHANGED
@@ -44,6 +44,7 @@ require_relative "hiiro/project"
44
44
  require_relative "hiiro/pane_home"
45
45
  require_relative "hiiro/pin_record"
46
46
  require_relative "hiiro/reminder"
47
+ require_relative 'hiiro/registry'
47
48
 
48
49
  class String
49
50
  def underscore(camel_cased_word=self)
data/script/publish CHANGED
@@ -239,27 +239,25 @@ unless RubyGems.wait_for("hiiro", new_version)
239
239
  end
240
240
 
241
241
  puts "v#{new_version} available — installing across all Ruby versions...\n\n"
242
- source_flags = ["--clear-sources", "--source", "https://rubygems.org"]
243
- pre_flag = pre_release ? ["--pre"] : []
244
- mu = Mutex.new
242
+ pre_flag = pre_release ? ["--pre"] : []
243
+ mu = Mutex.new
245
244
 
246
245
  rbenv_versions = `rbenv versions --bare`.lines(chomp: true)
247
246
  threads = rbenv_versions.map do |ver|
248
247
  Thread.new do
249
248
  env = { "RBENV_VERSION" => ver }
250
249
 
251
- # update or install
252
- installed = !`RBENV_VERSION=#{ver.shellescape} rbenv exec gem list hiiro --exact 2>/dev/null`.strip.empty?
253
- cmd = installed ? ["gem", "update", "hiiro", *source_flags, *pre_flag]
254
- : ["gem", "install", "hiiro", *source_flags, *pre_flag]
255
- system(env, "rbenv", "exec", *cmd, out: File::NULL, err: File::NULL)
250
+ # Always use gem install — it picks up the latest version whether or not
251
+ # an older one is installed, and handles the source cache reliably.
252
+ system(env, "rbenv", "exec",
253
+ "gem", "install", "hiiro", "-u", *pre_flag,
254
+ out: File::NULL, err: File::NULL)
256
255
 
257
- # run setup for the new version
258
256
  system(env, "rbenv", "exec", "h", "setup", out: File::NULL, err: File::NULL)
259
257
 
260
- # report installed version
258
+ # gem list returns "hiiro (0.1.317, 0.1.316, ...)" — grab only the first (latest)
261
259
  hiiro_ver = `RBENV_VERSION=#{ver.shellescape} rbenv exec gem list hiiro --exact 2>/dev/null`
262
- .match(/hiiro \(([^)]+)\)/)&.[](1) || "?"
260
+ .match(/hiiro \(([^,)]+)/)&.[](1) || "?"
263
261
  mu.synchronize { puts " ruby #{ver} → hiiro #{hiiro_ver}" }
264
262
  end
265
263
  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.317
4
+ version: 0.1.318
5
5
  platform: ruby
6
6
  authors:
7
7
  - Joshua Toyota