Module: Rubycritic::ViewHelpers
- Included in:
- BaseGenerator
- Defined in:
- lib/rubycritic/report_generators/view_helpers.rb
Instance Method Summary collapse
- #analysed_file_name(pathname) ⇒ Object
- #asset_path(file) ⇒ Object
- #code_index_path ⇒ Object
- #javascript_path(file) ⇒ Object
- #overview_path ⇒ Object
- #root_directory ⇒ Object
- #smell_location_path(location) ⇒ Object
- #smells_index_path ⇒ Object
- #stylesheet_path(file) ⇒ Object
Instance Method Details
#analysed_file_name(pathname) ⇒ Object
37 38 39 |
# File 'lib/rubycritic/report_generators/view_helpers.rb', line 37 def analysed_file_name(pathname) pathname.basename.sub_ext("") end |
#asset_path(file) ⇒ Object
12 13 14 |
# File 'lib/rubycritic/report_generators/view_helpers.rb', line 12 def asset_path(file) File.join(root_directory, "assets", file) end |
#code_index_path ⇒ Object
25 26 27 |
# File 'lib/rubycritic/report_generators/view_helpers.rb', line 25 def code_index_path File.join(root_directory, "code_index.html") end |
#javascript_path(file) ⇒ Object
4 5 6 |
# File 'lib/rubycritic/report_generators/view_helpers.rb', line 4 def javascript_path(file) asset_path(File.join("javascripts", "#{file}.js")) end |
#overview_path ⇒ Object
21 22 23 |
# File 'lib/rubycritic/report_generators/view_helpers.rb', line 21 def overview_path File.join(root_directory, "overview.html") end |
#root_directory ⇒ Object
33 34 35 |
# File 'lib/rubycritic/report_generators/view_helpers.rb', line 33 def root_directory ::Rubycritic.configuration.root end |
#smell_location_path(location) ⇒ Object
16 17 18 19 |
# File 'lib/rubycritic/report_generators/view_helpers.rb', line 16 def smell_location_path(location) pathname = location.pathname File.join(root_directory, "#{pathname.sub_ext('.html')}#L#{location.line}") end |
#smells_index_path ⇒ Object
29 30 31 |
# File 'lib/rubycritic/report_generators/view_helpers.rb', line 29 def smells_index_path File.join(root_directory, "smells_index.html") end |
#stylesheet_path(file) ⇒ Object
8 9 10 |
# File 'lib/rubycritic/report_generators/view_helpers.rb', line 8 def stylesheet_path(file) asset_path(File.join("stylesheets", "#{file}.css")) end |