Class: IdentityNowRuleValidator
- Inherits:
-
Object
- Object
- IdentityNowRuleValidator
- Defined in:
- lib/identitynow_rule_validator.rb
Constant Summary collapse
- @@findings =
This will collect findings for each file.
[]
- @@filesCount =
This holds details about the files.
0
- @@rules =
These are the rules which are used for validation.
[]
- @@previousFile =
This will help determine if we’re still showing findings for the same file.
nil
Class Method Summary collapse
- .validate_directory(directory) ⇒ Object
- .validate_file(file) ⇒ Object
- .validate_files(files) ⇒ Object
Class Method Details
.validate_directory(directory) ⇒ Object
27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 |
# File 'lib/identitynow_rule_validator.rb', line 27 def self.validate_directory( directory ) self.initialize puts "Validating files from directory: #{directory}" Dir.glob( File.join( directory + '**/*.xml' ) ).each do |file| self.analyze_file( file ) end # files.each do |file| self.report_findings return @@findings end |
.validate_file(file) ⇒ Object
67 68 69 70 71 72 73 74 75 76 77 78 79 |
# File 'lib/identitynow_rule_validator.rb', line 67 def self.validate_file( file ) self.initialize puts "Validating file: #{file}" self.analyze_file( file ) self.report_findings return @@findings end |
.validate_files(files) ⇒ Object
45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 |
# File 'lib/identitynow_rule_validator.rb', line 45 def self.validate_files( files ) self.initialize puts "Validating files: #{files}" if ( !files.nil? && !files.empty? ) files.each do |file| self.analyze_file( file ) end # files.each do |file| end # if ( !files.nil? && !files.empty? ) self.report_findings return @@findings end |