Class: Package::Audit::CommandParser
- Inherits:
-
Object
- Object
- Package::Audit::CommandParser
- Defined in:
- lib/package/audit/services/command_parser.rb
Instance Method Summary collapse
-
#initialize(dir, options, report) ⇒ CommandParser
constructor
A new instance of CommandParser.
- #run ⇒ Object
Constructor Details
#initialize(dir, options, report) ⇒ CommandParser
Returns a new instance of CommandParser.
16 17 18 19 20 21 22 |
# File 'lib/package/audit/services/command_parser.rb', line 16 def initialize(dir, , report) @dir = dir = @report = report @config = parse_config_file @technologies = parse_technologies end |
Instance Method Details
#run ⇒ Object
24 25 26 27 28 29 30 31 32 33 34 35 |
# File 'lib/package/audit/services/command_parser.rb', line 24 def run cumulative_pkgs = [] @technologies.each do |technology| all_pkgs, ignored_pkgs = PackageFinder.new(@config, @dir, @report).run(technology) ignored_pkgs = [] if [Enum::Option::INCLUDE_IGNORED] cumulative_pkgs << all_pkgs print_results(technology, (all_pkgs || []) - (ignored_pkgs || []), ignored_pkgs || []) end cumulative_pkgs.any? end |