Skip to content

Commit c4a7389

Browse files
committed
Ruby: Move extractor into shared crate
This makes it possible for different languages to share this extractor.
1 parent 71c37db commit c4a7389

File tree

17 files changed

+40
-3
lines changed

17 files changed

+40
-3
lines changed

ruby/extractor/Cargo.lock

Lines changed: 17 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

ruby/extractor/Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,3 +22,4 @@ lazy_static = "1.4.0"
2222
serde = { version = "1.0", features = ["derive"] }
2323
serde_json = "1.0"
2424
chrono = { version = "0.4.19", features = ["serde"] }
25+
codeql-extractor = { path = "../../shared/extractor" }

ruby/extractor/src/bin/extractor.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ use std::io::BufRead;
1111
use std::path::{Path, PathBuf};
1212
use tree_sitter::{Language, Parser, Range};
1313

14-
use ruby_extractor::{diagnostics, extractor, file_paths, node_types, trap};
14+
use codeql_extractor::{diagnostics, extractor, file_paths, node_types, trap};
1515

1616
/**
1717
* Gets the number of threads the extractor should use, by reading the

ruby/extractor/src/bin/generator.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@ use std::io::LineWriter;
66
use std::io::Write;
77
use std::path::PathBuf;
88

9-
use ruby_extractor::generator::{dbscheme, language::Language, ql, ql_gen};
10-
use ruby_extractor::node_types;
9+
use codeql_extractor::generator::{dbscheme, language::Language, ql, ql_gen};
10+
use codeql_extractor::node_types;
1111

1212
/// Given the name of the parent node, and its field information, returns a pair,
1313
/// the first of which is the field's type. The second is an optional dbscheme

shared/extractor/.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
/target
2+
/Cargo.lock

shared/extractor/Cargo.toml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
[package]
2+
name = "codeql-extractor"
3+
version = "0.1.0"
4+
edition = "2021"
5+
authors = ["GitHub"]
6+
7+
[dependencies]
8+
flate2 = "1.0"
9+
tree-sitter = "0.20"
10+
tracing = "0.1"
11+
rayon = "1.5.0"
12+
regex = "1.7.1"
13+
encoding = "0.2"
14+
lazy_static = "1.4.0"
15+
serde = { version = "1.0", features = ["derive"] }
16+
serde_json = "1.0"
17+
chrono = { version = "0.4.19", features = ["serde"] }
File renamed without changes.
File renamed without changes.

0 commit comments

Comments
 (0)