rubydex 0.2.3-x86_64-linux → 0.2.4-x86_64-linux

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: 4aa89b9ebd052a79e8e4d9c59e8692785b09068ff185362fcfad152b1744db4d
4
- data.tar.gz: b19d59ff132c8382047e6d538e9d8894d613c7f52623d1aecec524ed87d5e7c1
3
+ metadata.gz: b7b94866c3b98a2130221b907c0d5045bebbb2a646cde6041879b93c8b9469ac
4
+ data.tar.gz: b1b7d3d5487752e6294bb1f771b64cb07bca5ee4c88b63e2ad984b5a06f0726c
5
5
  SHA512:
6
- metadata.gz: ebf4a08fc65b9825998e48afdd8a19ea787978116622e69f1b9f26a18237333ed680b07b3c8d1ef65817577e14413960223ba3d281e4fa4651c4d62f84d6e826
7
- data.tar.gz: b0716909fff42f12ad084a25f642651e147c76ec49f810b6191f409203b4ca9a6ecc99db71e0e83c324976ecafb6307ac8e7216678fc65e5758eb3e92a680d81
6
+ metadata.gz: fdf874e3b5d3e39dc68085ef3ec75a45264528463c6ad985d87c97d90304ff98f72769eddf0598de34e51e96b570b001ad1dd5934a935616afe15f393fe1ec85
7
+ data.tar.gz: 6dd08f424e6e6fc6673c4e6078cf2aca1c7916b5e43df0e7f7a6c32825f0e60c9f4fdfbed71e07b29e0bdba93c7996d41b1955e1c99ea48c8a9a09878b7f442d
@@ -2957,10 +2957,10 @@ limitations under the License.
2957
2957
  1.0.25</a></li>
2958
2958
  <li><a
2959
2959
  href=" https://github.com/modelcontextprotocol/rust-sdk/ ">rmcp-macros
2960
- 0.15.0</a></li>
2960
+ 1.6.0</a></li>
2961
2961
  <li><a
2962
2962
  href=" https://github.com/modelcontextprotocol/rust-sdk/ ">rmcp
2963
- 0.15.0</a></li>
2963
+ 1.4.0</a></li>
2964
2964
  <li><a
2965
2965
  href=" https://github.com/rust-lang/rustc-hash ">rustc-hash
2966
2966
  2.1.1</a></li>
@@ -20,6 +20,13 @@ module Rubydex
20
20
  end
21
21
  end
22
22
 
23
+ class Namespace < Declaration
24
+ #: (String ancestor_name) -> bool
25
+ def has_ancestor?(ancestor_name)
26
+ ancestors.any? { |ancestor| ancestor.name == ancestor_name }
27
+ end
28
+ end
29
+
23
30
  class Class < Namespace
24
31
  include Visibility
25
32
  end
@@ -28,6 +35,11 @@ module Rubydex
28
35
  include Visibility
29
36
  end
30
37
 
38
+ class SingletonClass < Namespace
39
+ #: () -> Declaration
40
+ alias_method :attached_class, :owner
41
+ end
42
+
31
43
  class Constant < Declaration
32
44
  include Visibility
33
45
  end
Binary file
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Rubydex
4
- VERSION = "0.2.3"
4
+ VERSION = "0.2.4"
5
5
  end
data/rbi/rubydex.rbi CHANGED
@@ -104,6 +104,9 @@ class Rubydex::Namespace < Rubydex::Declaration
104
104
  sig { returns(T::Enumerable[Rubydex::Namespace]) }
105
105
  def ancestors; end
106
106
 
107
+ sig { params(ancestor_name: String).returns(T::Boolean) }
108
+ def has_ancestor?(ancestor_name); end
109
+
107
110
  sig { returns(T::Enumerable[Rubydex::Namespace]) }
108
111
  def descendants; end
109
112
 
@@ -122,7 +125,11 @@ end
122
125
 
123
126
  class Rubydex::Class < Rubydex::Namespace; end
124
127
  class Rubydex::Module < Rubydex::Namespace; end
125
- class Rubydex::SingletonClass < Rubydex::Namespace; end
128
+
129
+ class Rubydex::SingletonClass < Rubydex::Namespace
130
+ sig { returns(Rubydex::Declaration) }
131
+ def attached_class; end
132
+ end
126
133
 
127
134
  class Rubydex::Definition
128
135
  abstract!
data/rust/Cargo.lock CHANGED
@@ -971,9 +971,9 @@ checksum = "2b15c43186be67a4fd63bee50d0303afffcef381492ebe2c5d87f324e1b8815c"
971
971
 
972
972
  [[package]]
973
973
  name = "rmcp"
974
- version = "0.15.0"
974
+ version = "1.4.0"
975
975
  source = "registry+https://github.com/rust-lang/crates.io-index"
