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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 1d261070d86a9c7277779eeccc80ac967aeac41ac66fb760e2f76bcc485a1679
4
- data.tar.gz: 7bd048bc66105308344fff40a99af2afca5ce15d3550affff034918e50044ca4
3
+ metadata.gz: ee779223feab7110e29256fdc4860ba480d13d676d18e85284fd0765eef2cc4b
4
+ data.tar.gz: 249087d8f6b7772aa7428a4828ffc35eacb1b0aa8b27d5cd909b803176d6a683
5
5
  SHA512:
6
- metadata.gz: 5279ea150a536357cceded2ef2576f1a459b51b218b23b9972582b9763609220567d0cfaa870736a446a926420a3d908dc96fa437d56be49fdc9c1f7a8877c63
7
- data.tar.gz: f2f80b3c71ba3190221098c048c5d8b4c576f3c35e1dae0f16022dcea873a577cdc64d2e522866e6290419198e7f63a089dd91e2b3220c5486069d389fec9cbd
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
@@ -1,6 +1,6 @@
1
1
  [package]
2
2
  name = "methodray"
3
- version = "0.1.5"
3
+ version = "0.1.6"
4
4
  edition = "2021"
5
5
 
6
6
  [lib]
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module MethodRay
4
- VERSION = '0.1.5'
4
+ VERSION = '0.1.6'
5
5
  end
data/rust/Cargo.toml CHANGED
@@ -1,6 +1,6 @@
1
1
  [package]
2
2
  name = "methodray-core"
3
- version = "0.1.5"
3
+ version = "0.1.6"
4
4
  edition = "2021"
5
5
 
6
6
  [lib]
@@ -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 rb_path = concat!(env!("CARGO_MANIFEST_DIR"), "/src/rbs/method_loader.rb");
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(&load_code)
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
+ }
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: method-ray
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.5
4
+ version: 0.1.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - dak2