opal-webassembly 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.gitignore +14 -0
- data/.rspec +3 -0
- data/.rspec-opal +3 -0
- data/.travis.yml +6 -0
- data/Gemfile +25 -0
- data/LICENSE.adoc +31 -0
- data/LICENSE.txt +21 -0
- data/README.adoc +45 -0
- data/Rakefile +13 -0
- data/bin/console +14 -0
- data/bin/opal-repl-wasm +4 -0
- data/bin/setup +8 -0
- data/examples/experiment/Makefile +2 -0
- data/examples/experiment/experiment-wasm.c +74 -0
- data/examples/experiment/experiment-wasm.wasm +0 -0
- data/examples/experiment/experiment.rb +25 -0
- data/examples/experiment/experiment.sh +2 -0
- data/examples/onigmo/onigmo-wasm.wasm +0 -0
- data/examples/onigmo/onigmo.rb +4 -0
- data/examples/onigmo/onigmo.sh +2 -0
- data/examples/simple_ffi/Rakefile +14 -0
- data/examples/simple_ffi/simple-wasm.wasm +0 -0
- data/examples/simple_ffi/simple-wasm.wat +8 -0
- data/examples/simple_ffi/simple.rb +14 -0
- data/exe/opal-repl-wasm +9 -0
- data/lib/opal/webassembly.rb +9 -0
- data/lib/opal/webassembly/processor.rb +49 -0
- data/lib/opal/webassembly/version.rb +5 -0
- data/opal-webassembly.gemspec +31 -0
- data/opal/ffi.rb +22 -0
- data/opal/ffi/library.rb +67 -0
- data/opal/ffi/pointer.rb +289 -0
- data/opal/ffi/struct.rb +125 -0
- data/opal/ffi/types.rb +226 -0
- data/opal/webassembly.rb +68 -0
- data/opal/webassembly/global.rb +15 -0
- data/opal/webassembly/instance.rb +44 -0
- data/opal/webassembly/memory.rb +18 -0
- data/opal/webassembly/module.rb +10 -0
- data/opal/webassembly/table.rb +35 -0
- data/spec-opal/ffi_spec.rb +139 -0
- data/spec-opal/spec_helper.rb +18 -0
- data/spec-opal/webassembly_spec.rb +12 -0
- metadata +104 -0
@@ -0,0 +1,18 @@
|
|
1
|
+
require 'webassembly'
|
2
|
+
require 'ffi'
|
3
|
+
|
4
|
+
RSpec.configure do |config|
|
5
|
+
# Run specs in random order to surface order dependencies. If you find an
|
6
|
+
# order dependency and want to debug it, you can fix the order by providing
|
7
|
+
# the seed, which is printed after each run.
|
8
|
+
# --seed 1234
|
9
|
+
config.order = :random
|
10
|
+
|
11
|
+
# Seed global randomization in this process using the `--seed` CLI option.
|
12
|
+
# Setting this allows you to use `--seed` to deterministically reproduce
|
13
|
+
# test failures related to randomization by passing the same `--seed` value
|
14
|
+
# as the one that triggered the failure.
|
15
|
+
Kernel.srand config.seed
|
16
|
+
|
17
|
+
config.full_backtrace = true
|
18
|
+
end
|
@@ -0,0 +1,12 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
require 'simple-wasm'
|
3
|
+
|
4
|
+
RSpec.describe WebAssembly do
|
5
|
+
it "loads a WebAssembly module correctly" do
|
6
|
+
expect(WebAssembly.libs["simple-wasm"]).to be_a(WebAssembly::Instance)
|
7
|
+
end
|
8
|
+
|
9
|
+
it "calls a function correctly" do
|
10
|
+
expect(WebAssembly.libs["simple-wasm"].exported_func).to eq(42)
|
11
|
+
end
|
12
|
+
end
|
metadata
ADDED
@@ -0,0 +1,104 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: opal-webassembly
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.1.0
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Ribose Inc.
|
8
|
+
autorequire:
|
9
|
+
bindir: exe
|
10
|
+
cert_chain: []
|
11
|
+
date: 2020-10-05 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: opal
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - ">="
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '0'
|
20
|
+
type: :runtime
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - ">="
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '0'
|
27
|
+
description:
|
28
|
+
email:
|
29
|
+
- open.source@ribose.com
|
30
|
+
executables:
|
31
|
+
- opal-repl-wasm
|
32
|
+
extensions: []
|
33
|
+
extra_rdoc_files: []
|
34
|
+
files:
|
35
|
+
- ".gitignore"
|
36
|
+
- ".rspec"
|
37
|
+
- ".rspec-opal"
|
38
|
+
- ".travis.yml"
|
39
|
+
- Gemfile
|
40
|
+
- LICENSE.adoc
|
41
|
+
- LICENSE.txt
|
42
|
+
- README.adoc
|
43
|
+
- Rakefile
|
44
|
+
- bin/console
|
45
|
+
- bin/opal-repl-wasm
|
46
|
+
- bin/setup
|
47
|
+
- examples/experiment/Makefile
|
48
|
+
- examples/experiment/experiment-wasm.c
|
49
|
+
- examples/experiment/experiment-wasm.wasm
|
50
|
+
- examples/experiment/experiment.rb
|
51
|
+
- examples/experiment/experiment.sh
|
52
|
+
- examples/onigmo/onigmo-wasm.wasm
|
53
|
+
- examples/onigmo/onigmo.rb
|
54
|
+
- examples/onigmo/onigmo.sh
|
55
|
+
- examples/simple_ffi/Rakefile
|
56
|
+
- examples/simple_ffi/simple-wasm.wasm
|
57
|
+
- examples/simple_ffi/simple-wasm.wat
|
58
|
+
- examples/simple_ffi/simple.rb
|
59
|
+
- exe/opal-repl-wasm
|
60
|
+
- lib/opal/webassembly.rb
|
61
|
+
- lib/opal/webassembly/processor.rb
|
62
|
+
- lib/opal/webassembly/version.rb
|
63
|
+
- opal-webassembly.gemspec
|
64
|
+
- opal/ffi.rb
|
65
|
+
- opal/ffi/library.rb
|
66
|
+
- opal/ffi/pointer.rb
|
67
|
+
- opal/ffi/struct.rb
|
68
|
+
- opal/ffi/types.rb
|
69
|
+
- opal/webassembly.rb
|
70
|
+
- opal/webassembly/global.rb
|
71
|
+
- opal/webassembly/instance.rb
|
72
|
+
- opal/webassembly/memory.rb
|
73
|
+
- opal/webassembly/module.rb
|
74
|
+
- opal/webassembly/table.rb
|
75
|
+
- spec-opal/ffi_spec.rb
|
76
|
+
- spec-opal/spec_helper.rb
|
77
|
+
- spec-opal/webassembly_spec.rb
|
78
|
+
homepage: https://github.com/interscript/opal-webassembly
|
79
|
+
licenses:
|
80
|
+
- BSD-2-Clause
|
81
|
+
metadata:
|
82
|
+
homepage_uri: https://github.com/interscript/opal-webassembly
|
83
|
+
source_code_uri: https://github.com/interscript/opal-webassembly
|
84
|
+
changelog_uri: https://github.com/interscript/opal-webassembly/commits/master
|
85
|
+
post_install_message:
|
86
|
+
rdoc_options: []
|
87
|
+
require_paths:
|
88
|
+
- lib
|
89
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
90
|
+
requirements:
|
91
|
+
- - ">="
|
92
|
+
- !ruby/object:Gem::Version
|
93
|
+
version: 2.3.0
|
94
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
95
|
+
requirements:
|
96
|
+
- - ">="
|
97
|
+
- !ruby/object:Gem::Version
|
98
|
+
version: '0'
|
99
|
+
requirements: []
|
100
|
+
rubygems_version: 3.0.3
|
101
|
+
signing_key:
|
102
|
+
specification_version: 4
|
103
|
+
summary: Opal with WebAssembly support
|
104
|
+
test_files: []
|