method-ray 0.1.5 → 0.1.6
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/CHANGELOG.md +7 -0
- data/ext/Cargo.toml +1 -1
- data/lib/methodray/version.rb +1 -1
- data/rust/Cargo.toml +1 -1
- data/rust/src/rbs/loader.rs +3 -4
- data/rust/src/rbs/mod.rs +29 -0
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: ee779223feab7110e29256fdc4860ba480d13d676d18e85284fd0765eef2cc4b
|
|
4
|
+
data.tar.gz: 249087d8f6b7772aa7428a4828ffc35eacb1b0aa8b27d5cd909b803176d6a683
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 8d6534a955eaf4937c5ebc4c525e07f5f7cd8599861f128cbb10161e00a6a932f1b47760e1283e7e2f48940ea0a89bb5c038ac83cdd8ce8a629f8f91b05e534a
|
|
7
|
+
data.tar.gz: cbe0d247ffcbd0ce4965f9e20a2293336aca3d7a6eeb96878665cb7692e11ea4366d3c1f2a87ea32711dbcd00a404d4a41da3e84d34829d40568ec0bb37d74b4
|
data/CHANGELOG.md
CHANGED
|
@@ -5,6 +5,12 @@ All notable changes to this project will be documented in this file.
|
|
|
5
5
|
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
|
|
6
6
|
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
7
7
|
|
|
8
|
+
## [0.1.6] - 2026-02-23
|
|
9
|
+
|
|
10
|
+
### Fixed
|
|
11
|
+
|
|
12
|
+
- Embed `method_loader.rb` at compile time with `include_str!` to eliminate runtime dependency on source directory ([#35](https://github.com/dak2/method-ray/pull/35))
|
|
13
|
+
|
|
8
14
|
## [0.1.5] - 2026-02-23
|
|
9
15
|
|
|
10
16
|
### Added
|
|
@@ -89,6 +95,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
89
95
|
- Initial release
|
|
90
96
|
- `methodray check` - Static type checking for Ruby files
|
|
91
97
|
|
|
98
|
+
[0.1.6]: https://github.com/dak2/method-ray/releases/tag/v0.1.6
|
|
92
99
|
[0.1.5]: https://github.com/dak2/method-ray/releases/tag/v0.1.5
|
|
93
100
|
[0.1.4]: https://github.com/dak2/method-ray/releases/tag/v0.1.4
|
|
94
101
|
[0.1.3]: https://github.com/dak2/method-ray/releases/tag/v0.1.3
|
data/ext/Cargo.toml
CHANGED
data/lib/methodray/version.rb
CHANGED
data/rust/Cargo.toml
CHANGED
data/rust/src/rbs/loader.rs
CHANGED
|
@@ -37,12 +37,11 @@ impl<'a> RbsLoader<'a> {
|
|
|
37
37
|
|
|
38
38
|
/// Load all method definitions from RBS
|
|
39
39
|
pub fn load_methods(&self) -> Result<Vec<RbsMethodInfo>, RbsError> {
|
|
40
|
-
// Load method_loader.rb
|
|
41
|
-
let
|
|
42
|
-
let load_code = format!("require '{}'", rb_path);
|
|
40
|
+
// Load method_loader.rb (embedded at compile time to avoid hardcoded paths)
|
|
41
|
+
let ruby_code = include_str!("method_loader.rb");
|
|
43
42
|
let _: Value = self
|
|
44
43
|
.ruby
|
|
45
|
-
.eval(
|
|
44
|
+
.eval(ruby_code)
|
|
46
45
|
.map_err(|e| RbsError::LoadError(format!("Failed to load method_loader.rb: {}", e)))?;
|
|
47
46
|
|
|
48
47
|
// Instantiate Rbs::MethodLoader class and call method
|
data/rust/src/rbs/mod.rs
CHANGED
|
@@ -14,3 +14,32 @@ pub mod loader;
|
|
|
14
14
|
pub use error::RbsError;
|
|
15
15
|
#[cfg(feature = "ruby-ffi")]
|
|
16
16
|
pub use loader::{register_rbs_methods, RbsLoader, RbsMethodInfo};
|
|
17
|
+
|
|
18
|
+
#[cfg(test)]
|
|
19
|
+
mod tests {
|
|
20
|
+
#[test]
|
|
21
|
+
fn test_embedded_method_loader_contains_expected_class() {
|
|
22
|
+
let ruby_code = include_str!("method_loader.rb");
|
|
23
|
+
assert!(
|
|
24
|
+
ruby_code.contains("class MethodLoader"),
|
|
25
|
+
"Embedded Ruby code should contain MethodLoader class definition"
|
|
26
|
+
);
|
|
27
|
+
assert!(
|
|
28
|
+
ruby_code.contains("def load_methods"),
|
|
29
|
+
"Embedded Ruby code should contain load_methods method"
|
|
30
|
+
);
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
#[test]
|
|
34
|
+
fn test_embedded_method_loader_has_no_absolute_paths() {
|
|
35
|
+
let ruby_code = include_str!("method_loader.rb");
|
|
36
|
+
let forbidden_patterns = ["/home/runner/", "/Users/", "/tmp/build/"];
|
|
37
|
+
for pattern in &forbidden_patterns {
|
|
38
|
+
assert!(
|
|
39
|
+
!ruby_code.contains(pattern),
|
|
40
|
+
"Embedded Ruby code should not contain absolute path: {}",
|
|
41
|
+
pattern
|
|
42
|
+
);
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
}
|