Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[ruby] Builtin type-stubs for Ruby #4501

Merged
merged 18 commits into from
Apr 30, 2024
Merged
Changes from 1 commit
Commits
Show all changes
18 commits
Select commit Hold shift + click to select a range
19d3188
[ruby] download of type-stubs and putting in resources dir working
AndreiDreyer Apr 25, 2024
5663527
[ruby] working on getting resources fro stage
AndreiDreyer Apr 25, 2024
4cc3d92
[ruby] type-stubs checksums are working as expected from build step. …
AndreiDreyer Apr 25, 2024
929d781
Merge branch 'master' into andrei/ruby/pull-type-stubs
AndreiDreyer Apr 25, 2024
71baac8
[ruby] Reading directly from zip working
AndreiDreyer Apr 25, 2024
1ce29a8
[ruby] Reading of builtin type-stubs working
AndreiDreyer Apr 26, 2024
a273d89
[ruby] Renamed functions for builtin types. Added builtin types to in…
AndreiDreyer Apr 26, 2024
386e242
[ruby] working on type resolving via the namespace type map
AndreiDreyer Apr 29, 2024
5e82aed
Merge branch 'master' into andrei/ruby/pull-type-stubs
AndreiDreyer Apr 29, 2024
e84a846
[ruby] finished tests on typesmap for builtin_types
AndreiDreyer Apr 29, 2024
ca5ea6e
Merge branch 'master' into andrei/ruby/pull-type-stubs
AndreiDreyer Apr 29, 2024
496cd15
[ruby] Adding some debugging
AndreiDreyer Apr 30, 2024
246666a
[workflows] disabling cache for testing
AndreiDreyer Apr 30, 2024
1f36092
[workflows] re-enabled cache
AndreiDreyer Apr 30, 2024
d03e664
[ruby] added loggers for debugging
AndreiDreyer Apr 30, 2024
1f8da02
Aligned type stubs closer to AstGen Strategy
DavidBakerEffendi Apr 30, 2024
50d6c75
[ruby] remove debug logs from build
AndreiDreyer Apr 30, 2024
2f68991
Merge branch 'master' into andrei/ruby/pull-type-stubs
AndreiDreyer Apr 30, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
[ruby] Adding some debugging
AndreiDreyer committed Apr 30, 2024

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
commit 496cd15c83cdd99318ea3a9ac8db6854a1e8606d
3 changes: 3 additions & 0 deletions joern-cli/frontends/rubysrc2cpg/build.sbt
Original file line number Diff line number Diff line change
@@ -62,6 +62,9 @@ joernTypeStubsDlTask := {
val distDir = (Universal / stagingDirectory).value / "builtin_types"
distDir.mkdirs()
IO.copyDirectory(joernTypeStubsDir, distDir)

println(s"Type Stubs DIR: ${joernTypeStubsDir.list().mkString("Array(", ", ", ")")}")
println(s"Type Stubs Files: ${joernTypeStubsDir.listFiles().mkString("Array(", ", ", ")")}")
}

Compile / compile := ((Compile / compile) dependsOn joernTypeStubsDlTask).value
Original file line number Diff line number Diff line change
@@ -54,6 +54,7 @@ object RubyProgramSummary {
val resourcePaths: List[String] =
Option(getClass.getClassLoader.getResource(builtinDirectory)) match {
case Some(url) if url.getProtocol == "jar" =>
logger.info("Reading from JAR")
val connection = url.openConnection.asInstanceOf[JarURLConnection]
Using.resource(connection.getJarFile) { jarFile =>
jarFile
@@ -66,6 +67,7 @@ object RubyProgramSummary {
.filter(_.endsWith(".zip"))
}
case _ =>
logger.info("Reading from builtin_dir")
Source
.fromResource(builtinDirectory)
.getLines()