@@ -65,28 +65,10 @@ class ImportCode[T <: Project](console: io.joern.console.Console[T])(implicit
6565 def csharp : Frontend = new BinaryFrontend (" csharp" , Languages .CSHARP , " C# Source Frontend (Roslyn)" )
6666 def llvm : Frontend = new BinaryFrontend (" llvm" , Languages .LLVM , " LLVM Bitcode Frontend" )
6767 def php : SourceBasedFrontend = new SourceBasedFrontend (" php" , Languages .PHP , " PHP source frontend" , " php" )
68- def ruby : SourceBasedFrontend = new RubyFrontend (" Ruby source frontend" , false )
69- def rubyDeprecated : SourceBasedFrontend = new RubyFrontend (" Ruby source deprecated frontend" , true )
68+ def ruby : SourceBasedFrontend = SourceBasedFrontend (" ruby" , Languages .RUBYSRC , " Ruby source frontend" , " rb" )
7069
7170 private def allFrontends : List [Frontend ] =
72- List (
73- c,
74- cpp,
75- ghidra,
76- kotlin,
77- java,
78- jvm,
79- javascript,
80- jssrc,
81- swiftsrc,
82- golang,
83- llvm,
84- php,
85- python,
86- csharp,
87- ruby,
88- rubyDeprecated
89- )
71+ List (c, cpp, ghidra, kotlin, java, jvm, javascript, jssrc, swiftsrc, golang, llvm, php, python, csharp, ruby)
9072
9173 // this is only abstract to force people adding frontends to make a decision whether the frontend consumes binaries or source
9274 abstract class Frontend (val name : String , val language : String , val description : String = " " )(implicit
@@ -140,30 +122,6 @@ class ImportCode[T <: Project](console: io.joern.console.Console[T])(implicit
140122 }
141123 }
142124
143- /** Only a wrapper so as to more easily pick the deprecated variant without having to provide the
144- * `--useDeprecatedFrontend` flag each time.
145- *
146- * @param useDeprecatedFrontend
147- * If set, will invoke the frontend with the `--useDeprecatedFrontend` flag
148- */
149- private class RubyFrontend (description : String , useDeprecatedFrontend : Boolean = false )
150- extends SourceBasedFrontend (" ruby" , Languages .RUBYSRC , description, " rb" ) {
151- private val deprecatedFlag = " --useDeprecatedFrontend"
152-
153- private def addDeprecatedFlagIfNeeded (args : List [String ]): List [String ] = {
154- Option .when(useDeprecatedFrontend && ! args.contains(deprecatedFlag))(deprecatedFlag).toList ++ args
155- }
156-
157- override def cpgGeneratorForLanguage (
158- language : String ,
159- config : FrontendConfig ,
160- rootPath : Path ,
161- args : List [String ]
162- ): Option [CpgGenerator ] = {
163- super .cpgGeneratorForLanguage(language, config, rootPath, addDeprecatedFlagIfNeeded(args))
164- }
165- }
166-
167125 class SwiftSrcFrontend (name : String , language : String , description : String , extension : String )
168126 extends SourceBasedFrontend (name, language, description, extension) {
169127 override def apply (inputPath : String , projectName : String , args : List [String ]): Cpg = {
0 commit comments