Class: Rubycritic::Generator::Base
- Inherits:
-
Object
- Object
- Rubycritic::Generator::Base
show all
- Includes:
- ViewHelpers
- Defined in:
- lib/rubycritic/report_generators/base.rb
Constant Summary
collapse
- TEMPLATES_DIR =
File.expand_path("../templates", __FILE__)
- LAYOUT_TEMPLATE =
erb_template(File.join("layouts", "application.html.erb"))
Class Method Summary
collapse
Instance Method Summary
collapse
#asset_path, #file_path, #javascript_tag, #smell_location_path, #stylesheet_path, #timeago_tag
Class Method Details
.erb_template(template_path) ⇒ Object
8
9
10
|
# File 'lib/rubycritic/report_generators/base.rb', line 8
def self.erb_template(template_path)
ERB.new(File.read(File.join(TEMPLATES_DIR, template_path)))
end
|
Instance Method Details
#file_directory ⇒ Object
25
26
27
|
# File 'lib/rubycritic/report_generators/base.rb', line 25
def file_directory
@file_directory ||= root_directory
end
|
#file_href ⇒ Object
17
18
19
|
# File 'lib/rubycritic/report_generators/base.rb', line 17
def file_href
"file://#{file_pathname}"
end
|
#file_name ⇒ Object
29
30
31
|
# File 'lib/rubycritic/report_generators/base.rb', line 29
def file_name
raise NotImplementedError.new("The #{self.class} class must implement the #{__method__} method.")
end
|
#file_pathname ⇒ Object
21
22
23
|
# File 'lib/rubycritic/report_generators/base.rb', line 21
def file_pathname
File.join(file_directory, file_name)
end
|
#render ⇒ Object
33
34
35
|
# File 'lib/rubycritic/report_generators/base.rb', line 33
def render
raise NotImplementedError.new("The #{self.class} class must implement the #{__method__} method.")
end
|