976
- checksum = "1bef41ebc9ebed2c1b1d90203e9d1756091e8a00bbc3107676151f39868ca0ee"
976
+ checksum = "f542f74cf247da16f19bbc87e298cd201e912314f4083e88cdd671f44f5fcb53"
977
977
  dependencies = [
978
978
  "async-trait",
979
979
  "base64",
@@ -993,9 +993,9 @@ dependencies = [
993
993
 
994
994
  [[package]]
995
995
  name = "rmcp-macros"
996
- version = "0.15.0"
996
+ version = "1.6.0"
997
997
  source = "registry+https://github.com/rust-lang/crates.io-index"
998
- checksum = "0e88ad84b8b6237a934534a62b379a5be6388915663c0cc598ceb9b3292bbbfe"
998
+ checksum = "7caa6743cc0888e433105fe1bc551a7f607940b126a37bc97b478e86064627eb"
999
999
  dependencies = [
1000
1000
  "darling",
1001
1001
  "proc-macro2",
@@ -15,7 +15,7 @@ use crate::model::name::{Name, NameRef, ParentScope, ResolvedName};
15
15
  use crate::model::references::{ConstantReference, MethodRef};
16
16
  use crate::model::string_ref::StringRef;
17
17
  use crate::model::visibility::Visibility;
18
- use crate::stats;
18
+ use crate::{query, stats};
19
19
 
20
20
  /// An entity whose validity depends on a particular `NameId`.
21
21
  /// Used as the value type in the `name_dependents` reverse index.
@@ -650,7 +650,7 @@ impl Graph {
650
650
  let definitions = declaration.definitions();
651
651
 
652
652
  match declaration {
653
- Declaration::Namespace(Namespace::Class(_) | Namespace::Module(_))
653
+ Declaration::Namespace(Namespace::Class(_) | Namespace::Module(_) | Namespace::Todo(_))
654
654
  | Declaration::Constant(_)
655
655
  | Declaration::ConstantAlias(_) => {
656
656
  for def_id in definitions.iter().rev() {
@@ -661,25 +661,42 @@ impl Graph {
661
661
  Some(Visibility::Public)
662
662
  }
663
663
  Declaration::Method(_) => {
664
+ let mut latest_alias: Option<DefinitionId> = None;
665
+
664
666
  for def_id in definitions.iter().rev() {
665
667
  let Some(definition) = self.definitions.get(def_id) else {
666
668
  continue;
667
669
  };
670
+
668
671
  let visibility = match definition {
669
672
  Definition::MethodVisibility(vis) => Some(*vis.visibility()),
670
673
  Definition::Method(method) => Some(*method.visibility()),
671
674
  Definition::AttrAccessor(attr) => Some(*attr.visibility()),
672
675
  Definition::AttrReader(attr) => Some(*attr.visibility()),
673
676
  Definition::AttrWriter(attr) => Some(*attr.visibility()),
677
+ Definition::MethodAlias(_) => {
678
+ if latest_alias.is_none() {
679
+ latest_alias = Some(*def_id);
680
+ }
681
+ None
682
+ }
674
683
  _ => None,
675
684
  };
685
+
676
686
  if visibility.is_some() {
677
687
  return visibility;
678
688
  }
679
689
  }
680
- None
690
+
691
+ if let Some(alias_def_id) = latest_alias
692
+ && let Ok(target_id) = query::follow_method_alias(self, alias_def_id)
693
+ {
694
+ return self.visibility(&target_id);
695
+ }
696
+
697
+ Some(Visibility::Public)
681
698
  }
682
- Declaration::Namespace(Namespace::SingletonClass(_) | Namespace::Todo(_))
699
+ Declaration::Namespace(Namespace::SingletonClass(_))
683
700
  | Declaration::GlobalVariable(_)
684
701
  | Declaration::InstanceVariable(_)
685
702
  | Declaration::ClassVariable(_) => None,
@@ -12,7 +12,7 @@ path = "src/main.rs"
12
12
  [dependencies]
13
13
  rubydex = { path = "../rubydex" }
14
14
  clap = { version = "4.5.16", features = ["derive"] }
15
- rmcp = { version = "0.15", features = ["server", "macros", "transport-io", "schemars"] }
15
+ rmcp = { version = "1.4", features = ["server", "macros", "transport-io", "schemars"] }
16
16
  tokio = { version = "1", features = ["macros", "rt", "io-std"] }
17
17
  serde = { version = "1", features = ["derive"] }
18
18
  serde_json = "1"
@@ -565,14 +565,13 @@ Pagination: tools that may return a high number of results include `total` for p
565
565
 
566
566
  Use Grep instead for: literal string search, log messages, comments, non-Ruby files, or content search rather than structural queries."#;
567
567
 
568
- #[tool_handler]
568
+ #[tool_handler(router = self.tool_router)]
569
569
  impl ServerHandler for RubydexServer {
570
570
  fn get_info(&self) -> ServerInfo {
571
- ServerInfo {
572
- instructions: Some(SERVER_INSTRUCTIONS.into()),
573
- capabilities: ServerCapabilities::builder().enable_tools().build(),
574
- ..Default::default()
575
- }
571
+ let mut info = ServerInfo::default();
572
+ info.instructions = Some(SERVER_INSTRUCTIONS.into());
573
+ info.capabilities = ServerCapabilities::builder().enable_tools().build();
574
+ info
576
575
  }
577
576
  }
578
577
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rubydex
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.3
4
+ version: 0.2.4
5
5
  platform: x86_64-linux
6
6
  authors:
7
7
  - Shopify
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2026-05-11 00:00:00.000000000 Z
11
+ date: 2026-05-26 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: A high-performance static analysis suite for Ruby, built in Rust with
14
14
  Ruby APIs