Sha256: 49d90fd5c937def7dd836618a88592a516f698c65ec110be753a1426d92a48b0

Contents?: true

Size: 960 Bytes

Versions: 1

Compression:

Stored size: 960 Bytes

Contents

module Rubycritic

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

    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 file_name method.")
    end

    def javascript_path(file)
      File.join(REPORT_DIR, "assets/javascripts/#{file}.js")
    end

    def stylesheet_path(file)
      File.join(REPORT_DIR, "assets/stylesheets/#{file}.css")
    end

    def index_path
      File.join(REPORT_DIR, "index.html")
    end

    def get_binding
      binding
    end
  end

end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
rubycritic-0.0.4 lib/rubycritic/report_generators/base_generator.rb