Class: RubyCritic::Generator::JsonReport

Inherits:
Object
  • Object
show all
Defined in:
lib/rubycritic/generators/json_report.rb

Instance Method Summary collapse

Constructor Details

#initialize(analysed_modules) ⇒ JsonReport

Returns a new instance of JsonReport.


8
9
10
# File 'lib/rubycritic/generators/json_report.rb', line 8

def initialize(analysed_modules)
  @analysed_modules = analysed_modules
end

Instance Method Details

#generate_reportObject


12
13
14
15
16
17
# File 'lib/rubycritic/generators/json_report.rb', line 12

def generate_report
  FileUtils.mkdir_p(generator.file_directory)
  File.open(generator.file_pathname, 'w+') do |file|
    file.write(generator.render)
  end
end