Sha256: fa85fba05a855f404cbb5af0035fa7fb418c2765188231c6c973b07de047cf2c
Contents?: true
Size: 1.13 KB
Versions: 4
Compression:
Stored size: 1.13 KB
Contents
require "rubycritic/report_generators/base_generator" require "rubycritic/report_generators/file_generator" require "rubycritic/report_generators/index_generator" require "fileutils" module Rubycritic class Reporter ASSETS_DIR = File.expand_path("../assets", __FILE__) def initialize(source_pathnames, smelly_pathnames) @source_pathnames = source_pathnames @smelly_pathnames = smelly_pathnames end def generate_report generators.each do |generator| FileUtils.mkdir_p(generator.file_directory) File.open(generator.file_pathname, "w+") do |file| file.write(generator.render) end end FileUtils.cp_r(ASSETS_DIR, BaseGenerator::REPORT_DIR) index_generator.file_href end private def generators file_generators + [index_generator] end def index_generator @index_generator ||= IndexGenerator.new(file_generators) end def file_generators @file_generators ||= @source_pathnames.map do |pathname| file_smells = @smelly_pathnames[pathname] FileGenerator.new(pathname, file_smells) end end end end
Version data entries
4 entries across 4 versions & 1 rubygems