Class: Package::Audit::PackageFinder

Inherits:
Object
  • Object
show all
Defined in:
lib/package/audit/services/package_finder.rb

Instance Method Summary collapse

Constructor Details

#initialize(config, dir, report, groups) ⇒ PackageFinder

Returns a new instance of PackageFinder.



14
15
16
17
18
19
# File 'lib/package/audit/services/package_finder.rb', line 14

def initialize(config, dir, report, groups)
  @config = config
  @dir = dir
  @report = report
  @groups = groups
end

Instance Method Details

#run(technology) ⇒ Object



21
22
23
24
25
26
27
# File 'lib/package/audit/services/package_finder.rb', line 21

def run(technology)
  all_pkgs = find_by_technology(technology)
  ignored_by_group_pkgs = filter_pkgs_based_on_group(all_pkgs)
  active_pkgs = all_pkgs - ignored_by_group_pkgs
  ignored_by_config_pkgs = filter_pkgs_based_on_config(active_pkgs)
  [active_pkgs, ignored_by_config_pkgs]
end