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


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

def initialize(analysed_modules)
  @analysed_modules = analysed_modules
end

Instance Method Details

#generate_reportObject


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

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