-
Notifications
You must be signed in to change notification settings - Fork 1
/
clouseau.go
36 lines (27 loc) · 963 Bytes
/
clouseau.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
package main
import (
"flag"
"fmt"
"github.com/senorprogrammer/clouseau/display"
"github.com/senorprogrammer/clouseau/modules"
)
/* -------------------- Main -------------------- */
func main() {
path := flag.String("dir", "./", "Path to Rails application")
flag.Parse()
fmt.Println("Running clouseau...")
railsConfChecker := modules.NewRailsConfigChecker(*path)
railsConfChecker.Run()
configChecker := modules.NewConfigChecker("Config", *path, `AppConfig\.?[A-Za-z_]+`)
envVarChecker := modules.NewConfigChecker("ENV Vars", *path, `ENV\[(.*?)\]`)
figaroChecker := modules.NewConfigChecker("Figaro", *path, `Figaro\.env?[A-Za-z._]+`)
checkbox := modules.Checkbox{Path: *path}
checkbox.Append(configChecker)
checkbox.Append(figaroChecker)
checkbox.Append(envVarChecker)
checkbox.Run()
/* HTML rendering */
display := display.NewHtmlData(envVarChecker, configChecker, figaroChecker, railsConfChecker)
display.Render()
display.Show()
}