| Crates.io | codegraph-ruby |
| lib.rs | codegraph-ruby |
| version | 0.1.0 |
| created_at | 2026-01-18 08:48:10.353381+00 |
| updated_at | 2026-01-18 08:48:10.353381+00 |
| description | Ruby parser for CodeGraph - extracts code entities and relationships from Ruby source files |
| homepage | |
| repository | https://github.com/anvanster/codegraph |
| max_upload_size | |
| id | 2052065 |
| size | 99,839 |
Ruby parser for CodeGraph - extracts code entities and relationships from Ruby source files.
use codegraph_ruby::RubyParser;
use codegraph_parser_api::CodeParser;
use codegraph::CodeGraph;
use std::path::Path;
fn main() -> Result<(), Box<dyn std::error::Error>> {
let mut graph = CodeGraph::in_memory()?;
let parser = RubyParser::new();
let file_info = parser.parse_file(Path::new("app.rb"), &mut graph)?;
println!("Parsed {} methods", file_info.functions.len());
println!("Parsed {} classes", file_info.classes.len());
Ok(())
}
| Ruby Construct | Maps To |
|---|---|
class |
ClassEntity |
module |
TraitEntity |
def |
FunctionEntity |
def self. |
FunctionEntity (with is_static=true) |
require |
ImportRelation |
require_relative |
ImportRelation |
< (inheritance) |
InheritanceRelation |
include |
ImplementationRelation |
extend |
ImplementationRelation |
prepend |
ImplementationRelation |
Apache-2.0