homura-runtime 0.2.1 → 0.2.2

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: 89ab1ae8555f1631cf7e44af5aee8a1e760b21ae5538aa0b0616599669678eab
4
- data.tar.gz: 13142b82927699812b64df3d0637bab9ef721c7f0fbfd56be2746c80ced628f4
3
+ metadata.gz: ea45c6e9833a7fd1489e25d5a7fb7b27227542a0aaeb56ca975a86caff02db55
4
+ data.tar.gz: 8f79055ebb7c2340abae33e64dfac9fa8610c0917e58317f7e0e9a02718d89e7
5
5
  SHA512:
6
- metadata.gz: 700b065254ca17e682499d532a66a54266d6ae8580051661f6ac2cca0afa35e62631457262c3d38541f71b10ce4d2d64b128969d2bb68f38c737f86993311d30
7
- data.tar.gz: 3ca930aacfaff19ded023d6fd2e2b9ab71b6bc52344c6b34d4e11ccef435727b7ad3c6e99828a7406cc5bdbaec6e5e5f31c06835f294233999884fa73b3f8fae
6
+ metadata.gz: 0005f047fe200e3cf8743be898508420fc128d22ff0def9e0da35cac637e83218ec185e0512e5cc237593c951bc073d7de7a5bbb1af1f31d2238540be3fa25d9
7
+ data.tar.gz: 04444cea8eadfdcf6d0210667aef11730c3e67e3601e06f141f923761b2c395674560d899dcca5bc81284d10bcfa5d815d0722dad7e967d3e9bbc330649c58c1
data/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.2.2 (2026-04-23)
4
+
5
+ - Bump the exact `opal-homura` dependency to `1.8.3.rc1.1` so published gems pick up the corrected author metadata.
6
+ - Preserve async Sinatra responses that resolve to `[status, body]` or `[status, headers, body]`
7
+ so `# await: true` routes can still express `halt` / `redirect` outcomes after awaiting.
8
+
3
9
  ## 0.2.1 (2026-04-23)
4
10
 
5
11
  - Correct the published author metadata to "Kazuhiro Homma".
