Class: RubyCritic::Generator::Html::Base
- Inherits:
-
Object
- Object
- RubyCritic::Generator::Html::Base
show all
- Includes:
- ViewHelpers
- Defined in:
- lib/rubycritic/generators/html/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, #image_path, #javascript_tag, #smell_location_path, #stylesheet_path, #timeago_tag
Class Method Details
.erb_template(template_path) ⇒ Object
10
11
12
|
# File 'lib/rubycritic/generators/html/base.rb', line 10
def self.erb_template(template_path)
ERB.new(File.read(File.join(TEMPLATES_DIR, template_path)))
end
|
Instance Method Details
#file_directory ⇒ Object
27
28
29
|
# File 'lib/rubycritic/generators/html/base.rb', line 27
def file_directory
@file_directory ||= root_directory
end
|
#file_href ⇒ Object
19
20
21
|
# File 'lib/rubycritic/generators/html/base.rb', line 19
def file_href
"file://#{file_pathname}"
end
|
#file_name ⇒ Object
31
32
33
34
|
# File 'lib/rubycritic/generators/html/base.rb', line 31
def file_name
raise NotImplementedError,
"The #{self.class} class must implement the #{__method__} method."
end
|
#file_pathname ⇒ Object
23
24
25
|
# File 'lib/rubycritic/generators/html/base.rb', line 23
def file_pathname
File.join(file_directory, file_name)
end
|
#render ⇒ Object
36
37
38
39
|
# File 'lib/rubycritic/generators/html/base.rb', line 36
def render
raise NotImplementedError,
"The #{self.class} class must implement the #{__method__} method."
end
|