Skip to content

Commit ae12ddc

Browse files
authored
Merge pull request #375 from bytecodealliance/fix-documentation
Fix YARD documentation
2 parents b5139ef + 88eaf8a commit ae12ddc

File tree

6 files changed

+25
-17
lines changed

6 files changed

+25
-17
lines changed

.github/workflows/release.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -128,3 +128,6 @@ jobs:
128128
omitNameDuringUpdate: true
129129
omitPrereleaseDuringUpdate: true
130130
skipIfReleaseExists: true
131+
132+
- name: Publish doc
133+
uses: ./.github/actions/publish-doc

Gemfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ group :development do
1111
gem "standard", "~> 1.40"
1212
gem "get_process_mem"
1313
gem "yard", require: false
14-
gem "yard-rustdoc", "~> 0.3.2", require: false
14+
gem "yard-rustdoc", "~> 0.4.0", require: false
1515
gem "benchmark-ips", require: false
1616
end
1717

Gemfile.lock

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,10 @@ GEM
1212
bigdecimal (3.1.8)
1313
diff-lcs (1.5.1)
1414
ffi (1.17.0)
15+
ffi (1.17.0-arm64-darwin)
16+
ffi (1.17.0-x64-mingw-ucrt)
17+
ffi (1.17.0-x86_64-darwin)
18+
ffi (1.17.0-x86_64-linux-gnu)
1519
get_process_mem (1.0.0)
1620
bigdecimal (>= 2.0)
1721
ffi (~> 1.0)
@@ -79,7 +83,7 @@ GEM
7983
prettier_print (>= 1.2.0)
8084
unicode-display_width (2.5.0)
8185
yard (0.9.36)
82-
yard-rustdoc (0.3.2)
86+
yard-rustdoc (0.4.0)
8387
syntax_tree (~> 5.0)
8488
yard (~> 0.9)
8589

@@ -101,7 +105,7 @@ DEPENDENCIES
101105
standard (~> 1.40)
102106
wasmtime!
103107
yard
104-
yard-rustdoc (~> 0.3.2)
108+
yard-rustdoc (~> 0.4.0)
105109

106110
BUNDLED WITH
107111
2.5.4

ext/src/ruby_api/pooling_allocation_config.rs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ impl PoolingAllocationConfig {
3939
}
4040

