Sha256: e71d774639081e5f64a4b670223bd71baa4d4d89804826d3086f014aaa11bad5

Contents?: true

Size: 819 Bytes

Versions: 3

Compression:

Stored size: 819 Bytes

Contents

require "rubycritic/report_generators/view_helpers"

module Rubycritic

  class BaseGenerator
    REPORT_DIR = File.expand_path("tmp/rubycritic", Dir.getwd)
    TEMPLATES_DIR = File.expand_path("../templates", __FILE__)

    include ViewHelpers

    def file_href
      "file://#{file_pathname}"
    end

    def file_pathname
      File.join(file_directory, file_name)
    end

    def file_directory
      raise NotImplementedError.new("You must implement the file_directory method.")
    end

    def file_name
      raise NotImplementedError.new("You must implement the file_name method.")
    end

    def render
      raise NotImplementedError.new("You must implement the render method.")
    end

    def get_binding
      binding
    end

    private

    def root_directory
      REPORT_DIR
    end
  end

end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
rubycritic-0.0.7 lib/rubycritic/report_generators/base_generator.rb
rubycritic-0.0.6 lib/rubycritic/report_generators/base_generator.rb
rubycritic-0.0.5 lib/rubycritic/report_generators/base_generator.rb