lib/rubycritic/report_generators/view_helpers.rb in rubycritic-0.0.13 vs lib/rubycritic/report_generators/view_helpers.rb in rubycritic-0.0.14
- old
+ new
@@ -1,5 +1,7 @@
+require "pathname"
+
module Rubycritic
module ViewHelpers
def javascript_path(file)
asset_path(File.join("javascripts", "#{file}.js"))
@@ -11,24 +13,15 @@
def asset_path(file)
File.join(root_directory, "assets", file)
end
- def smell_location_path(location)
- pathname = location.pathname
- File.join(root_directory, "#{pathname.sub_ext('.html')}#L#{location.line}")
+ def file_path(file)
+ File.join(root_directory, Pathname(file).sub_ext(".html"))
end
- def overview_path
- File.join(root_directory, "overview.html")
- end
-
- def code_index_path
- File.join(root_directory, "code_index.html")
- end
-
- def smells_index_path
- File.join(root_directory, "smells_index.html")
+ def smell_location_path(location)
+ File.join(root_directory, "#{location.pathname.sub_ext('.html')}#L#{location.line}")
end
def root_directory
::Rubycritic.configuration.root
end