data/README.md CHANGED
@@ -14,7 +14,7 @@ Core Ruby + Module Worker glue for [Opal](https://opalrb.com/) on [Cloudflare Wo
14
14
 
15
15
  ## Quick start (homura monorepo)
16
16
 
17
- 1. `Gemfile`: `gem 'homura-runtime', path: 'gems/homura-runtime'` and `gem 'opal-homura', '= 1.8.3.rc1', require: 'opal'` (path or exact pin).
17
+ 1. `Gemfile`: `gem 'homura-runtime', path: 'gems/homura-runtime'` and `gem 'opal-homura', '= 1.8.3.rc1.1', require: 'opal'` (path or exact pin).
18
18
  2. `bundle exec homura build` — writes `build/hello.no-exit.mjs` and `build/worker.entrypoint.mjs`.
19
19
  3. `wrangler.toml`: `main = "build/worker.entrypoint.mjs"`, `compatibility_flags = ["nodejs_compat"]`.
20
20
 
@@ -25,7 +25,7 @@ Core Ruby + Module Worker glue for [Opal](https://opalrb.com/) on [Cloudflare Wo
25
25
  | Ruby | 3.4.x |
26
26
  | Node | ≥ 20 |
27
27
  | Wrangler | ^3.99 |
28
- | Opal | = 1.8.3.rc1 |
28
+ | Opal | = 1.8.3.rc1.1 |
29
29
 
30
30
  ## Wrangler config
31
31
 
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module CloudflareWorkers
4
- VERSION = '0.2.1'
4
+ VERSION = '0.2.2'
5
5
  end
@@ -397,7 +397,7 @@ module Rack
397
397
  # used for 101 WebSocket upgrades where the Workers
398
398
  # runtime's own Response carries runtime-only properties
399
399
  # (`.webSocket`) that a reconstructed Response would lose.
400
- `Promise.all(#{js_chunks}).then(function(resolved) { for (var i = 0; i < resolved.length; i++) { var r = resolved[i]; if (r != null && typeof r === 'object' && typeof r['$raw_response?'] === 'function' && typeof r['$js_response'] === 'function') { try { if (r['$raw_response?']()) { return r['$js_response'](); } } catch (_) {} } } for (var i = 0; i < resolved.length; i++) { var r = resolved[i]; if (r != null && r.stream != null && r.content_type != null) { var bh = {}; bh['content-type'] = r.content_type; if (r.cache_control) bh['cache-control'] = r.cache_control; return new Response(r.stream, { status: #{status_int}, headers: bh }); } } if (resolved.length === 1 && resolved[0] != null && Array.isArray(resolved[0]) && resolved[0].length === 2 && typeof resolved[0][0] === 'number') { var ov = resolved[0]; var ovs = ov[0]|0; var ovb = ov[1] == null ? '' : (typeof ov[1] === 'string' ? ov[1] : (ov[1].$$is_string ? ov[1].toString() : String(ov[1]))); return new Response(ovb, { status: ovs, headers: #{js_headers} }); } var parts = []; for (var i = 0; i < resolved.length; i++) { var r = resolved[i]; if (r == null) { parts.push(''); continue; } if (typeof r === 'string') { parts.push(r); continue; } if (r != null && r.$$is_string) { parts.push(r.toString()); continue; } try { parts.push(JSON.stringify(r)); } catch (e) { parts.push(String(r)); } } return new Response(parts.join(''), { status: #{status_int}, headers: #{js_headers} }); })`
400
+ `Promise.all(#{js_chunks}).then(function(resolved) { var bodyToText = function(v) { if (v == null) { return ''; } if (Array.isArray(v)) { var joined = ''; for (var j = 0; j < v.length; j++) { joined += bodyToText(v[j]); } return joined; } if (typeof v === 'string') { return v; } if (v != null && v.$$is_string) { return v.toString(); } try { return JSON.stringify(v); } catch (e) { return String(v); } }; for (var i = 0; i < resolved.length; i++) { var r = resolved[i]; if (r != null && typeof r === 'object' && typeof r['$raw_response?'] === 'function' && typeof r['$js_response'] === 'function') { try { if (r['$raw_response?']()) { return r['$js_response'](); } } catch (_) {} } } for (var i = 0; i < resolved.length; i++) { var r = resolved[i]; if (r != null && r.stream != null && r.content_type != null) { var bh = {}; bh['content-type'] = r.content_type; if (r.cache_control) bh['cache-control'] = r.cache_control; return new Response(r.stream, { status: #{status_int}, headers: bh }); } } if (resolved.length === 1 && resolved[0] != null && Array.isArray(resolved[0]) && resolved[0].length >= 1 && typeof resolved[0][0] === 'number') { var ov = resolved[0]; var ovs = ov[0]|0; var ovh = #{js_headers}; var ovb = ''; if (ov.length >= 3 && ov[1] != null && typeof ov[1] === 'object' && !Array.isArray(ov[1])) { ovh = {}; var keys = Object.keys(ov[1]); for (var k = 0; k < keys.length; k++) { var key = keys[k]; ovh[key] = String(ov[1][key]); } ovb = bodyToText(ov[2]); } else if (ov.length >= 2) { ovb = bodyToText(ov[ov.length - 1]); } return new Response(ovb, { status: ovs, headers: ovh }); } var parts = []; for (var i = 0; i < resolved.length; i++) { var r = resolved[i]; if (r == null) { parts.push(''); continue; } if (typeof r === 'string') { parts.push(r); continue; } if (r != null && r.$$is_string) { parts.push(r.toString()); continue; } try { parts.push(JSON.stringify(r)); } catch (e) { parts.push(String(r)); } } return new Response(parts.join(''), { status: #{status_int}, headers: #{js_headers} }); })`
401
401
  else
402
402
  body_str = ''
403
403
  chunks.each { |c| body_str = body_str + c.to_s }
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: homura-runtime
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.1
4
+ version: 0.2.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Kazuhiro Homma
@@ -15,14 +15,14 @@ dependencies:
15
15
  requirements:
16
16
  - - '='
17
17
  - !ruby/object:Gem::Version
18
- version: 1.8.3.rc1
18
+ version: 1.8.3.rc1.1
19
19
  type: :runtime
20
20
  prerelease: false
21
21
  version_requirements: !ruby/object:Gem::Requirement
22
22
  requirements:
23
23
  - - '='
24
24
  - !ruby/object:Gem::Version
25
- version: 1.8.3.rc1
25
+ version: 1.8.3.rc1.1
26
26
  - !ruby/object:Gem::Dependency
27
27
  name: parser
28
28
  requirement: !ruby/object:Gem::Requirement