Sha256: 32b25528d4fe09d81da162953915da1dcf98e02363ff0002e75a721224666b86

Contents?: true

Size: 743 Bytes

Versions: 16

Compression:

Stored size: 743 Bytes

Contents

module LicenseFinder
  class LicenseAggregator
    def initialize(license_finder_config, subprojects)
      @license_finder_config = license_finder_config
      @subprojects = subprojects
    end

    def dependencies
      aggregate_packages
        .group_by { |package| [package.name, package.version] }
        .map do |_, packages|
          MergedPackage.new(packages[0].dependency, packages.flat_map(&:subproject_paths))
        end
    end

    private

    def aggregate_packages
      @subprojects.flat_map do |project_path|
        finder = LicenseFinder::Core.new(@license_finder_config.merge(project_path: project_path))
        finder.acknowledged.map { |dep| MergedPackage.new(dep, [project_path]) }
      end
    end
  end
end

Version data entries

16 entries across 16 versions & 1 rubygems

Version Path
license_finder-3.0.4 lib/license_finder/license_aggregator.rb
license_finder-3.0.2 lib/license_finder/license_aggregator.rb
license_finder-3.0.1 lib/license_finder/license_aggregator.rb
license_finder-3.0.0 lib/license_finder/license_aggregator.rb
license_finder-2.1.2 lib/license_finder/license_aggregator.rb
license_finder-2.1.1 lib/license_finder/license_aggregator.rb
license_finder-2.1.0 lib/license_finder/license_aggregator.rb
license_finder-2.1.0.rc9 lib/license_finder/license_aggregator.rb
license_finder-2.1.0.rc8 lib/license_finder/license_aggregator.rb
license_finder-2.1.0.rc7 lib/license_finder/license_aggregator.rb
license_finder-2.1.0.rc6 lib/license_finder/license_aggregator.rb
license_finder-2.1.0.rc5 lib/license_finder/license_aggregator.rb
license_finder-2.1.0.rc4 lib/license_finder/license_aggregator.rb
license_finder-2.1.0.rc3 lib/license_finder/license_aggregator.rb
license_finder-2.1.0.rc2 lib/license_finder/license_aggregator.rb
license_finder-2.1.0.rc1 lib/license_finder/license_aggregator.rb