wasmrb 0.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/lib/wasm.rb +26 -0
- metadata +44 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: 77136f169e60b7d3b320da909306980574e7217a
|
4
|
+
data.tar.gz: 909f3db909ef74e02693b9b166a11f31f55065b8
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: b9f731c9ed00af04a707a9748d928459a41d14dbd04b2eb66d9f619fdb72d13d9ce769081efa5a252517551e1fe1bd0a997e2c355c8bd6beb65b7383761cdcfa
|
7
|
+
data.tar.gz: 80095168ed9508b2f9a52dedb9106a195e6ea3dc6aa4450d38adef670a77b4d9f68bd0b0167f1f5d76fd8f3498bc4eb0dca2121e58bce6d6f478df816b044b2e
|
data/lib/wasm.rb
ADDED
@@ -0,0 +1,26 @@
|
|
1
|
+
require_relative "wasm/core/module.rb"
|
2
|
+
require_relative "wasm/loader/wasmloader.rb"
|
3
|
+
require_relative "wasm/serializer/wasmserializer.rb"
|
4
|
+
|
5
|
+
module WebAssembly
|
6
|
+
GlobalValue = Context::Global
|
7
|
+
|
8
|
+
def self.load filename
|
9
|
+
loader = WASMLoader.new
|
10
|
+
loader.load filename
|
11
|
+
end
|
12
|
+
|
13
|
+
def self.instantiate filename, import_obj=nil
|
14
|
+
mod = self.load filename
|
15
|
+
mod.instantiate import_obj
|
16
|
+
end
|
17
|
+
|
18
|
+
def self.serialize mod, filename=nil
|
19
|
+
serializer = WASMSerializer.new
|
20
|
+
bytes = serializer.serialize mod
|
21
|
+
unless filename.nil?
|
22
|
+
File.binwrite filename, bytes.pack("C*")
|
23
|
+
end
|
24
|
+
bytes
|
25
|
+
end
|
26
|
+
end
|
metadata
ADDED
@@ -0,0 +1,44 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: wasmrb
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.0.1
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- ANDO Yasushi
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
date: 2021-04-13 00:00:00.000000000 Z
|
12
|
+
dependencies: []
|
13
|
+
description: Read and Run WebAssembly
|
14
|
+
email: andyjpn@gmail.com
|
15
|
+
executables: []
|
16
|
+
extensions: []
|
17
|
+
extra_rdoc_files: []
|
18
|
+
files:
|
19
|
+
- lib/wasm.rb
|
20
|
+
homepage: https://github.com/technohippy/wasmrb
|
21
|
+
licenses:
|
22
|
+
- MIT
|
23
|
+
metadata: {}
|
24
|
+
post_install_message:
|
25
|
+
rdoc_options: []
|
26
|
+
require_paths:
|
27
|
+
- lib
|
28
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
29
|
+
requirements:
|
30
|
+
- - ">="
|
31
|
+
- !ruby/object:Gem::Version
|
32
|
+
version: '0'
|
33
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
34
|
+
requirements:
|
35
|
+
- - ">="
|
36
|
+
- !ruby/object:Gem::Version
|
37
|
+
version: '0'
|
38
|
+
requirements: []
|
39
|
+
rubyforge_project:
|
40
|
+
rubygems_version: 2.5.2.3
|
41
|
+
signing_key:
|
42
|
+
specification_version: 4
|
43
|
+
summary: WASM Runner
|
44
|
+
test_files: []
|