wardite 0.6.1 → 0.8.0

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.
@@ -0,0 +1,204 @@
1
+ ---
2
+ path: ".gem_rbs_collection"
3
+ gems:
4
+ - name: activesupport
5
+ version: '7.0'
6
+ source:
7
+ type: git
8
+ name: ruby/gem_rbs_collection
9
+ revision: 1288acc1cdecc0a273740212da0df35b108dbfb6
10
+ remote: https://github.com/ruby/gem_rbs_collection.git
11
+ repo_dir: gems
12
+ - name: ast
13
+ version: '2.4'
14
+ source:
15
+ type: git
16
+ name: ruby/gem_rbs_collection
17
+ revision: 1288acc1cdecc0a273740212da0df35b108dbfb6
18
+ remote: https://github.com/ruby/gem_rbs_collection.git
19
+ repo_dir: gems
20
+ - name: base64
21
+ version: '0.1'
22
+ source:
23
+ type: git
24
+ name: ruby/gem_rbs_collection
25
+ revision: 1288acc1cdecc0a273740212da0df35b108dbfb6
26
+ remote: https://github.com/ruby/gem_rbs_collection.git
27
+ repo_dir: gems
28
+ - name: bigdecimal
29
+ version: '3.1'
30
+ source:
31
+ type: git
32
+ name: ruby/gem_rbs_collection
33
+ revision: 1288acc1cdecc0a273740212da0df35b108dbfb6
34
+ remote: https://github.com/ruby/gem_rbs_collection.git
35
+ repo_dir: gems
36
+ - name: concurrent-ruby
37
+ version: '1.1'
38
+ source:
39
+ type: git
40
+ name: ruby/gem_rbs_collection
41
+ revision: 1288acc1cdecc0a273740212da0df35b108dbfb6
42
+ remote: https://github.com/ruby/gem_rbs_collection.git
43
+ repo_dir: gems
44
+ - name: connection_pool
45
+ version: '2.4'
46
+ source:
47
+ type: git
48
+ name: ruby/gem_rbs_collection
49
+ revision: 1288acc1cdecc0a273740212da0df35b108dbfb6
50
+ remote: https://github.com/ruby/gem_rbs_collection.git
51
+ repo_dir: gems
52
+ - name: csv
53
+ version: '3.3'
54
+ source:
55
+ type: git
56
+ name: ruby/gem_rbs_collection
57
+ revision: 1288acc1cdecc0a273740212da0df35b108dbfb6
58
+ remote: https://github.com/ruby/gem_rbs_collection.git
59
+ repo_dir: gems
60
+ - name: date
61
+ version: '0'
62
+ source:
63
+ type: stdlib
64
+ - name: digest
65
+ version: '0'
66
+ source:
67
+ type: stdlib
68
+ - name: erb
69
+ version: '0'
70
+ source:
71
+ type: stdlib
72
+ - name: ffi
73
+ version: 1.17.1
74
+ source:
75
+ type: rubygems
76
+ - name: fileutils
77
+ version: '0'
78
+ source:
79
+ type: stdlib
80
+ - name: forwardable
81
+ version: '0'
82
+ source:
83
+ type: stdlib
84
+ - name: i18n
85
+ version: '1.10'
86
+ source:
87
+ type: git
88
+ name: ruby/gem_rbs_collection
89
+ revision: 1288acc1cdecc0a273740212da0df35b108dbfb6
90
+ remote: https://github.com/ruby/gem_rbs_collection.git
91
+ repo_dir: gems
92
+ - name: json
93
+ version: '0'
94
+ source:
95
+ type: stdlib
96
+ - name: listen
97
+ version: '3.9'
98
+ source:
99
+ type: git
100
+ name: ruby/gem_rbs_collection
101
+ revision: 1288acc1cdecc0a273740212da0df35b108dbfb6
102
+ remote: https://github.com/ruby/gem_rbs_collection.git
103
+ repo_dir: gems
104
+ - name: logger
105
+ version: '0'
106
+ source:
107
+ type: stdlib
108
+ - name: minitest
109
+ version: '0'
110
+ source:
111
+ type: stdlib
112
+ - name: monitor
113
+ version: '0'
114
+ source:
115
+ type: stdlib
116
+ - name: mutex_m
117
+ version: '0'
118
+ source:
119
+ type: stdlib
120
+ - name: openssl
121
+ version: '0'
122
+ source:
123
+ type: stdlib
124
+ - name: optparse
125
+ version: '0'
126
+ source:
127
+ type: stdlib
128
+ - name: parser
129
+ version: '3.2'
130
+ source:
131
+ type: git
132
+ name: ruby/gem_rbs_collection
133
+ revision: 1288acc1cdecc0a273740212da0df35b108dbfb6
134
+ remote: https://github.com/ruby/gem_rbs_collection.git
135
+ repo_dir: gems
136
+ - name: pathname
137
+ version: '0'
138
+ source:
139
+ type: stdlib
140
+ - name: rainbow
141
+ version: '3.0'
142
+ source:
143
+ type: git
144
+ name: ruby/gem_rbs_collection
145
+ revision: 1288acc1cdecc0a273740212da0df35b108dbfb6
146
+ remote: https://github.com/ruby/gem_rbs_collection.git
147
+ repo_dir: gems
148
+ - name: rake
149
+ version: '13.0'
150
+ source:
151
+ type: git
152
+ name: ruby/gem_rbs_collection
153
+ revision: 1288acc1cdecc0a273740212da0df35b108dbfb6
154
+ remote: https://github.com/ruby/gem_rbs_collection.git
155
+ repo_dir: gems
156
+ - name: rbs
157
+ version: 3.7.0
158
+ source:
159
+ type: rubygems
160
+ - name: rdoc
161
+ version: '0'
162
+ source:
163
+ type: stdlib
164
+ - name: securerandom
165
+ version: '0'
166
+ source:
167
+ type: stdlib
168
+ - name: singleton
169
+ version: '0'
170
+ source:
171
+ type: stdlib
172
+ - name: socket
173
+ version: '0'
174
+ source:
175
+ type: stdlib
176
+ - name: stringio
177
+ version: '0'
178
+ source:
179
+ type: stdlib
180
+ - name: strscan
181
+ version: '0'
182
+ source:
183
+ type: stdlib
184
+ - name: time
185
+ version: '0'
186
+ source:
187
+ type: stdlib
188
+ - name: timeout
189
+ version: '0'
190
+ source:
191
+ type: stdlib
192
+ - name: tsort
193
+ version: '0'
194
+ source:
195
+ type: stdlib
196
+ - name: tzinfo
197
+ version: '2.0'
198
+ source:
199
+ type: git
200
+ name: ruby/gem_rbs_collection
201
+ revision: 1288acc1cdecc0a273740212da0df35b108dbfb6
202
+ remote: https://github.com/ruby/gem_rbs_collection.git
203
+ repo_dir: gems
204
+ gemfile_lock_path: Gemfile.lock
@@ -0,0 +1,18 @@
1
+ # Download sources
2
+ sources:
3
+ - type: git
4
+ name: ruby/gem_rbs_collection
5
+ remote: https://github.com/ruby/gem_rbs_collection.git
6
+ revision: main
7
+ repo_dir: gems
8
+
9
+ # You can specify local directories as sources also.
10
+ # - type: local
11
+ # path: path/to/your/local/repository
12
+
13
+ # A directory to install the downloaded RBSs
14
+ path: .gem_rbs_collection
15
+
16
+ gems:
17
+ # If you want to avoid installing rbs files for gems, you can specify them here.
18
+ - name: optparse
data/sig/bundler.rbs ADDED
@@ -0,0 +1,3 @@
1
+ module Bundler
2
+ def self.with_original_env: () {() -> void} -> untyped
3
+ end
@@ -0,0 +1,52 @@
1
+ # Generated from lib/wardite/cli/cli.rb with RBS::Inline
2
+
3
+ module Wardite
4
+ module Cli
5
+ class Cli
6
+ @args: Array[String]
7
+
8
+ attr_reader invoke: String?
9
+
10
+ attr_reader mapdir: String?
11
+
12
+ attr_reader file: String
13
+
14
+ attr_reader memsize: Integer
15
+
16
+ attr_reader wasi: bool
17
+
18
+ attr_reader yjit: bool
19
+
20
+ # @rbs args: Array[String]
21
+ # @rbs return: void
22
+ def initialize: (Array[String] args) -> void
23
+
24
+ # @rbs return: Array[Integer | Float]
25
+ # @rbs %a{pure}
26
+ %a{pure}
27
+ def args: () -> Array[Integer | Float]
28
+
29
+ # @rbs return: ::Wardite::Instance
30
+ def new_instance: () -> ::Wardite::Instance
31
+
32
+ # @rbs return: void
33
+ def run: () -> void
34
+
35
+ # @rbs return: void
36
+ def invoke_function: () -> void
37
+
38
+ # @rbs return: void
39
+ def invoke_wasi: () -> void
40
+
41
+ # @rbs return: String?
42
+ # @rbs %a{pure}
43
+ %a{pure}
44
+ def mount_src: () -> String?
45
+
46
+ # @rbs return: String?
47
+ # @rbs %a{pure}
48
+ %a{pure}
49
+ def mount_dst: () -> String?
50
+ end
51
+ end
52
+ end
@@ -130,6 +130,16 @@ module Wardite
130
130
 
