Sha256: 963fb9341c11ae03a328b8da57237c89f3b08734609eea1eeb3c456b557caf0c

Contents?: true

Size: 803 Bytes

Versions: 6

Compression:

Stored size: 803 Bytes

Contents

module LicenseFinder
  module Reporter
    extend self

    def write_reports
      dependencies = Dependency.all

      write_file LicenseFinder.config.dependencies_text, TextReport.new(dependencies).to_s
      write_file LicenseFinder.config.dependencies_detailed_text, DetailedTextReport.new(dependencies).to_s
      write_file LicenseFinder.config.dependencies_html, HtmlReport.new(dependencies).to_s
      write_file LicenseFinder.config.dependencies_markdown, MarkdownReport.new(dependencies).to_s

      if File.exists?(LicenseFinder.config.dependencies_legacy_text)
        File.delete(LicenseFinder.config.dependencies_legacy_text)
      end
    end

    private
    def write_file(file_path, content)
      File.open(file_path, 'w+') do |f|
        f.puts content
      end
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
license_finder-0.9.5.1-java lib/license_finder/reports/reporter.rb
license_finder-0.9.5.1 lib/license_finder/reports/reporter.rb
license_finder-0.9.5 lib/license_finder/reports/reporter.rb
license_finder-0.9.5-java lib/license_finder/reports/reporter.rb
license_finder-0.9.4-java lib/license_finder/reports/reporter.rb
license_finder-0.9.4 lib/license_finder/reports/reporter.rb