Class: Rails::Guarddog::Scanner
- Inherits:
-
Object
- Object
- Rails::Guarddog::Scanner
- Defined in:
- lib/rails/guarddog/scanner.rb
Instance Attribute Summary collapse
-
#configuration ⇒ Object
Returns the value of attribute configuration.
-
#findings ⇒ Object
Returns the value of attribute findings.
Instance Method Summary collapse
-
#initialize(config = nil) ⇒ Scanner
constructor
A new instance of Scanner.
- #run ⇒ Object
Constructor Details
#initialize(config = nil) ⇒ Scanner
Returns a new instance of Scanner.
6 7 8 9 |
# File 'lib/rails/guarddog/scanner.rb', line 6 def initialize(config = nil) @configuration = config || Configuration.new @findings = [] end |
Instance Attribute Details
#configuration ⇒ Object
Returns the value of attribute configuration.
4 5 6 |
# File 'lib/rails/guarddog/scanner.rb', line 4 def configuration @configuration end |
#findings ⇒ Object
Returns the value of attribute findings.
4 5 6 |
# File 'lib/rails/guarddog/scanner.rb', line 4 def findings @findings end |
Instance Method Details
#run ⇒ Object
11 12 13 14 15 16 17 18 |
# File 'lib/rails/guarddog/scanner.rb', line 11 def run load_checkers.each do |checker_class| checker = checker_class.new(@configuration.root) checker.run @findings.concat(checker.findings) end @findings.sort_by { |f| severity_order(f.severity) } end |