131
131
  RIGHT_DIR_RIGHT_BASE: untyped
132
132
 
133
+ LOOKUP_SYMLINK_FOLLOW: untyped
134
+
135
+ O_CREAT: untyped
136
+
137
+ O_DIRECTORY: untyped
138
+
139
+ O_EXCL: untyped
140
+
141
+ O_TRUNC: untyped
142
+
133
143
  # @rbs mode_str: String
134
144
  # @rbs return: Integer
135
145
  def self.to_ftype: (String mode_str) -> Integer
@@ -0,0 +1,42 @@
1
+ # Generated from lib/wardite/wasi/dirent_cache.rb with RBS::Inline
2
+
3
+ module Wardite
4
+ module Wasi
5
+ class Dirent
6
+ attr_reader path: String
7
+
8
+ attr_reader ino: Integer
9
+
10
+ attr_reader type: Integer
11
+
12
+ # @rbs path: String
13
+ # @rbs ino: Integer
14
+ # @rbs type: Integer
15
+ # @rbs return: void
16
+ def initialize: (String path, Integer ino, Integer type) -> void
17
+ end
18
+
19
+ class DirentCache
20
+ attr_reader entries: Array[Dirent]
21
+
22
+ attr_accessor eof: bool
23
+
24
+ # @rbs path: String
25
+ # @rbs return: void
26
+ def initialize: (String path) -> void
27
+
28
+ # @rbs buf_len: Integer
29
+ # @rbs cookie: Integer
30
+ # @rbs return: [String, bool]
31
+ def fetch_entries_binary: (Integer buf_len, Integer cookie) -> [ String, bool ]
32
+
33
+ # @rbs d_next: Integer
34
+ # @rbs ino: Integer
35
+ # @rbs name_len: Integer
36
+ # @rbs type: Integer
37
+ # @rbs name: String
38
+ # @rbs return: String
39
+ def make_dirent_pack1: (Integer d_next, Integer ino, Integer name_len, Integer type, String name) -> String
40
+ end
41
+ end
42
+ end
@@ -0,0 +1,15 @@
1
+ # Generated from lib/wardite/wasi/preopens.rb with RBS::Inline
2
+
3
+ module Wardite
4
+ module Wasi
5
+ class PreopenedDir
6
+ attr_reader path: String
7
+
8
+ attr_reader guest_path: String
9
+
10
+ attr_reader fd: Integer
11
+
12
+ def initialize: (untyped path, untyped guest_path, untyped fd) -> untyped
13
+ end
14
+ end
15
+ end
@@ -6,13 +6,44 @@ module Wardite
6
6
 