4141
/// @yard
42-
/// @def total_memories=
42+
/// @def total_memories=(total_memories)
4343
/// @param total_memories [Integer]
4444
/// @return [Wasmtime::PoolingAllocationConfig]
4545
pub fn set_total_memories(rb_self: Obj<Self>, total_memories: u32) -> Result<Obj<Self>, Error> {
@@ -49,7 +49,7 @@ impl PoolingAllocationConfig {
4949
}
5050

5151
/// @yard
52-
/// @def total_tables=
52+
/// @def total_tables=(total_tables)
5353
/// @param total_tables [Integer]
5454
/// @return [Wasmtime::PoolingAllocationConfig]
5555
pub fn set_total_tables(rb_self: Obj<Self>, total_tables: u32) -> Result<Obj<Self>, Error> {
@@ -58,7 +58,7 @@ impl PoolingAllocationConfig {
5858
}
5959

6060
/// @yard
61-
/// @def max_memories_per_module=
61+
/// @def max_memories_per_module=(max_memories)
6262
/// @param max_memories [Integer]
6363
/// @return [Wasmtime::PoolingAllocationConfig]
6464
pub fn set_max_memories_per_module(
@@ -70,7 +70,7 @@ impl PoolingAllocationConfig {
7070
}
7171

7272
/// @yard
73-
/// @def max_tables_per_module=
73+
/// @def max_tables_per_module=(max_tables)
7474
/// @param max_tables [Integer]
7575
/// @return [Wasmtime::PoolingAllocationConfig]
7676
pub fn set_max_tables_per_component(
@@ -82,14 +82,14 @@ impl PoolingAllocationConfig {
8282
}
8383

8484
/// @yard
85-
/// @def are_memory_protection_keys_available
85+
/// @def memory_protection_keys_available?
8686
/// @return [Boolean]
8787
pub fn are_memory_protection_keys_available() -> Result<bool, Error> {
8888
Ok(wasmtime::PoolingAllocationConfig::are_memory_protection_keys_available())
8989
}
9090

9191
/// @yard
92-
/// @def async_stack_keep_resident=
92+
/// @def async_stack_keep_resident=(amount)
9393
/// @param amount [Integer]
9494
/// @return [Wasmtime::PoolingAllocationConfig]
9595
pub fn set_async_stack_keep_resident(
@@ -100,7 +100,7 @@ impl PoolingAllocationConfig {
100100
Ok(rb_self)
101101
}
102102

103-
/// @def async_stack_zeroing=
103+
/// @def async_stack_zeroing=(enable)
104104
/// @param enable [Boolean]
105105
/// @return [Wasmtime::PoolingAllocationConfig]
106106
pub fn set_async_stack_zeroing(rb_self: Obj<Self>, enable: Value) -> Result<Obj<Self>, Error> {

ext/src/ruby_api/store.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ unsafe impl Send for StoreData {}
107107
impl Store {
108108
/// @yard
109109
///
110-
/// @def new(engine, data = nil, wasi_ctx: nil)
110+
/// @def new(engine, data = nil, wasi_ctx: nil, limits: nil)
111111
/// @param engine [Wasmtime::Engine]
112112
/// The engine for this store.
113113
/// @param data [Object]
@@ -214,6 +214,7 @@ impl Store {
214214
}
215215

216216
/// @yard
217+
/// @def linear_memory_limit_hit?
217218
/// Returns whether the linear memory limit has been hit.
218219
///
219220
/// @return [Boolean]

ext/src/ruby_api/wasi_ctx.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,8 @@ impl WasiCtx {
4040

4141
/// @yard
4242
/// Set stdin to read from the specified file.
43-
/// @param path [String] The path of the file to read from.
4443
/// @def set_stdin_file(path)
44+
/// @param path [String] The path of the file to read from.
4545
/// @return [WasiCtxBuilder] +self+
4646
fn set_stdin_file(rb_self: RbSelf, path: RString) -> RbSelf {
4747
let inner = rb_self.inner.borrow_mut();
@@ -52,8 +52,8 @@ impl WasiCtx {
5252

5353
/// @yard
5454
/// Set stdin to the specified String.
55-
/// @param content [String]
5655
/// @def set_stdin_string(content)
56+
/// @param content [String]
5757
/// @return [WasiCtx] +self+
5858
fn set_stdin_string(rb_self: RbSelf, content: RString) -> RbSelf {
5959
let inner = rb_self.inner.borrow_mut();
@@ -66,8 +66,8 @@ impl WasiCtx {
6666
/// @yard
6767
/// Set stdout to write to a file. Will truncate the file if it exists,
6868
/// otherwise try to create it.
69-
/// @param path [String] The path of the file to write to.
7069
/// @def set_stdout_file(path)
70+
/// @param path [String] The path of the file to write to.
7171
/// @return [WasiCtx] +self+
7272
fn set_stdout_file(rb_self: RbSelf, path: RString) -> RbSelf {
7373
let inner = rb_self.inner.borrow_mut();
@@ -80,9 +80,9 @@ impl WasiCtx {
8080
/// Set stdout to write to a string buffer.
8181
/// If the string buffer is frozen, Wasm execution will raise a Wasmtime::Error error.
8282
/// No encoding checks are done on the resulting string, it is the caller's responsibility to ensure the string contains a valid encoding
83+
/// @def set_stdout_buffer(buffer, capacity)
8384
/// @param buffer [String] The string buffer to write to.
8485
/// @param capacity [Integer] The maximum number of bytes that can be written to the output buffer.
85-
/// @def set_stout_buffer(buffer, capacity)
8686
/// @return [WasiCtx] +self+
8787
fn set_stdout_buffer(rb_self: RbSelf, buffer: RString, capacity: usize) -> RbSelf {
8888
let inner = rb_self.inner.borrow_mut();
@@ -94,8 +94,8 @@ impl WasiCtx {
9494
/// @yard
9595
/// Set stderr to write to a file. Will truncate the file if it exists,
9696
/// otherwise try to create it.
97-
/// @param path [String] The path of the file to write to.
9897
/// @def set_stderr_file(path)
98+
/// @param path [String] The path of the file to write to.
9999
/// @return [WasiCtx] +self+
100100
fn set_stderr_file(rb_self: RbSelf, path: RString) -> RbSelf {
101101
let inner = rb_self.inner.borrow_mut();
@@ -108,9 +108,9 @@ impl WasiCtx {
108108
/// Set stderr to write to a string buffer.
109109
/// If the string buffer is frozen, Wasm execution will raise a Wasmtime::Error error.
110110
/// No encoding checks are done on the resulting string, it is the caller's responsibility to ensure the string contains a valid encoding
111+
/// @def set_stderr_buffer(buffer, capacity)
111112
/// @param buffer [String] The string buffer to write to.
112113
/// @param capacity [Integer] The maximum number of bytes that can be written to the output buffer.
113-
/// @def set_stout_buffer(buffer, capacity)
114114
/// @return [WasiCtx] +self+
115115
fn set_stderr_buffer(rb_self: RbSelf, buffer: RString, capacity: usize) -> RbSelf {
116116
let inner = rb_self.inner.borrow_mut();

0 commit comments

Comments
 (0)