Skip to content

Commit

Permalink
[version] Bump joern version (#7)
Browse files Browse the repository at this point in the history
  • Loading branch information
AndreiDreyer authored Apr 26, 2024
1 parent 3e632db commit 3568504
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 33 deletions.
4 changes: 2 additions & 2 deletions build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ ThisBuild / scalaVersion := "3.4.1"

// parsed by project/Versions.scala, updated by updateDependencies.sh
val cpgVersion = "1.6.11"
val joernVersion = "2.0.339"
val overflowdbVersion = "1.191"
val joernVersion = "2.0.344"
val overflowdbVersion = "1.192"

lazy val schema = Projects.schema
lazy val domainClasses = Projects.domainClasses
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package io.joern.typestubs.ruby
import better.files.File
import io.joern.typestubs.OutputFormat
import io.joern.x2cpg.Defines
import io.joern.x2cpg.datastructures.{FieldLike, MethodLike, TypeLike}
import io.joern.rubysrc2cpg.datastructures.{RubyMethod, RubyType}
import io.joern.x2cpg.utils.ConcurrentTaskUtil
import net.ruippeixotog.scalascraper.browser.JsoupBrowser
import net.ruippeixotog.scalascraper.dsl.DSL.*
Expand All @@ -15,36 +15,6 @@ import scala.annotation.targetName
import scala.util.{Failure, Success}
import upickle.default.*

// TODO: Remove when the ReadWriter changes are released on Joern
case class RubyMethod(
name: String,
parameterTypes: List[(String, String)],
returnType: String,
baseTypeFullName: Option[String]
) extends MethodLike

object RubyMethod {
implicit val rubyMethodRwJson: ReadWriter[RubyMethod] = readwriter[ujson.Value].bimap[RubyMethod](
x => ujson.Obj("name" -> x.name),
json => RubyMethod(json("name").str, List.empty, "", Option.empty)
)
}

case class RubyField(name: String, typeName: String) extends FieldLike derives ReadWriter

case class RubyType(name: String, methods: List[RubyMethod], fields: List[RubyField])
extends TypeLike[RubyMethod, RubyField] derives ReadWriter {

@targetName("add")
override def +(o: TypeLike[RubyMethod, RubyField]): TypeLike[RubyMethod, RubyField] = {
this.copy(methods = mergeMethods(o), fields = mergeFields(o))
}

def hasConstructor: Boolean = {
methods.exists(_.name == Defines.ConstructorMethodName)
}
}

/** Class to scrape and generate Ruby Namespace Map for builtin Ruby packages from https://ruby-doc.org
* @param rubyVersion
* \- Ruby version to fetch dependencies for
Expand Down

0 comments on commit 3568504

Please sign in to comment.