rubydex 0.1.0.beta12-aarch64-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 +7 -0
- data/LICENSE.txt +23 -0
- data/README.md +125 -0
- data/THIRD_PARTY_LICENSES.html +4562 -0
- data/exe/rdx +47 -0
- data/ext/rubydex/declaration.c +453 -0
- data/ext/rubydex/declaration.h +23 -0
- data/ext/rubydex/definition.c +284 -0
- data/ext/rubydex/definition.h +28 -0
- data/ext/rubydex/diagnostic.c +6 -0
- data/ext/rubydex/diagnostic.h +11 -0
- data/ext/rubydex/document.c +97 -0
- data/ext/rubydex/document.h +10 -0
- data/ext/rubydex/extconf.rb +138 -0
- data/ext/rubydex/graph.c +681 -0
- data/ext/rubydex/graph.h +10 -0
- data/ext/rubydex/handle.h +44 -0
- data/ext/rubydex/location.c +22 -0
- data/ext/rubydex/location.h +15 -0
- data/ext/rubydex/reference.c +123 -0
- data/ext/rubydex/reference.h +15 -0
- data/ext/rubydex/rubydex.c +22 -0
- data/ext/rubydex/utils.c +108 -0
- data/ext/rubydex/utils.h +34 -0
- data/lib/rubydex/3.2/rubydex.so +0 -0
- data/lib/rubydex/3.3/rubydex.so +0 -0
- data/lib/rubydex/3.4/rubydex.so +0 -0
- data/lib/rubydex/4.0/rubydex.so +0 -0
- data/lib/rubydex/comment.rb +17 -0
- data/lib/rubydex/diagnostic.rb +21 -0
- data/lib/rubydex/failures.rb +15 -0
- data/lib/rubydex/graph.rb +98 -0
- data/lib/rubydex/keyword.rb +17 -0
- data/lib/rubydex/keyword_parameter.rb +13 -0
- data/lib/rubydex/librubydex_sys.so +0 -0
- data/lib/rubydex/location.rb +90 -0
- data/lib/rubydex/mixin.rb +22 -0
- data/lib/rubydex/version.rb +5 -0
- data/lib/rubydex.rb +23 -0
- data/rbi/rubydex.rbi +422 -0
- data/rust/Cargo.lock +1851 -0
- data/rust/Cargo.toml +29 -0
- data/rust/about.hbs +78 -0
- data/rust/about.toml +10 -0
- data/rust/rubydex/Cargo.toml +42 -0
- data/rust/rubydex/src/compile_assertions.rs +13 -0
- data/rust/rubydex/src/diagnostic.rs +110 -0
- data/rust/rubydex/src/errors.rs +28 -0
- data/rust/rubydex/src/indexing/local_graph.rs +224 -0
- data/rust/rubydex/src/indexing/rbs_indexer.rs +1551 -0
- data/rust/rubydex/src/indexing/ruby_indexer.rs +2329 -0
- data/rust/rubydex/src/indexing/ruby_indexer_tests.rs +4962 -0
- data/rust/rubydex/src/indexing.rs +210 -0
- data/rust/rubydex/src/integrity.rs +279 -0
- data/rust/rubydex/src/job_queue.rs +205 -0
- data/rust/rubydex/src/lib.rs +17 -0
- data/rust/rubydex/src/listing.rs +371 -0
- data/rust/rubydex/src/main.rs +160 -0
- data/rust/rubydex/src/model/built_in.rs +83 -0
- data/rust/rubydex/src/model/comment.rs +24 -0
- data/rust/rubydex/src/model/declaration.rs +671 -0
- data/rust/rubydex/src/model/definitions.rs +1682 -0
- data/rust/rubydex/src/model/document.rs +222 -0
- data/rust/rubydex/src/model/encoding.rs +22 -0
- data/rust/rubydex/src/model/graph.rs +3754 -0
- data/rust/rubydex/src/model/id.rs +110 -0
- data/rust/rubydex/src/model/identity_maps.rs +58 -0
- data/rust/rubydex/src/model/ids.rs +60 -0
- data/rust/rubydex/src/model/keywords.rs +256 -0
- data/rust/rubydex/src/model/name.rs +298 -0
- data/rust/rubydex/src/model/references.rs +111 -0
- data/rust/rubydex/src/model/string_ref.rs +50 -0
- data/rust/rubydex/src/model/visibility.rs +41 -0
- data/rust/rubydex/src/model.rs +15 -0
- data/rust/rubydex/src/offset.rs +147 -0
- data/rust/rubydex/src/position.rs +6 -0
- data/rust/rubydex/src/query.rs +1841 -0
- data/rust/rubydex/src/resolution.rs +6517 -0
- data/rust/rubydex/src/stats/memory.rs +71 -0
- data/rust/rubydex/src/stats/orphan_report.rs +264 -0
- data/rust/rubydex/src/stats/timer.rs +127 -0
- data/rust/rubydex/src/stats.rs +11 -0
- data/rust/rubydex/src/test_utils/context.rs +226 -0
- data/rust/rubydex/src/test_utils/graph_test.rs +730 -0
- data/rust/rubydex/src/test_utils/local_graph_test.rs +602 -0
- data/rust/rubydex/src/test_utils.rs +52 -0
- data/rust/rubydex/src/visualization/dot.rs +192 -0
- data/rust/rubydex/src/visualization.rs +6 -0
- data/rust/rubydex/tests/cli.rs +185 -0
- data/rust/rubydex-mcp/Cargo.toml +28 -0
- data/rust/rubydex-mcp/src/main.rs +48 -0
- data/rust/rubydex-mcp/src/server.rs +1145 -0
- data/rust/rubydex-mcp/src/tools.rs +49 -0
- data/rust/rubydex-mcp/tests/mcp.rs +302 -0
- data/rust/rubydex-sys/Cargo.toml +20 -0
- data/rust/rubydex-sys/build.rs +14 -0
- data/rust/rubydex-sys/cbindgen.toml +12 -0
- data/rust/rubydex-sys/src/declaration_api.rs +485 -0
- data/rust/rubydex-sys/src/definition_api.rs +443 -0
- data/rust/rubydex-sys/src/diagnostic_api.rs +99 -0
- data/rust/rubydex-sys/src/document_api.rs +85 -0
- data/rust/rubydex-sys/src/graph_api.rs +948 -0
- data/rust/rubydex-sys/src/lib.rs +79 -0
- data/rust/rubydex-sys/src/location_api.rs +79 -0
- data/rust/rubydex-sys/src/name_api.rs +135 -0
- data/rust/rubydex-sys/src/reference_api.rs +267 -0
- data/rust/rubydex-sys/src/utils.rs +70 -0
- data/rust/rustfmt.toml +2 -0
- metadata +159 -0
checksums.yaml
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
---
|
|
2
|
+
SHA256:
|
|
3
|
+
metadata.gz: 7cac26cfbab4ecd0c141547cfda39af90b28fbb723274f6499fa3318963a8e60
|
|
4
|
+
data.tar.gz: 47d8325df6b6797ab0fd3a113f3b94386b9289c929f4d69620851bb98140d8e7
|
|
5
|
+
SHA512:
|
|
6
|
+
metadata.gz: 233caa506bfa762c33cc0d44ac4fe5c86e851790e5bf519fd1d4eafd57e6b6043e53d9c9f123ee86726a5560356a40e935fab57346b8399cf10e06ba86f808ec
|
|
7
|
+
data.tar.gz: fcc375aec9c47db0b92944330d47b8a5ebbff4d119c152c39d4cb75081a4e752c55a8d33ee00a3eee2e364d60f47fee3ff79123c192416846f9906bb208bff91
|
data/LICENSE.txt
ADDED
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
The MIT License (MIT)
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2025-present, Shopify Inc.
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in
|
|
13
|
+
all copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
21
|
+
THE SOFTWARE.
|
|
22
|
+
|
|
23
|
+
See the generated THIRD_PARTY_LICENSES.html file for third party licenses.
|
data/README.md
ADDED
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
# Rubydex
|
|
2
|
+
|
|
3
|
+
This project is a high performance static analysis toolkit for the Ruby language. The goal is to be a solid
|
|
4
|
+
foundation to power a variety of tools, such as type checkers, linters, language servers and more.
|
|
5
|
+
|
|
6
|
+
## Usage
|
|
7
|
+
|
|
8
|
+
Both Ruby and Rust APIs are made available through a gem and a crate, respectively. Here's a simple example
|
|
9
|
+
of using the Ruby API:
|
|
10
|
+
|
|
11
|
+
```ruby
|
|
12
|
+
# Create a new graph representing the current workspace
|
|
13
|
+
graph = Rubydex::Graph.new
|
|
14
|
+
# Configuring graph LSP encoding
|
|
15
|
+
graph.encoding = "utf16"
|
|
16
|
+
# Index the entire workspace with all dependencies
|
|
17
|
+
graph.index_workspace
|
|
18
|
+
# Or index specific file paths
|
|
19
|
+
graph.index_all(["path/to/file.rb"])
|
|
20
|
+
# Transform the initially collected information into its semantic understanding by running resolution
|
|
21
|
+
graph.resolve
|
|
22
|
+
# Get all diagnostics acquired during the analysis
|
|
23
|
+
graph.diagnostics
|
|
24
|
+
|
|
25
|
+
# Iterating over graph nodes
|
|
26
|
+
graph.declarations
|
|
27
|
+
graph.documents
|
|
28
|
+
graph.constant_references
|
|
29
|
+
graph.method_references
|
|
30
|
+
|
|
31
|
+
# Analyzing require paths
|
|
32
|
+
graph.resolve_require_path("rails/engine", load_paths) # => document pointed by `rails/engine`
|
|
33
|
+
graph.require_paths(load_paths) # => array of all indexed require paths
|
|
34
|
+
|
|
35
|
+
# Querying
|
|
36
|
+
graph["Foo"] # Get declaration by fully qualified name
|
|
37
|
+
graph.search("Foo#b") # Name search
|
|
38
|
+
graph.resolve_constant("Bar", ["Foo", "Baz::Qux"]) # Resolve constant reference based on nesting
|
|
39
|
+
|
|
40
|
+
# Declarations
|
|
41
|
+
declaration = graph["Foo"]
|
|
42
|
+
|
|
43
|
+
# All declarations include
|
|
44
|
+
declaration.name
|
|
45
|
+
declaration.unqualified_name
|
|
46
|
+
declaration.definitions
|
|
47
|
+
declaration.owner
|
|
48
|
+
|
|
49
|
+
# Namespace declarations include
|
|
50
|
+
declaration.member("bar()")
|
|
51
|
+
declaration.member("@ivar")
|
|
52
|
+
declaration.singleton_class
|
|
53
|
+
declaration.ancestors
|
|
54
|
+
declaration.descendants
|
|
55
|
+
|
|
56
|
+
# Documents
|
|
57
|
+
document = graph.documents.first
|
|
58
|
+
document.uri
|
|
59
|
+
document.definitions # => list of definitions discovered in this document
|
|
60
|
+
|
|
61
|
+
# Definitions
|
|
62
|
+
definition = declaration.definitions.first
|
|
63
|
+
definition.location
|
|
64
|
+
definition.comments
|
|
65
|
+
definition.name
|
|
66
|
+
definition.deprecated?
|
|
67
|
+
definition.name_location
|
|
68
|
+
|
|
69
|
+
# Locations
|
|
70
|
+
location = definition.location
|
|
71
|
+
location.path
|
|
72
|
+
|
|
73
|
+
# Diagnostics
|
|
74
|
+
diagnostic = graph.diagnostics.first
|
|
75
|
+
diagnostic.rule
|
|
76
|
+
diagnostic.message
|
|
77
|
+
diagnostic.location
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
## MCP Server (Experimental)
|
|
81
|
+
|
|
82
|
+
Rubydex can run as an MCP (Model Context Protocol) server, enabling AI assistants
|
|
83
|
+
like Claude to semantically query your Ruby codebase.
|
|
84
|
+
|
|
85
|
+
### Setup
|
|
86
|
+
|
|
87
|
+
1. Install the binary:
|
|
88
|
+
```bash
|
|
89
|
+
cargo install --path rust/rubydex-mcp
|
|
90
|
+
```
|
|
91
|
+
|
|
92
|
+
2. Add rubydex to the Ruby project you want to index:
|
|
93
|
+
```bash
|
|
94
|
+
claude mcp add --scope project rubydex "\${HOME}/.cargo/bin/rubydex_mcp"
|
|
95
|
+
```
|
|
96
|
+
|
|
97
|
+
Or manually create a `.mcp.json` in the project root:
|
|
98
|
+
```json
|
|
99
|
+
{
|
|
100
|
+
"mcpServers": {
|
|
101
|
+
"rubydex": {
|
|
102
|
+
"command": "${HOME}/.cargo/bin/rubydex_mcp"
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
```
|
|
107
|
+
|
|
108
|
+
3. Start Claude Code from that project directory. The MCP server indexes
|
|
109
|
+
the project at startup and provides semantic code intelligence tools.
|
|
110
|
+
Verify with `/mcp` in the session.
|
|
111
|
+
|
|
112
|
+
### Available MCP Tools
|
|
113
|
+
|
|
114
|
+
| Tool | Description |
|
|
115
|
+
|------|-------------|
|
|
116
|
+
| `search_declarations` | Fuzzy search for classes, modules, methods, constants |
|
|
117
|
+
| `get_declaration` | Full details by fully qualified name with docs, ancestors, members |
|
|
118
|
+
| `get_descendants` | What classes/modules inherit from or include this one |
|
|
119
|
+
| `find_constant_references` | All precise, resolved constant references across the codebase |
|
|
120
|
+
| `get_file_declarations` | List declarations defined in a specific file |
|
|
121
|
+
| `codebase_stats` | High-level statistics about the indexed codebase |
|
|
122
|
+
|
|
123
|
+
## Contributing
|
|
124
|
+
|
|
125
|
+
See [the contributing documentation](CONTRIBUTING.md).
|