Sha256: 4d2acb6a663db60521c3193407c34872a29bdbfa125248de9465d9f1f1d6bb10

Contents?: true

Size: 535 Bytes

Versions: 30

Compression:

Stored size: 535 Bytes

Contents

# frozen_string_literal: true

require 'rubycritic/generators/json/simple'

module RubyCritic
  module Generator
    class JsonReport
      def initialize(analysed_modules)
        @analysed_modules = analysed_modules
      end

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

      private

      def generator
        Json::Simple.new(@analysed_modules)
      end
    end
  end
end

Version data entries

30 entries across 30 versions & 2 rubygems

Version Path
rubycritic-4.8.0 lib/rubycritic/generators/json_report.rb
rubycritic-4.7.0 lib/rubycritic/generators/json_report.rb
rubycritic-4.6.1 lib/rubycritic/generators/json_report.rb
rubycritic-4.6.0 lib/rubycritic/generators/json_report.rb
rubycritic-4.5.2 lib/rubycritic/generators/json_report.rb
rubycritic-4.5.1 lib/rubycritic/generators/json_report.rb
rubycritic-4.5.0 lib/rubycritic/generators/json_report.rb
rubycritic-4.4.1 lib/rubycritic/generators/json_report.rb
rubycritic-4.4.0 lib/rubycritic/generators/json_report.rb
rubycritic-4.3.3 lib/rubycritic/generators/json_report.rb
rubycritic-4.3.2 lib/rubycritic/generators/json_report.rb
rubycritic-4.3.1 lib/rubycritic/generators/json_report.rb
rubycritic-4.3.0 lib/rubycritic/generators/json_report.rb
rubycritic-4.2.2 lib/rubycritic/generators/json_report.rb
rubycritic-4.2.1 lib/rubycritic/generators/json_report.rb
rubycritic-4.2.0 lib/rubycritic/generators/json_report.rb
rubycritic-simplecov-4.1.1 lib/rubycritic/generators/json_report.rb
rubycritic-simplecov-4.1.0 lib/rubycritic/generators/json_report.rb
rubycritic-4.1.0 lib/rubycritic/generators/json_report.rb
rubycritic-4.0.2 lib/rubycritic/generators/json_report.rb