hiiro 0.1.308.pre.2 → 0.1.308.pre.3

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: 4585afb8d2689cc0d400701986ccae708929b8e554186181b8507f4502f6c91b
4
+ data.tar.gz: 5c8e9613d6d0e8f6b83885a71bd947e7ece57b3637d9a4fdf8be830f3ed99ccc
5
5
  SHA512:
6
- metadata.gz: f159eb57fac642d228e6e5fa9ab9d5d9d13fe0442150f333462c69100f345ce5c5175efc90da208e6febda0c0d5a3acd4e26cfd3b2a263e407d479af7e98a3d3
7
- data.tar.gz: 11e4b59102767d7052eaee3f0117dcf72beb0ff28c8aa8efe7f545cbe24f9352d99055909e5e8ceb3c68146b6b1cf32c47d25a468fc0c419f36ac24561f0d553
6
+ metadata.gz: f0376bbbbf2f82f6cef4e6a958f290f2ca204ea1605840d7fc0c69488882f34ac0e7a0b66382ef9f2c1b5f72d2ac21acd8e75496504babf8c530720ad60ad9fa
7
+ data.tar.gz: c2b00bcc066feb4cb7c8ed84a343d174a7b6f1c16cd96163294af3d3914027adc7cab3342b847e48926702bda2caaea622d4568ffc86c59e66881cf7670110a2
data/CHANGELOG.md CHANGED
@@ -1,6 +1,14 @@
1
1
  ```markdown
2
2
  # Changelog
3
3
 
4
+ ## [0.1.308.pre.3] - 2026-03-31
5
+
6
+ ### Changed
7
+ - Poll RubyGems in `delayed_update` instead of blind sleep for more reliable version detection
8
+
9
+ ### Fixed
10
+ - Per-row rescue in `import_todos` so one bad row doesn't abort the entire batch
11
+
4
12
  ## [0.1.308.pre.2] - 2026-03-31
5
13
 
6
14
  ### 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/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  class Hiiro
2
- VERSION = "0.1.308.pre.2"
2
+ VERSION = "0.1.308.pre.3"
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.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Joshua Toyota