7
7
  include WasmModule
8
8
 
9
- attr_accessor fd_table: Array[IO | File]
9
+ attr_accessor fd_table: Hash[Integer, IO | File | ::Wardite::Wasi::PreopenedDir]
10
+
11
+ attr_accessor fd_count: Integer
10
12
 
11
13
  attr_accessor argv: Array[String]
12
14
 
15
+ attr_accessor mapdir: Hash[String, String]
16
+
17
+ attr_accessor dirent_cache: Hash[Integer, ::Wardite::Wasi::DirentCache]
18
+
13
19
  # @rbs argv: Array[String]
20
+ # @rbs mapdir: Hash[String, String]
14
21
  # @rbs return: void
15
- def initialize: (?argv: Array[String]) -> void
22
+ def initialize: (?argv: Array[String], ?mapdir: Hash[String, String]) -> void
23
+
24
+ # @rbs file: IO|File|::Wardite::Wasi::PreopenedDir
25
+ # @rbs return: Integer
26
+ def set_fd: (IO | File | ::Wardite::Wasi::PreopenedDir file) -> Integer
27
+
28
+ # @rbs path: String
29
+ # @rbs guest_path: String
30
+ # @rbs return: void
31
+ def set_preopened_dir: (String path, String guest_path) -> void
32
+
33
+ # @rbs orig_path: String
34
+ # @rbs return: String
35
+ def resolv_path: (String orig_path) -> String
36
+
37
+ # @rbs atfd: Integer
38
+ # @rbs target: String
39
+ # @rbs return: String
40
+ def get_path_at: (Integer atfd, String target) -> String
41
+
42
+ # @rbs dirflags: Integer
43
+ # @rbs oflags: Integer
44
+ # @rbs fdflags: Integer
45
+ # @rbs rights: Integer
46
+ def interpret_open_flags: (Integer dirflags, Integer oflags, Integer fdflags, Integer rights) -> untyped
16
47
 
