Class: Rubycritic::Reporter

Inherits:
Object
  • Object
show all
Defined in:
lib/rubycritic/report_generators/reporter.rb

Constant Summary collapse

ASSETS_DIR =
File.expand_path("../assets", __FILE__)

Instance Method Summary collapse

Constructor Details

#initialize(source_pathnames, smells, turbulence_data) ⇒ Reporter

Returns a new instance of Reporter.



13
14
15
16
17
18
# File 'lib/rubycritic/report_generators/reporter.rb', line 13

def initialize(source_pathnames, smells, turbulence_data)
  @source_pathnames = source_pathnames
  @smells = smells
  @turbulence_data = turbulence_data
  @smelly_pathnames = pathnames_to_files_with_smells
end

Instance Method Details

#generate_reportObject



20
21
22
23
24
25
26
27
28
29
# File 'lib/rubycritic/report_generators/reporter.rb', line 20

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, ::Rubycritic.configuration.root)
  overview_generator.file_href
end