js 2.7.0 → 2.7.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 +4 -4
- data/lib/js/require_remote/relative_shim.rb +15 -0
- data/lib/js/require_remote.rb +7 -1
- data/lib/js/version.rb +1 -1
- data/wit/js-runtime.wit +2 -2
- metadata +7 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: fd76b0bc0abaa8e05ee29b475ee7844cc7981fc3e0494647b6bc02a1097d7714
|
4
|
+
data.tar.gz: 2b954a3fb37e9c74d2ff4ac91d963d2e629e39cf7c8c76840a3744b8ab0a52b0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a678a2138b0efe7a2c43e2b2d89452ed94848dbce3cbd055fe63134c5c1f5ddc15c8b7ec7a5ccf1e6ed904a2b9222abf2afdde90e8d5ccddaa2c700f447c8e7c
|
7
|
+
data.tar.gz: 44deaff30831617fee58320d1ba978eb0b2726350d5c87e295475f231a6dd0038b4dbc9f9feb7c112da1abe97a95e634b8e07831f22adb1bd1536264aa5b793d
|
@@ -0,0 +1,15 @@
|
|
1
|
+
require 'js/require_remote'
|
2
|
+
|
3
|
+
module Kernel
|
4
|
+
alias original_require_relative require_relative
|
5
|
+
|
6
|
+
def require_relative(path)
|
7
|
+
caller_path = caller_locations(1, 1).first.absolute_path || ''
|
8
|
+
dir = File.dirname(caller_path)
|
9
|
+
file = File.absolute_path(path, dir)
|
10
|
+
|
11
|
+
original_require_relative(file)
|
12
|
+
rescue LoadError
|
13
|
+
JS::RequireRemote.instance.load(path)
|
14
|
+
end
|
15
|
+
end
|
data/lib/js/require_remote.rb
CHANGED
@@ -37,7 +37,13 @@ module JS
|
|
37
37
|
# rescue LoadError
|
38
38
|
# JS::RequireRemote.instance.load(path)
|
39
39
|
# end
|
40
|
-
#
|
40
|
+
# end
|
41
|
+
#
|
42
|
+
# You can also load included shim to achieve the same.
|
43
|
+
#
|
44
|
+
# == Example
|
45
|
+
#
|
46
|
+
# require 'js/require_remote/relative_shim'
|
41
47
|
#
|
42
48
|
class RequireRemote
|
43
49
|
include Singleton
|
data/lib/js/version.rb
CHANGED
data/wit/js-runtime.wit
CHANGED
@@ -14,7 +14,7 @@ interface js-runtime {
|
|
14
14
|
instance-of: func(value: borrow<js-abi-value>, klass: borrow<js-abi-value>) -> bool;
|
15
15
|
global-this: func() -> js-abi-value;
|
16
16
|
int-to-js-number: func(value: s32) -> js-abi-value;
|
17
|
-
float-to-js-number: func(value:
|
17
|
+
float-to-js-number: func(value: f64) -> js-abi-value;
|
18
18
|
string-to-js-string: func(value: string) -> js-abi-value;
|
19
19
|
bool-to-js-bool: func(value: bool) -> js-abi-value;
|
20
20
|
proc-to-js-function: func() -> js-abi-value;
|
@@ -23,7 +23,7 @@ interface js-runtime {
|
|
23
23
|
js-value-to-string: func(value: borrow<js-abi-value>) -> string;
|
24
24
|
|
25
25
|
variant raw-integer {
|
26
|
-
as-float(
|
26
|
+
as-float(f64),
|
27
27
|
bignum(string),
|
28
28
|
}
|
29
29
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: js
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.7.
|
4
|
+
version: 2.7.2
|
5
5
|
platform: ruby
|
6
|
-
original_platform: ''
|
7
6
|
authors:
|
8
7
|
- Yuta Saito
|
8
|
+
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2025-10-03 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: JavaScript bindings for ruby.wasm. This gem provides a way to use JavaScript
|
14
14
|
functionalities from Ruby through WebAssembly.
|
@@ -42,6 +42,7 @@ files:
|
|
42
42
|
- lib/js/nil_class.rb
|
43
43
|
- lib/js/require_remote.rb
|
44
44
|
- lib/js/require_remote/evaluator.rb
|
45
|
+
- lib/js/require_remote/relative_shim.rb
|
45
46
|
- lib/js/require_remote/url_resolver.rb
|
46
47
|
- lib/js/version.rb
|
47
48
|
- wit/js-runtime.wit
|
@@ -52,6 +53,7 @@ licenses:
|
|
52
53
|
- MIT
|
53
54
|
metadata:
|
54
55
|
source_code_uri: https://github.com/ruby/ruby.wasm/tree/main/packages/gems/js
|
56
|
+
post_install_message:
|
55
57
|
rdoc_options: []
|
56
58
|
require_paths:
|
57
59
|
- lib
|
@@ -66,7 +68,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
66
68
|
- !ruby/object:Gem::Version
|
67
69
|
version: '0'
|
68
70
|
requirements: []
|
69
|
-
rubygems_version: 3.
|
71
|
+
rubygems_version: 3.5.3
|
72
|
+
signing_key:
|
70
73
|
specification_version: 4
|
71
74
|
summary: JavaScript bindings for ruby.wasm
|
72
75
|
test_files: []
|