hiiro 0.1.308.pre.2 → 0.1.308.pre.4

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: 5908ae11780b1bb36df988cc84a6246a0fd6baf0a62491990d8a3603b0a10b93
4
- data.tar.gz: afb4b4b786c1cd4e41a8c09c082cfa2f7aba9ee20f8fed33cc4292202c7a4fe0
3
+ metadata.gz: eec58fcede9b3992330237829b806f76a39481088825fd02fcac6e571635f6fd
4
+ data.tar.gz: 591c2f2b89abcf7e05b62fd62b08796e7d979388bbcb438a7548066b3c326fa6
5
5
  SHA512:
6
- metadata.gz: f159eb57fac642d228e6e5fa9ab9d5d9d13fe0442150f333462c69100f345ce5c5175efc90da208e6febda0c0d5a3acd4e26cfd3b2a263e407d479af7e98a3d3
7
- data.tar.gz: 11e4b59102767d7052eaee3f0117dcf72beb0ff28c8aa8efe7f545cbe24f9352d99055909e5e8ceb3c68146b6b1cf32c47d25a468fc0c419f36ac24561f0d553
6
+ metadata.gz: a09d91028a2dd3c433724d313f23ed01872f37aebb4455c5831e9c8ee62d41630b45be8e0c80b58044b3b69e15733506c9fd05cb5302fa088a6b4b805982f3bc
7
+ data.tar.gz: 6dc66c2ac63376ef8e86064141811a697b56548f4d9d38112270c71adfa5fcb0705c0b162634db21cb29662e95d5f507dd82d02803d46874f3fb3644cd801a47
data/CHANGELOG.md CHANGED
@@ -1,6 +1,19 @@
1
1
  ```markdown
2
2
  # Changelog
3
3
 
4
+ ## [0.1.308.pre.4] - 2026-03-31
5
+
6
+ ### Fixed
7
+ - Don't pass empty string arg to gem when `--pre` is false
8
+
9
+ ## [0.1.308.pre.3] - 2026-03-31
10
+
11
+ ### Changed
12
+ - Poll RubyGems in `delayed_update` instead of blind sleep for more reliable version detection
13
+
14
+ ### Fixed
15
+ - Per-row rescue in `import_todos` so one bad row doesn't abort the entire batch
16
+
4
17
  ## [0.1.308.pre.2] - 2026-03-31
5
18
 
6
19
  ### Added
data/exe/h CHANGED
@@ -196,9 +196,43 @@ Hiiro.run(*ARGV, cwd: Dir.pwd, tasks: true) do
196
196
 
197
197
  script = <<~RUBY
198
198
  #!/usr/bin/env ruby
199
+ require 'net/http'
200
+ require 'json'
201
+
199
202
  expected = #{expected.inspect}
200
- sleep 15
201
- system('h', 'update', '-a')
203
+ is_pre = expected.include?('.pre.')
204
+
205
+ # Poll RubyGems until the expected version appears (up to ~10 min)
206
+ found = false
207
+ attempts = 0
208
+ max = 40
209
+
210
+ until found || attempts >= max
211
+ sleep(attempts == 0 ? 5 : 15)
212
+ attempts += 1
213
+ begin
214
+ uri = URI('https://rubygems.org/api/v1/versions/hiiro.json')
215
+ versions = JSON.parse(Net::HTTP.get(uri)).map { |v| v['number'] }
216
+ if versions.include?(expected)
217
+ found = true
218
+ puts "v\#{expected} found on RubyGems after \#{attempts} poll(s). Installing..."
219
+ else
220
+ puts "Waiting for v\#{expected} on RubyGems (attempt \#{attempts}/\#{max})..."
221
+ end
222
+ rescue => e
223
+ puts "RubyGems poll error: \#{e.message}"
224
+ end
225
+ end
226
+
227
+ unless found
228
+ system('say', 'hiiro publish timed out')
229
+ exit 1
230
+ end
231
+
232
+ install_args = ['update', '-a']
233
+ install_args << '--pre' if is_pre
234
+ system('h', *install_args)
235
+
202
236
  versions = `rbenv versions --bare`.lines(chomp: true)
203
237
  mismatched = versions.reject do |ver|
204
238
  output = `RBENV_VERSION=\#{ver} rbenv exec gem list hiiro --exact 2>/dev/null`
data/lib/hiiro/db.rb CHANGED
@@ -155,7 +155,9 @@ class Hiiro
155
155
  'updated_at' => r['updated_at']&.to_s,
156
156
  }.compact
157
157
  record['id'] = r['id'].to_i if r['id']
158
- connection[:todos].insert(record)
158
+ connection[:todos].insert_conflict.insert(record)
159
+ rescue => e
160
+ warn "Hiiro::DB: skipping todo row (#{e.class}: #{e.message.lines.first&.strip})"
159
161
  end
160
162
  bak(path)
161
163
  rescue => e
data/lib/hiiro/rbenv.rb CHANGED
@@ -70,10 +70,11 @@ class Hiiro
70
70
 
71
71
  # Install or update a gem in the given version.
72
72
  def install_gem(gem_name, version: current_version, pre: false)
73
+ pre_flag = pre ? ['--pre'] : []
73
74
  if gem_installed?(gem_name, version: version)
74
- run('gem', 'update', gem_name, pre ? '--pre' : '', version: version)
75
+ run('gem', 'update', gem_name, *pre_flag, version: version)
75
76
  else
76
- run('gem', 'install', gem_name, pre ? '--pre' : '', version: version)
77
+ run('gem', 'install', gem_name, *pre_flag, version: version)
77
78
  end
78
79
  end
79
80
 
data/lib/hiiro/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  class Hiiro
2
- VERSION = "0.1.308.pre.2"
2
+ VERSION = "0.1.308.pre.4"
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.308.pre.2
4
+ version: 0.1.308.pre.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Joshua Toyota