hiiro 0.1.315 → 0.1.316

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: 7a1893f514eefa2df7e5fc6730f984468b57fd94e732a7b70e131476f613fc6f
4
- data.tar.gz: ad813ddfe3c1b575967610f9df94a70351e6a7273b31ee02e5a98e253ff4a23d
3
+ metadata.gz: 2e4ea40a79adf7ef11a6e26db39af44e4f32e41edf12a2e537b96de961b2b0b2
4
+ data.tar.gz: 4b6377307feeff3fa975a1301a56efd54fba59a93a1540c197bbc1254f91c862
5
5
  SHA512:
6
- metadata.gz: 661dd8c86142d82fb38343c38b8a92f54a4a21e32ab6ed4c45b59543bfafbf3180510e8b25f6900a3360b8b1474e8b4e55783c1dbb586b28a1944e5842c05493
7
- data.tar.gz: 522f493875610863168d00a7b5b2afa1797314f9222f022a98b7719903ad63757e8de806b57dc361f5ed03f883f1cbb0b0c2e6a616165fed85b88796f71553aa
6
+ metadata.gz: 898deb3331965a47b97a02e2e3e50039d43578f3e5721dd26816328d8a9cd69bd8b46ccf6b38f2f5914ad90e2233c19bcd6bf1fa7543861828c79791302d4862
7
+ data.tar.gz: eb877f97cd8989252398254a803cd372b203c490d2a52940a8923e3a5dafd23bcd604e98e8c52b013be0be1bb8b3d854b315b2f1e5776f94f8959309a5f82d1d
data/CHANGELOG.md CHANGED
@@ -1,5 +1,19 @@
1
1
  # Changelog
2
2
 
3
+ ## [0.1.316] - 2026-04-01
4
+
5
+ ### Added
6
+ - Parallelize hiiro gem updates across Ruby versions with thread pool for faster multi-version updates
7
+ - Optional `dir:` parameter to `Hiiro::Background.run` for working directory support
8
+
9
+ ### Changed
10
+ - Improve gem version regex pattern in publish script for more reliable version matching
11
+
12
+ ### Fixed
13
+ - Bypass rubygems local cache with `--clear-sources --source https://rubygems.org` flags in `install_gem` to ensure fresh gem installation
14
+ - Add debug output for version polling in publish script
15
+ - Convert `sa` symlink from absolute to relative path
16
+
3
17
  ## [0.1.315] - 2026-04-01
4
18
 
5
19
  ### Fixed
@@ -203,4 +217,4 @@
203
217
  ## [0.1.295]
204
218
 
205
219
  ### Changed
206
- - Filter logic changes for PR management
220
+ - Filter logic changes for PR management
data/exe/h CHANGED
@@ -36,15 +36,22 @@ Hiiro.run(*ARGV, cwd: Dir.pwd, tasks: true) do
36
36
  }.parse!(ARGV)
37
37
 
38
38
  if opts.all
39
- Hiiro::Rbenv.versions.each do |ver|
40
- shell_cmd = [
41
- "(RBENV_VERSION=#{ver.shellescape} rbenv exec gem update hiiro #{opts.pre ? '--pre' : ''}",
42
- "|| RBENV_VERSION=#{ver.shellescape} rbenv exec gem install hiiro #{opts.pre ? '--pre' : ''})",
43
- "&& RBENV_VERSION=#{ver.shellescape} rbenv exec h setup",
44
- ].join(' ')
45
- puts "Queuing update for Ruby #{ver}..."
46
- Hiiro::Background.run('sh', '-c', shell_cmd)
39
+ versions = Hiiro::Rbenv.versions
40
+ puts "Updating hiiro across #{versions.size} Ruby version(s)...\n\n"
41
+ mu = Mutex.new
42
+
43
+ threads = versions.map do |ver|
44
+ Thread.new do
45
+ Hiiro::Rbenv.install_gem('hiiro', pre: opts.pre, version: ver)
46
+ Hiiro::Rbenv.run('h', 'setup', version: ver)
47
+ hiiro_ver = Hiiro::Rbenv.capture('gem', 'list', 'hiiro', '--exact', version: ver)
48
+ .match(/hiiro \(([^)]+)\)/)&.[](1) || '?'
49
+ mu.synchronize { puts " ruby #{ver} → hiiro #{hiiro_ver}" }
50
+ end
47
51
  end