17
48
  # @rbs store: Store
18
49
  # @rbs args: Array[wasmValue]
@@ -39,11 +70,66 @@ module Wardite
39
70
  # @rbs return: Object
40
71
  def clock_time_get: (Store store, Array[wasmValue] args) -> Object
41
72
 
73
+ # @rbs store: Store
74
+ # @rbs args: Array[wasmValue]
75
+ # @rbs return: Object
76
+ def path_create_directory: (Store store, Array[wasmValue] args) -> Object
77
+
78
+ # @rbs store: Store
79
+ # @rbs args: Array[wasmValue]
80
+ # @rbs return: Object
81
+ def path_filestat_get: (Store store, Array[wasmValue] args) -> Object
82
+
83
+ # @rbs store: Store
84
+ # @rbs args: Array[wasmValue]
85
+ # @rbs return: Object
86
+ def path_filestat_set_times: (Store store, Array[wasmValue] args) -> Object
87
+
88
+ # @rbs store: Store
89
+ # @rbs args: Array[wasmValue]
90
+ # @rbs return: Object
91
+ def path_link: (Store store, Array[wasmValue] args) -> Object
92
+
93
+ # @rbs store: Store
94
+ # @rbs args: Array[wasmValue]
95
+ # @rbs return: Object
96
+ def path_open: (Store store, Array[wasmValue] args) -> Object
97
+
98
+ # @rbs store: Store
99
+ # @rbs args: Array[wasmValue]
100
+ # @rbs return: Object
101
+ def path_readlink: (Store store, Array[wasmValue] args) -> Object
102
+
103
+ # @rbs store: Store
104
+ # @rbs args: Array[wasmValue]
105
+ # @rbs return: Object
106
+ def path_remove_directory: (Store store, Array[wasmValue] args) -> Object
107
+
108
+ # @rbs store: Store
109
+ # @rbs args: Array[wasmValue]
110
+ # @rbs return: Object
111
+ def path_rename: (Store store, Array[wasmValue] args) -> Object
112
+
113
+ # @rbs store: Store
114
+ # @rbs args: Array[wasmValue]
115
+ # @rbs return: Object
116
+ def path_symlink: (Store store, Array[wasmValue] args) -> Object
117
+
118
+ # @rbs store: Store
119
+ # @rbs args: Array[wasmValue]
120
+ # @rbs return: Object
121
+ def path_unlink_file: (Store store, Array[wasmValue] args) -> Object
122
+
42
123
  # @rbs store: Store
43
124
  # @rbs args: Array[wasmValue]
44
125
  # @rbs return: Object
45
126
  def fd_prestat_get: (Store store, Array[wasmValue] args) -> Object
46
127
 
128
+ # @rbs store: Store
129
+ # @rbs args: Array[wasmValue]
130
+ # @rbs return: Object
131
+ def fd_prestat_dir_name: (Store store, Array[wasmValue] args) -> Object
132
+
47
133
  # @rbs store: Store
48
134
  # @rbs args: Array[wasmValue]
49
135
  # @rbs return: Object
@@ -64,6 +150,20 @@ module Wardite
64
150
  # @rbs return: Object
65
151
  def fd_filestat_get: (Store store, Array[wasmValue] args) -> Object
66
152
 
