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.



5
6
7
8
# File 'lib/license_finder/license_aggregator.rb', line 5

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

Instance Method Details

#any_packages?Boolean

Returns:

  • (Boolean)


14
15
16
17
18
19
# File 'lib/license_finder/license_aggregator.rb', line 14

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

#dependenciesObject



10
11
12
# File 'lib/license_finder/license_aggregator.rb', line 10

def dependencies
  aggregate_packages
end

#restrictedObject



25
26
27
# File 'lib/license_finder/license_aggregator.rb', line 25

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

#unapprovedObject



21
22
23
# File 'lib/license_finder/license_aggregator.rb', line 21

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