rails_code_auditor 0.1.1 → 0.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/rails_code_auditor/version.rb +1 -1
- data/lib/rails_code_auditor.rb +20 -2
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 02d182284c325102a56357851f1bf841c265b33d601c7af29726be9c1d3d80e0
|
4
|
+
data.tar.gz: 30afb60183c7b4fbc029b0b3341afac7c7a857364906caebe29d4a1e359f6773
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a5c24bea5bf8a7b816eac7fc88b1d0b38bbb29fe69e0d5a02d9534b96a75b714f15df4ba65fba100c24d112267fee13b25ed13b3eaa096bf59d31ef8f028da72
|
7
|
+
data.tar.gz: 97c13bb474926f97522e39c43fb2f9bf8578d163cef77a697f0c43331fe311f314d207cec80d11ee606f88c073d45a0cc211f1b2cd3f1735fae9ba139b2d40a5
|
data/lib/rails_code_auditor.rb
CHANGED
@@ -19,6 +19,8 @@ module RailsCodeAuditor
|
|
19
19
|
use_llm = args.include?("--use-llm")
|
20
20
|
model_arg = args[args.index("--llm-model") + 1] if args.include?("--llm-model")
|
21
21
|
endpoint_arg = args[args.index("--llm-endpoint") + 1] if args.include?("--llm-endpoint")
|
22
|
+
format_arg = args[args.index("--format") + 1] if args.include?("--format")
|
23
|
+
output_arg = args[args.index("--output") + 1] if args.include?("--output")
|
22
24
|
|
23
25
|
raw_results = Analyzer.run_all
|
24
26
|
results = ReportGenerator.normalize(raw_results)
|
@@ -29,9 +31,25 @@ module RailsCodeAuditor
|
|
29
31
|
else
|
30
32
|
Scorer.score(results)
|
31
33
|
end
|
34
|
+
|
35
|
+
if format_arg == "json"
|
36
|
+
json_output = JSON.pretty_generate({ results: results, scores: scores })
|
37
|
+
if output_arg
|
38
|
+
File.write(output_arg, json_output)
|
39
|
+
puts "[✓] JSON report saved to #{output_arg}"
|
40
|
+
else
|
41
|
+
puts json_output
|
42
|
+
end
|
43
|
+
return
|
44
|
+
end
|
32
45
|
graphs = Grapher.generate(scores)
|
33
46
|
html_pdf_paths = USE_GROVER ? HtmlToPdfConverter.convert_all : []
|
34
|
-
PdfGenerator.generate(results, scores, graphs, html_pdf_paths)
|
35
|
-
|
47
|
+
pdf_path = PdfGenerator.generate(results, scores, graphs, html_pdf_paths)
|
48
|
+
if output_arg
|
49
|
+
FileUtils.mv(pdf_path, output_arg)
|
50
|
+
puts "[✓] PDF report saved to #{output_arg}"
|
51
|
+
else
|
52
|
+
puts "[✓] Audit complete. PDF report generated at #{pdf_path}"
|
53
|
+
end
|
36
54
|
end
|
37
55
|
end
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rails_code_auditor
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- sivamanikandan
|
8
8
|
bindir: exe
|
9
9
|
cert_chain: []
|
10
|
-
date: 2025-
|
10
|
+
date: 2025-08-08 00:00:00.000000000 Z
|
11
11
|
dependencies:
|
12
12
|
- !ruby/object:Gem::Dependency
|
13
13
|
name: brakeman
|
@@ -247,7 +247,7 @@ licenses:
|
|
247
247
|
metadata:
|
248
248
|
allowed_push_host: https://rubygems.org
|
249
249
|
homepage_uri: https://github.com/railsfactory-sivamanikandan/rails_code_auditor
|
250
|
-
|
250
|
+
documentation_uri: https://github.com/railsfactory-sivamanikandan/rails_code_auditor/blob/main/README.md
|
251
251
|
changelog_uri: https://github.com/railsfactory-sivamanikandan/rails_code_auditor/CHANGELOG.md
|
252
252
|
rdoc_options: []
|
253
253
|
require_paths:
|