ruby_wasm 2.8.1-x86_64-linux → 2.9.0-x86_64-linux
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 +4 -4
- data/Gemfile +1 -0
- data/README.md +7 -7
- data/docs/cheat_sheet.md +8 -8
- data/docs/faq.md +2 -2
- data/lib/ruby_wasm/3.2/ruby_wasm.so +0 -0
- data/lib/ruby_wasm/3.3/ruby_wasm.so +0 -0
- data/lib/ruby_wasm/3.4/ruby_wasm.so +0 -0
- data/lib/ruby_wasm/build/product/crossruby.rb +7 -0
- data/lib/ruby_wasm/version.rb +1 -1
- data/package-lock.json +15 -13
- data/sig/ruby_wasm/build.rbs +1 -0
- metadata +4 -3
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: d7eb98187556c59db4ee513727126b7c3da415ebca81f796019d2c60fb6fd59f
|
|
4
|
+
data.tar.gz: 1500e3f933cab88615b88e8bf3063dcaa8508092406cdd6402d7e962aebb2e87
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 93f6f95b4d79554438c99975927c269de85fbe93f7169087d1fc506814e46e056ac70106091dfc12566c33887d6ffd33139ee2c024c194a23ca0baa2f4dcab9c
|
|
7
|
+
data.tar.gz: b243611557df05f6504ff427801cfe4fa185bfb42d715b2951ac292795e0c7b768d39394e72702e5c76dad77bdd81ba036de7ef941f2727471cba5a2e7ea38fb
|
data/Gemfile
CHANGED
data/README.md
CHANGED
|
@@ -2,12 +2,12 @@
|
|
|
2
2
|
|
|
3
3
|
[](https://github.com/ruby/ruby.wasm/actions/workflows/build.yml)
|
|
4
4
|
|
|
5
|
-
ruby.wasm is a collection of WebAssembly ports of
|
|
6
|
-
It enables running Ruby
|
|
5
|
+
ruby.wasm is a collection of WebAssembly ports of [CRuby](https://github.com/ruby/ruby).
|
|
6
|
+
It enables running Ruby applications in browsers, WASI compatible WebAssembly runtimes, and Edge Computing platforms.
|
|
7
7
|
|
|
8
8
|
## Try ruby.wasm (no installation needed)
|
|
9
9
|
|
|
10
|
-
Try ruby.wasm
|
|
10
|
+
Try ruby.wasm on [TryRuby](https://try.ruby-lang.org/playground#code=puts+RUBY_DESCRIPTION&engine=cruby-3.2.0dev) in your browser.
|
|
11
11
|
|
|
12
12
|
## Quick Links
|
|
13
13
|
|
|
@@ -17,13 +17,13 @@ Try ruby.wasm in [TryRuby](https://try.ruby-lang.org/playground#code=puts+RUBY_D
|
|
|
17
17
|
- [Complete Examples](https://github.com/ruby/ruby.wasm/tree/main/packages/npm-packages/ruby-wasm-wasi/example)
|
|
18
18
|
- [Community Showcase](https://github.com/ruby/ruby.wasm/wiki/Showcase)
|
|
19
19
|
|
|
20
|
-
## Quick Example: Ruby
|
|
20
|
+
## Quick Example: Ruby in a Web browser
|
|
21
21
|
|
|
22
|
-
Create and save `index.html` page with the following contents:
|
|
22
|
+
Create and save an `index.html` page with the following contents:
|
|
23
23
|
|
|
24
24
|
```html
|
|
25
25
|
<html>
|
|
26
|
-
<script src="https://cdn.jsdelivr.net/npm/@ruby/4.0-wasm-wasi@2.
|
|
26
|
+
<script src="https://cdn.jsdelivr.net/npm/@ruby/4.0-wasm-wasi@2.9.0/dist/browser.script.iife.js"></script>
|
|
27
27
|
<script type="text/ruby">
|
|
28
28
|
require "js"
|
|
29
29
|
|
|
@@ -155,7 +155,7 @@ A _build_ is a combination of ruby version, _profile_, and _target_.
|
|
|
155
155
|
|
|
156
156
|
The current WASI target build does not yet support `Thread` related APIs. Specifically, WASI does not yet have an API for creating and managing threads yet.
|
|
157
157
|
|
|
158
|
-
Also there is no support for networking. It is one of the
|
|
158
|
+
Also there is no support for networking. It is one of the goals of WASI to support networking in the future, but it is not yet implemented.
|
|
159
159
|
|
|
160
160
|
|
|
161
161
|
## Contributing
|
data/docs/cheat_sheet.md
CHANGED
|
@@ -38,7 +38,7 @@ The easiest way to run Ruby on browser is to use `browser.script.iife.js` script
|
|
|
38
38
|
|
|
39
39
|
```html
|
|
40
40
|
<html>
|
|
41
|
-
<script src="https://cdn.jsdelivr.net/npm/@ruby/4.0-wasm-wasi@2.
|
|
41
|
+
<script src="https://cdn.jsdelivr.net/npm/@ruby/4.0-wasm-wasi@2.9.0/dist/browser.script.iife.js"></script>
|
|
42
42
|
<script type="text/ruby">
|
|
43
43
|
require "js"
|
|
44
44
|
JS.global[:document].write "Hello, world!"
|
|
@@ -51,8 +51,8 @@ If you want to control Ruby VM from JavaScript, you can use `@ruby/wasm-wasi` pa
|
|
|
51
51
|
```html
|
|
52
52
|
<html>
|
|
53
53
|
<script type="module">
|
|
54
|
-
import { DefaultRubyVM } from "https://cdn.jsdelivr.net/npm/@ruby/wasm-wasi@2.
|
|
55
|
-
const response = await fetch("https://cdn.jsdelivr.net/npm/@ruby/4.0-wasm-wasi@2.
|
|
54
|
+
import { DefaultRubyVM } from "https://cdn.jsdelivr.net/npm/@ruby/wasm-wasi@2.9.0/dist/browser/+esm";
|
|
55
|
+
const response = await fetch("https://cdn.jsdelivr.net/npm/@ruby/4.0-wasm-wasi@2.9.0/dist/ruby+stdlib.wasm");
|
|
56
56
|
const module = await WebAssembly.compileStreaming(response);
|
|
57
57
|
const { vm } = await DefaultRubyVM(module);
|
|
58
58
|
|
|
@@ -69,11 +69,11 @@ If you want to control Ruby VM from JavaScript, you can use `@ruby/wasm-wasi` pa
|
|
|
69
69
|
|
|
70
70
|
```html
|
|
71
71
|
<html>
|
|
72
|
-
<script src="https://cdn.jsdelivr.net/npm/@ruby/wasm-wasi@2.
|
|
72
|
+
<script src="https://cdn.jsdelivr.net/npm/@ruby/wasm-wasi@2.9.0/dist/browser.umd.js"></script>
|
|
73
73
|
<script>
|
|
74
74
|
const main = async () => {
|
|
75
75
|
const { DefaultRubyVM } = window["ruby-wasm-wasi"];
|
|
76
|
-
const response = await fetch("https://cdn.jsdelivr.net/npm/@ruby/4.0-wasm-wasi@2.
|
|
76
|
+
const response = await fetch("https://cdn.jsdelivr.net/npm/@ruby/4.0-wasm-wasi@2.9.0/dist/ruby+stdlib.wasm");
|
|
77
77
|
const module = await WebAssembly.compileStreaming(response);
|
|
78
78
|
const { vm } = await DefaultRubyVM(module);
|
|
79
79
|
|
|
@@ -128,7 +128,7 @@ end
|
|
|
128
128
|
|
|
129
129
|
```html
|
|
130
130
|
<html>
|
|
131
|
-
<script src="https://cdn.jsdelivr.net/npm/@ruby/4.0-wasm-wasi@2.
|
|
131
|
+
<script src="https://cdn.jsdelivr.net/npm/@ruby/4.0-wasm-wasi@2.9.0/dist/browser.script.iife.js"></script>
|
|
132
132
|
<script type="text/ruby" data-eval="async">
|
|
133
133
|
require "js"
|
|
134
134
|
|
|
@@ -143,8 +143,8 @@ Or using `@ruby/wasm-wasi` package API `RubyVM#evalAsync`:
|
|
|
143
143
|
```html
|
|
144
144
|
<html>
|
|
145
145
|
<script type="module">
|
|
146
|
-
import { DefaultRubyVM } from "https://cdn.jsdelivr.net/npm/@ruby/wasm-wasi@2.
|
|
147
|
-
const response = await fetch("https://cdn.jsdelivr.net/npm/@ruby/4.0-wasm-wasi@2.
|
|
146
|
+
import { DefaultRubyVM } from "https://cdn.jsdelivr.net/npm/@ruby/wasm-wasi@2.9.0/dist/browser/+esm";
|
|
147
|
+
const response = await fetch("https://cdn.jsdelivr.net/npm/@ruby/4.0-wasm-wasi@2.9.0/dist/ruby+stdlib.wasm");
|
|
148
148
|
const module = await WebAssembly.compileStreaming(response);
|
|
149
149
|
const { vm } = await DefaultRubyVM(module);
|
|
150
150
|
|
data/docs/faq.md
CHANGED
|
@@ -6,9 +6,9 @@
|
|
|
6
6
|
|
|
7
7
|
# FAQ
|
|
8
8
|
|
|
9
|
-
## Where my `puts` output
|
|
9
|
+
## Where does my `puts` output go?
|
|
10
10
|
|
|
11
|
-
By default, `puts` output goes to `STDOUT` which is a JavaScript `console.log` function. You can override it by setting `$stdout` to a Ruby object which has `write` method.
|
|
11
|
+
By default, `puts` output goes to `STDOUT` which is a JavaScript `console.log` function. You can override it by setting `$stdout` to a Ruby object which has a `write` method.
|
|
12
12
|
|
|
13
13
|
```ruby
|
|
14
14
|
$stdout = Object.new.tap do |obj|
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -322,6 +322,10 @@ module RubyWasm
|
|
|
322
322
|
File.join(@baseruby.install_dir, "bin/ruby")
|
|
323
323
|
end
|
|
324
324
|
|
|
325
|
+
def dump_ast_path
|
|
326
|
+
File.join(@baseruby.product_build_dir, "dump_ast")
|
|
327
|
+
end
|
|
328
|
+
|
|
325
329
|
def configure_args(build_triple, toolchain)
|
|
326
330
|
target = @params.target.triple
|
|
327
331
|
default_exts = @params.default_exts
|
|
@@ -336,6 +340,9 @@ module RubyWasm
|
|
|
336
340
|
args << %Q(--with-zlib-dir=#{@zlib.install_root})
|
|
337
341
|
args << %Q(--with-openssl-dir=#{@openssl.install_root}) if @openssl
|
|
338
342
|
args << %Q(--with-baseruby=#{baseruby_path})
|
|
343
|
+
# Use the host-built dump_ast so cross builds don't try to execute the
|
|
344
|
+
# target-side wasm dump_ast while generating .rbinc files.
|
|
345
|
+
args << %Q(--with-dump-ast=#{dump_ast_path})
|
|
339
346
|
|
|
340
347
|
case target
|
|
341
348
|
when /^wasm32-unknown-wasi/
|
data/lib/ruby_wasm/version.rb
CHANGED
data/package-lock.json
CHANGED
|
@@ -17,6 +17,12 @@
|
|
|
17
17
|
"typedoc": "^0.28.8"
|
|
18
18
|
}
|
|
19
19
|
},
|
|
20
|
+
"node_modules/@bjorn3/browser_wasi_shim": {
|
|
21
|
+
"version": "0.4.2",
|
|
22
|
+
"resolved": "https://registry.npmjs.org/@bjorn3/browser_wasi_shim/-/browser_wasi_shim-0.4.2.tgz",
|
|
23
|
+
"integrity": "sha512-/iHkCVUG3VbcbmEHn5iIUpIrh7a7WPiwZ3sHy4HZKZzBdSadwdddYDZAII2zBvQYV0Lfi8naZngPCN7WPHI/hA==",
|
|
24
|
+
"license": "MIT OR Apache-2.0"
|
|
25
|
+
},
|
|
20
26
|
"node_modules/@bytecodealliance/componentize-js": {
|
|
21
27
|
"version": "0.14.0",
|
|
22
28
|
"resolved": "https://registry.npmjs.org/@bytecodealliance/componentize-js/-/componentize-js-0.14.0.tgz",
|
|
@@ -3580,7 +3586,7 @@
|
|
|
3580
3586
|
},
|
|
3581
3587
|
"packages/npm-packages/ruby-3.2-wasm-wasi": {
|
|
3582
3588
|
"name": "@ruby/3.2-wasm-wasi",
|
|
3583
|
-
"version": "2.
|
|
3589
|
+
"version": "2.9.0",
|
|
3584
3590
|
"license": "MIT",
|
|
3585
3591
|
"dependencies": {
|
|
3586
3592
|
"@ruby/wasm-wasi": "^2.0.0"
|
|
@@ -3588,7 +3594,7 @@
|
|
|
3588
3594
|
},
|
|
3589
3595
|
"packages/npm-packages/ruby-3.3-wasm-wasi": {
|
|
3590
3596
|
"name": "@ruby/3.3-wasm-wasi",
|
|
3591
|
-
"version": "2.
|
|
3597
|
+
"version": "2.9.0",
|
|
3592
3598
|
"license": "MIT",
|
|
3593
3599
|
"dependencies": {
|
|
3594
3600
|
"@ruby/wasm-wasi": "^2.0.0"
|
|
@@ -3596,7 +3602,7 @@
|
|
|
3596
3602
|
},
|
|
3597
3603
|
"packages/npm-packages/ruby-3.4-wasm-wasi": {
|
|
3598
3604
|
"name": "@ruby/3.4-wasm-wasi",
|
|
3599
|
-
"version": "2.
|
|
3605
|
+
"version": "2.9.0",
|
|
3600
3606
|
"license": "MIT",
|
|
3601
3607
|
"dependencies": {
|
|
3602
3608
|
"@ruby/wasm-wasi": "^2.0.0"
|
|
@@ -3604,7 +3610,7 @@
|
|
|
3604
3610
|
},
|
|
3605
3611
|
"packages/npm-packages/ruby-4.0-wasm-wasi": {
|
|
3606
3612
|
"name": "@ruby/4.0-wasm-wasi",
|
|
3607
|
-
"version": "2.
|
|
3613
|
+
"version": "2.9.0",
|
|
3608
3614
|
"license": "MIT",
|
|
3609
3615
|
"dependencies": {
|
|
3610
3616
|
"@ruby/wasm-wasi": "^2.0.0"
|
|
@@ -3612,12 +3618,12 @@
|
|
|
3612
3618
|
},
|
|
3613
3619
|
"packages/npm-packages/ruby-head-wasm-emscripten": {
|
|
3614
3620
|
"name": "@ruby/head-wasm-emscripten",
|
|
3615
|
-
"version": "2.
|
|
3621
|
+
"version": "2.9.0",
|
|
3616
3622
|
"license": "MIT"
|
|
3617
3623
|
},
|
|
3618
3624
|
"packages/npm-packages/ruby-head-wasm-wasi": {
|
|
3619
3625
|
"name": "@ruby/head-wasm-wasi",
|
|
3620
|
-
"version": "2.
|
|
3626
|
+
"version": "2.9.0",
|
|
3621
3627
|
"license": "MIT",
|
|
3622
3628
|
"dependencies": {
|
|
3623
3629
|
"@ruby/wasm-wasi": "^2.0.0"
|
|
@@ -3625,7 +3631,7 @@
|
|
|
3625
3631
|
},
|
|
3626
3632
|
"packages/npm-packages/ruby-head-wasm-wasip2": {
|
|
3627
3633
|
"name": "@ruby/head-wasm-wasip2",
|
|
3628
|
-
"version": "2.
|
|
3634
|
+
"version": "2.9.0",
|
|
3629
3635
|
"license": "MIT",
|
|
3630
3636
|
"dependencies": {
|
|
3631
3637
|
"@bytecodealliance/preview2-shim": "^0.17.2",
|
|
@@ -3642,10 +3648,10 @@
|
|
|
3642
3648
|
},
|
|
3643
3649
|
"packages/npm-packages/ruby-wasm-wasi": {
|
|
3644
3650
|
"name": "@ruby/wasm-wasi",
|
|
3645
|
-
"version": "2.
|
|
3651
|
+
"version": "2.9.0",
|
|
3646
3652
|
"license": "MIT",
|
|
3647
3653
|
"dependencies": {
|
|
3648
|
-
"@bjorn3/browser_wasi_shim": "^0.
|
|
3654
|
+
"@bjorn3/browser_wasi_shim": "^0.4.2",
|
|
3649
3655
|
"tslib": "^2.8.1"
|
|
3650
3656
|
},
|
|
3651
3657
|
"devDependencies": {
|
|
@@ -3657,10 +3663,6 @@
|
|
|
3657
3663
|
"vitest": "^3.2.4"
|
|
3658
3664
|
}
|
|
3659
3665
|
},
|
|
3660
|
-
"packages/npm-packages/ruby-wasm-wasi/node_modules/@bjorn3/browser_wasi_shim": {
|
|
3661
|
-
"version": "0.3.0",
|
|
3662
|
-
"license": "MIT OR Apache-2.0"
|
|
3663
|
-
},
|
|
3664
3666
|
"packages/npm-packages/ruby-wasm-wasi/node_modules/@bytecodealliance/jco": {
|
|
3665
3667
|
"version": "1.8.1",
|
|
3666
3668
|
"resolved": "https://registry.npmjs.org/@bytecodealliance/jco/-/jco-1.8.1.tgz",
|
data/sig/ruby_wasm/build.rbs
CHANGED
|
@@ -218,6 +218,7 @@ module RubyWasm
|
|
|
218
218
|
def extinit_obj: -> String
|
|
219
219
|
def extinit_c_erb: -> String
|
|
220
220
|
def baseruby_path: -> String
|
|
221
|
+
def dump_ast_path: -> String
|
|
221
222
|
def configure_args: (String build_triple, Toolchain toolchain) -> Array[String]
|
|
222
223
|
def rbconfig_rb: -> String?
|
|
223
224
|
end
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: ruby_wasm
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 2.
|
|
4
|
+
version: 2.9.0
|
|
5
5
|
platform: x86_64-linux
|
|
6
6
|
authors:
|
|
7
7
|
- Yuta Saito
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: exe
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date:
|
|
11
|
+
date: 2026-03-29 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: logger
|
|
@@ -48,6 +48,7 @@ files:
|
|
|
48
48
|
- exe/rbwasm
|
|
49
49
|
- ext/ruby_wasm/README.md
|
|
50
50
|
- lib/ruby_wasm.rb
|
|
51
|
+
- lib/ruby_wasm/3.2/ruby_wasm.so
|
|
51
52
|
- lib/ruby_wasm/3.3/ruby_wasm.so
|
|
52
53
|
- lib/ruby_wasm/3.4/ruby_wasm.so
|
|
53
54
|
- lib/ruby_wasm/build.rb
|
|
@@ -109,7 +110,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
|
109
110
|
requirements:
|
|
110
111
|
- - ">="
|
|
111
112
|
- !ruby/object:Gem::Version
|
|
112
|
-
version: '3.
|
|
113
|
+
version: '3.2'
|
|
113
114
|
- - "<"
|
|
114
115
|
- !ruby/object:Gem::Version
|
|
115
116
|
version: 3.5.dev
|