class RubyCritic::Generator::Html::Base

Constants

LAYOUT_TEMPLATE
TEMPLATES_DIR

Public Class Methods

erb_template(template_path) click to toggle source
# File lib/rubycritic/generators/html/base.rb, line 11
def self.erb_template(template_path)
  ERB.new(File.read(File.join(TEMPLATES_DIR, template_path)))
end

Public Instance Methods

file_directory() click to toggle source
# File lib/rubycritic/generators/html/base.rb, line 28
def file_directory
  @file_directory ||= root_directory
end
file_href() click to toggle source
# File lib/rubycritic/generators/html/base.rb, line 20
def file_href
  "file:///#{file_pathname}"
end
file_name() click to toggle source
# File lib/rubycritic/generators/html/base.rb, line 32
def file_name
  raise NotImplementedError,
        "The #{self.class} class must implement the #{__method__} method."
end
file_pathname() click to toggle source
# File lib/rubycritic/generators/html/base.rb, line 24
def file_pathname
  File.join(file_directory, file_name)
end
render() click to toggle source
# File lib/rubycritic/generators/html/base.rb, line 37
def render
  raise NotImplementedError,
        "The #{self.class} class must implement the #{__method__} method."
end

Private Instance Methods

base_binding() click to toggle source
# File lib/rubycritic/generators/html/base.rb, line 48
def base_binding
  binding
end
root_directory() click to toggle source
# File lib/rubycritic/generators/html/base.rb, line 44
def root_directory
  @root_directory ||= Pathname.new(Config.root)
end