Class: LicenseFinder::LicenseAggregator

Inherits:
Object
  • Object
show all
Defined in:
lib/license_finder/license_aggregator.rb

Instance Method Summary collapse

Constructor Details

#initialize(config, aggregate_paths) ⇒ LicenseAggregator

Returns a new instance of LicenseAggregator.



3
4
5
6
# File 'lib/license_finder/license_aggregator.rb', line 3

def initialize(config, aggregate_paths)
  @config = config
  @aggregate_paths = aggregate_paths
end

Instance Method Details

#any_packages?Boolean

Returns:

  • (Boolean)


12
13
14
15
16
17
# File 'lib/license_finder/license_aggregator.rb', line 12

def any_packages?
  finders.map do |finder|
    finder.prepare_projects if @config.prepare
    finder.any_packages?
  end.reduce(:|)
end

#blacklistedObject



23
24
25
# File 'lib/license_finder/license_aggregator.rb', line 23

def blacklisted
  aggregate_packages.select(&:blacklisted?)
end

#dependenciesObject



8
9
10
# File 'lib/license_finder/license_aggregator.rb', line 8

def dependencies
  aggregate_packages
end

#unapprovedObject



19
20
21
# File 'lib/license_finder/license_aggregator.rb', line 19

def unapproved
  aggregate_packages.reject(&:approved?)
end