Commit 7f18cc4 1 parent 1037e42 commit 7f18cc4 Copy full SHA for 7f18cc4
File tree 1 file changed +12
-0
lines changed
platform/frontends/x2cpg/src/main/scala/io/appthreat/x2cpg/passes/taggers
1 file changed +12
-0
lines changed Original file line number Diff line number Diff line change @@ -119,12 +119,24 @@ class ChennaiTagsPass(atom: Cpg) extends CpgPass(atom):
119
119
).store()(dstGraph)
120
120
}
121
121
end tagPhpRoutes
122
+ private def tagRubyRoutes (dstGraph : DiffGraphBuilder ): Unit =
123
+ atom.method.where(
124
+ _.filename(" config/routes.rb" ).code(
125
+ " .*(get|post|put|delete|head|option|resources|namespace).*"
126
+ )
127
+ ).newTagNode(
128
+ FRAMEWORK_ROUTE
129
+ ).store()(dstGraph)
130
+ atom.method.filename(" .*controller.rb.*" ).parameter.newTagNode(FRAMEWORK_INPUT ).store()(
131
+ dstGraph
132
+ )
122
133
override def run (dstGraph : DiffGraphBuilder ): Unit =
123
134
if language == Languages .PYTHON || language == Languages .PYTHONSRC then
124
135
tagPythonRoutes(dstGraph)
125
136
if language == Languages .NEWC || language == Languages .C then
126
137
tagCRoutes(dstGraph)
127
138
if language == Languages .PHP then tagPhpRoutes(dstGraph)
139
+ if language == Languages .RUBYSRC then tagRubyRoutes(dstGraph)
128
140
atom.configFile(" chennai.json" ).content.foreach { cdxData =>
129
141
val ctagsJson = parse(cdxData).getOrElse(Json .Null )
130
142
val cursor : HCursor = ctagsJson.hcursor
You can’t perform that action at this time.
0 commit comments