Sha256: 37e8228c2ea75f92932927c939e0414b0b3200ee66ba4fd07adab9ffe5c9223d

Contents?: true

Size: 583 Bytes

Versions: 8

Compression:

Stored size: 583 Bytes

Contents

require "fileutils"

module Rubycritic
  module Reporter

    class Base
      ASSETS_DIR = File.expand_path("../../report_generators/assets", __FILE__)

      def create_directories_and_files(generators)
        Array(generators).each do |generator|
          FileUtils.mkdir_p(generator.file_directory)
          File.open(generator.file_pathname, "w+") do |file|
            file.write(generator.render)
          end
        end
      end

      def copy_assets_to_report_directory
        FileUtils.cp_r(ASSETS_DIR, ::Rubycritic.configuration.root)
      end
    end

  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
rubycritic-1.1.1 lib/rubycritic/reporters/base.rb
rubycritic-1.1.0 lib/rubycritic/reporters/base.rb
rubycritic-1.0.2 lib/rubycritic/reporters/base.rb
rubycritic-1.0.1 lib/rubycritic/reporters/base.rb
rubycritic-1.0.0 lib/rubycritic/reporters/base.rb
rubycritic-0.0.16 lib/rubycritic/reporters/base.rb
rubycritic-0.0.15 lib/rubycritic/reporters/base.rb
rubycritic-0.0.14 lib/rubycritic/reporters/base.rb