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, smelly_pathnames) ⇒ Reporter
constructor
A new instance of Reporter.
Constructor Details
#initialize(source_pathnames, smelly_pathnames) ⇒ Reporter
Returns a new instance of Reporter.
11 12 13 14 |
# File 'lib/rubycritic/report_generators/reporter.rb', line 11 def initialize(source_pathnames, smelly_pathnames) @source_pathnames = source_pathnames @smelly_pathnames = smelly_pathnames end |
Instance Method Details
#generate_report ⇒ Object
16 17 18 19 20 21 22 23 24 |
# File 'lib/rubycritic/report_generators/reporter.rb', line 16 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) end |