52
+
53
+ threads.each(&:join)
54
+ puts "\nDone."
48
55
  else
49
56
  update_hiiro(pre: opts.pre)
50
57
  end
@@ -5,12 +5,17 @@ class Hiiro
5
5
  # Run cmd asynchronously. Inside tmux, spins up a hidden window in the
6
6
  # h-bg session so you can attach and inspect if needed. Outside tmux,
7
7
  # falls back to a detached spawn.
8
- def self.run(*cmd)
8
+ #
9
+ # dir: optional directory to cd into before running the command.
10
+ def self.run(*cmd, dir: nil)
9
11
  if inside_tmux?
10
12
  ensure_session
11
- system('tmux', 'new-window', '-d', '-t', "#{SESSION}:", '-n', cmd.first.to_s, cmd.shelljoin)
13
+ tmux_args = ['tmux', 'new-window', '-d', '-t', "#{SESSION}:", '-n', cmd.first.to_s]
14
+ tmux_args += ['-c', dir] if dir
15
+ system(*tmux_args, cmd.shelljoin)
12
16
  else
13
- Process.detach(spawn(*cmd))
17
+ spawn_opts = dir ? { chdir: dir } : {}
18
+ Process.detach(spawn(*cmd, **spawn_opts))
14
19
  end
15
20
  rescue
16
21
  nil
data/lib/hiiro/rbenv.rb CHANGED
@@ -69,12 +69,14 @@ 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
73
  def install_gem(gem_name, version: current_version, pre: false)
73
- pre_flag = pre ? ['--pre'] : []
74
+ source_flags = ['--clear-sources', '--source', 'https://rubygems.org']
75
+ pre_flag = pre ? ['--pre'] : []
74
76
  if gem_installed?(gem_name, version: version)
75
- run('gem', 'update', gem_name, *pre_flag, version: version)
77
+ run('gem', 'update', gem_name, *source_flags, *pre_flag, version: version)
76
78
  else
77
- run('gem', 'install', gem_name, *pre_flag, version: version)
79
+ run('gem', 'install', gem_name, *source_flags, *pre_flag, version: version)
78
80
  end
79
81
  end
80
82
 
data/lib/hiiro/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  class Hiiro
2
- VERSION = "0.1.315"
2
+ VERSION = "0.1.316"
3
3
  end
data/sa CHANGED
@@ -1 +1 @@
1
- /Users/josh/proj/hiiro/script/available
1
+ script/available
data/script/publish CHANGED
@@ -14,7 +14,7 @@ class RubyGems
14
14
  require "hiiro"
15
15
  [Hiiro::VERSION]
16
16
  end
17
- def self.cli_version = `gem search -r hiiro`.lines.map(&:strip).select{|ln| ln.match?(/\d\.\d/) }.first&.[](/(?:[(])\d[^)]+/)
17
+ def self.cli_version = `gem search -r hiiro`.lines.map(&:strip).select{|ln| ln.match?(/\d\.\d/) }.first&.[](/\d+\.\d+[^)]+/)
18
18
 
19
19
  def self.wait_for(gem_name, version, max_attempts: 40)
20
20
  attempts = 0
@@ -22,6 +22,7 @@ class RubyGems
22
22
  sleep(attempts == 0 ? 5 : 15)
23
23
  attempts += 1
24
24
  versions = published_versions(gem_name)
25
+ puts(latest_json_version: versions.first, cli_version: cli_version)
25
26
  return true if versions.include?(version) && cli_version && cli_version == version
26
27
  puts "Waiting for v#{version} on RubyGems (attempt #{attempts}/#{max_attempts})..."
27
28
  return false if attempts >= max_attempts
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.315
4
+ version: 0.1.316
5
5
  platform: ruby
6
6
  authors:
7
7
  - Joshua Toyota