Class: Rubycritic::BaseGenerator
- Inherits:
-
Object
- Object
- Rubycritic::BaseGenerator
show all
- Includes:
- ViewHelpers
- Defined in:
- lib/rubycritic/report_generators/base_generator.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
#analysed_file_name, #asset_path, #code_index_path, #javascript_path, #overview_path, #root_directory, #smell_location_path, #smells_index_path, #stylesheet_path
Class Method Details
.erb_template(template_path) ⇒ Object
7
8
9
|
# File 'lib/rubycritic/report_generators/base_generator.rb', line 7
def self.erb_template(template_path)
ERB.new(File.read(File.join(TEMPLATES_DIR, template_path)))
end
|
Instance Method Details
#file_directory ⇒ Object
24
25
26
|
# File 'lib/rubycritic/report_generators/base_generator.rb', line 24
def file_directory
root_directory
end
|
#file_href ⇒ Object
16
17
18
|
# File 'lib/rubycritic/report_generators/base_generator.rb', line 16
def file_href
"file://#{file_pathname}"
end
|
#file_name ⇒ Object
28
29
30
|
# File 'lib/rubycritic/report_generators/base_generator.rb', line 28
def file_name
raise NotImplementedError.new("The #{self.class} class must implement the #{__method__} method.")
end
|
#file_pathname ⇒ Object
20
21
22
|
# File 'lib/rubycritic/report_generators/base_generator.rb', line 20
def file_pathname
File.join(file_directory, file_name)
end
|
#get_binding ⇒ Object
36
37
38
|
# File 'lib/rubycritic/report_generators/base_generator.rb', line 36
def get_binding
binding
end
|
#render ⇒ Object
32
33
34
|
# File 'lib/rubycritic/report_generators/base_generator.rb', line 32
def render
raise NotImplementedError.new("The #{self.class} class must implement the #{__method__} method.")
end
|