Sha256: b9f4d46256f7efe59928a11d1714eb1a48ada0a19b090a7eb251dfe02d871b53

Contents?: true

Size: 1.15 KB

Versions: 1

Compression:

Stored size: 1.15 KB

Contents

require "rubycritic/reporters/base"
require "rubycritic/report_generators/overview"
require "rubycritic/report_generators/smells_index"
require "rubycritic/report_generators/code_index"
require "rubycritic/report_generators/code_file"

module Rubycritic
  module Reporter

    class Main < Base
      def initialize(analysed_files, smells)
        @analysed_files = analysed_files
        @smells = smells
      end

      def generate_report
        create_directories_and_files(generators)
        copy_assets_to_report_directory
        overview_generator.file_href
      end

      private

      def generators
        [overview_generator, code_index_generator, smells_index_generator] + file_generators
      end

      def overview_generator
        @overview_generator ||= Generator::Overview.new(@analysed_files)
      end

      def code_index_generator
        Generator::CodeIndex.new(@analysed_files)
      end

      def smells_index_generator
        Generator::SmellsIndex.new(@smells)
      end

      def file_generators
        @analysed_files.map do |analysed_file|
          Generator::CodeFile.new(analysed_file)
        end
      end
    end

  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
rubycritic-0.0.14 lib/rubycritic/reporters/main.rb