File tree Expand file tree Collapse file tree 2 files changed +38
-1
lines changed Expand file tree Collapse file tree 2 files changed +38
-1
lines changed Original file line number Diff line number Diff line change @@ -33,11 +33,12 @@ def initialize_analyzers(logger : NoirLogger)
33
33
{" kotlin_spring" , Kotlin ::Spring },
34
34
{" oas2" , Specification ::Oas2 },
35
35
{" oas3" , Specification ::Oas3 },
36
+ {" raml" , Specification ::RAML },
37
+ {" zap_sites_tree" , Specification ::ZapSitesTree },
36
38
{" php_pure" , Php ::Php },
37
39
{" python_django" , Python ::Django },
38
40
{" python_fastapi" , Python ::FastAPI },
39
41
{" python_flask" , Python ::Flask },
40
- {" raml" , Specification ::RAML },
41
42
{" ruby_hanami" , Ruby ::Hanami },
42
43
{" ruby_rails" , Ruby ::Rails },
43
44
{" ruby_sinatra" , Ruby ::Sinatra },
Original file line number Diff line number Diff line change
1
+ require " ../../../models/analyzer"
2
+
3
+ module Analyzer::Specification
4
+ class ZapSitesTree < Analyzer
5
+ def analyze
6
+ locator = CodeLocator .instance
7
+ sites_trees = locator.all(" zap-sites-tree" )
8
+
9
+ if sites_trees.is_a?(Array (String ))
10
+ sites_trees.each do |sites_tree |
11
+ if File .exists?(sites_tree)
12
+ details = Details .new(PathInfo .new(sites_tree))
13
+ content = File .read(sites_tree, encoding: " utf-8" , invalid: :skip )
14
+ json_obj = JSON .parse(content)
15
+
16
+ begin
17
+ children = json_obj[" children" ].as_h
18
+ if children.size > 0
19
+ process_node(children)
20
+ end
21
+ rescue e
22
+ @logger .debug " Exception of #{ sites_tree } /paths"
23
+ @logger .debug_sub e
24
+ end
25
+ end
26
+ end
27
+ end
28
+
29
+ @result
30
+ end
31
+
32
+ def process_node (children )
33
+ # TODO..
34
+ end
35
+ end
36
+ end
You can’t perform that action at this time.
0 commit comments