query_guard 0.5.1 → 0.5.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/query_guard/cli/command.rb +15 -2
- data/lib/query_guard/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: e9039102f1515cf998b7912bc94cb82f002f2f94acfc2158e77321f0ffbb9af1
|
|
4
|
+
data.tar.gz: 7fb92f2bdc470b21c2e31068bcdb6944b19a49073bd07fb76a404c95c0eff452
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 764cd0bc1304751ab303313cd9bd34f9ef9f675551eb32de9c0b30088a65ffc9f3a5403eb9303ff1e8f51d6834521ca31488716c61c155dcc1708b6e1595eea2
|
|
7
|
+
data.tar.gz: da30bd2ff0ad091ca5479f8b38d83db8690180a8166a3b9ab3ff363d2de22ade3d9380297c2dbadb21e7333c2ec367f7f6abff5411d5ac51e02a38a2e9ac3544
|
|
@@ -32,8 +32,21 @@ module QueryGuard
|
|
|
32
32
|
begin
|
|
33
33
|
file_findings = analyzer.analyze_migration(file)
|
|
34
34
|
file_findings.each do |finding|
|
|
35
|
-
|
|
36
|
-
|
|
35
|
+
# Normalize Finding objects to Hash for Formatter compatibility
|
|
36
|
+
if finding.respond_to?(:to_json_h)
|
|
37
|
+
h = finding.to_json_h
|
|
38
|
+
elsif finding.respond_to?(:to_h)
|
|
39
|
+
h = finding.to_h
|
|
40
|
+
else
|
|
41
|
+
h = finding
|
|
42
|
+
end
|
|
43
|
+
|
|
44
|
+
# Ensure file path is present on the hash
|
|
45
|
+
if h.is_a?(Hash)
|
|
46
|
+
h[:file_path] ||= file
|
|
47
|
+
end
|
|
48
|
+
|
|
49
|
+
findings << h
|
|
37
50
|
end
|
|
38
51
|
rescue => e
|
|
39
52
|
puts "Warning: Failed to analyze #{file}: #{e.message}" if @options[:verbose]
|
data/lib/query_guard/version.rb
CHANGED