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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 3c49c4ea0d69a65cc4f68add6d1ba70b4ae35f4df1099ccf3d920be37d540b3f
4
- data.tar.gz: ee58b9a08573ae7d47d15ab7d8188fd768d83c11d8a9e35e71ee0dbe511acf45
3
+ metadata.gz: e9039102f1515cf998b7912bc94cb82f002f2f94acfc2158e77321f0ffbb9af1
4
+ data.tar.gz: 7fb92f2bdc470b21c2e31068bcdb6944b19a49073bd07fb76a404c95c0eff452
5
5
  SHA512:
6
- metadata.gz: 50d9586e1bb88b11087bc3538c1d89459d99ffdf42001f5998eab5b86d8c6bad006e29d7ca64724693c5fcc6a5087353fb82f101881d9ac9f6a2560306cda858
7
- data.tar.gz: 8668aa0e2808b835b85dfa5aae308fc3cf4386f696316bd9b89d2c140b93c2cb7bd97d643328030e8737be0a4e6dc30a7f3fa3410fd00feef3083443e348ad33
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
- finding[:file] = file
36
- findings << finding
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]
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module QueryGuard
4
- VERSION = "0.5.1"
4
+ VERSION = "0.5.2"
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: query_guard
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.1
4
+ version: 0.5.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Chitradevi36