153
+ # @rbs store: Store
154
+ # @rbs args: Array[wasmValue]
155
+ # @rbs return: Object
156
+ def fd_readdir: (Store store, Array[wasmValue] args) -> Object
157
+
158
+ # @rbs store: Store
159
+ # @rbs args: Array[wasmValue]
160
+ def fd_tell: (Store store, Array[wasmValue] args) -> untyped
161
+
162
+ # @rbs store: Store
163
+ # @rbs args: Array[wasmValue]
164
+ # @rbs return: Object
165
+ def fd_close: (Store store, Array[wasmValue] args) -> Object
166
+
67
167
  # @rbs store: Store
68
168
  # @rbs args: Array[wasmValue]
69
169
  # @rbs return: Object
@@ -22,7 +22,7 @@ module Wardite
22
22
 
23
23
  attr_reader import_object: Hash[Symbol, wasmModule]
24
24
 
25
- attr_accessor wasi: WasiSnapshotPreview1?
25
+ attr_accessor wasi: ::Wardite::WasiSnapshotPreview1?
26
26
 
27
27
  # @rbs import_object: Hash[Symbol, wasmModuleSrc]
28
28
  # @rbs &blk: (Instance) -> void
@@ -141,6 +141,10 @@ module Wardite
141
141
  # @rbs name: String|Symbol
142
142
  # @rbs return: bool
143
143
  def respond_to?: (String | Symbol name) -> bool
144
+
145
+ # @rbs args: Array[Object]
146
+ # @rbs return: Object?
147
+ def _start: (*untyped args) -> Object?
144
148
  end
145
149
 
146
150
  class Type
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: wardite
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.6.1
4
+ version: 0.8.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Uchio Kondo
8
8
  bindir: exe
9
9
  cert_chain: []
10
- date: 2025-01-13 00:00:00.000000000 Z
10
+ date: 2025-04-04 00:00:00.000000000 Z
11
11
  dependencies: []
12
12
  description: A pure-ruby webassembly runtime
13
13
  email:
@@ -46,6 +46,7 @@ files:
46
46
  - lib/wardite/alu_f64.generated.rb
47
47
  - lib/wardite/alu_i32.generated.rb
48
48
  - lib/wardite/alu_i64.generated.rb
49
+ - lib/wardite/cli/cli.rb
49
50
  - lib/wardite/const.rb
50
51
  - lib/wardite/convert.generated.rb
51
52
  - lib/wardite/errors.rb
@@ -57,6 +58,8 @@ files:
57
58
  - lib/wardite/version.rb
58
59
  - lib/wardite/wasi.rb
59
60
  - lib/wardite/wasi/consts.rb
61
+ - lib/wardite/wasi/dirent_cache.rb
62
+ - lib/wardite/wasi/preopens.rb
60
63
  - lib/wardite/wasm_module.rb
61
64
  - misc/bench-value.rb
62
65
  - misc/slides/fib.c
@@ -66,16 +69,20 @@ files:
66
69
  - misc/slides/image.png
67
70
  - misc/slides/tokyo12.html
68
71
  - misc/slides/tokyo12.md
72
+ - rbs_collection.lock.yaml
73
+ - rbs_collection.yaml
69
74
  - scripts/gen_alu.rb
70
75
  - scripts/gen_conv.rb
71
76
  - scripts/templates/alu_module.rb.tmpl
72
77
  - scripts/templates/conv_module.rb.tmpl
78
+ - sig/bundler.rbs
73
79
  - sig/fcntl.rbs
74
80
  - sig/generated/wardite.rbs
75
81
  - sig/generated/wardite/alu_f32.generated.rbs
76
82
  - sig/generated/wardite/alu_f64.generated.rbs
77
83
  - sig/generated/wardite/alu_i32.generated.rbs
78
84
  - sig/generated/wardite/alu_i64.generated.rbs
85
+ - sig/generated/wardite/cli/cli.rbs
79
86
  - sig/generated/wardite/const.rbs
80
87
  - sig/generated/wardite/convert.generated.rbs
81
88
  - sig/generated/wardite/errors.rbs
@@ -87,6 +94,8 @@ files:
87
94
  - sig/generated/wardite/version.rbs
88
95
  - sig/generated/wardite/wasi.rbs
89
96
  - sig/generated/wardite/wasi/consts.rbs
97
+ - sig/generated/wardite/wasi/dirent_cache.rbs
98
+ - sig/generated/wardite/wasi/preopens.rbs
90
99
  - sig/generated/wardite/wasm_module.rbs
91
100
  - sig/wardite.rbs
92
101
  homepage: https://github.com/udzura/wardite