Class: Rubycritic::Reporter
- Inherits:
-
Object
- Object
- Rubycritic::Reporter
- Defined in:
- lib/rubycritic/report_generators/reporter.rb
Constant Summary collapse
- ASSETS_DIR =
File.("../assets", __FILE__)
Instance Method Summary collapse
- #generate_report ⇒ Object
-
#initialize(source_pathnames, smells, turbulence_data) ⇒ Reporter
constructor
A new instance of Reporter.
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_report ⇒ Object
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 |