lib/rubycritic/report_generators/view_helpers.rb in rubycritic-1.1.1 vs lib/rubycritic/report_generators/view_helpers.rb in rubycritic-1.2.0
- old
+ new
@@ -12,24 +12,24 @@
def stylesheet_path(file)
asset_path("stylesheets/#{file}.css")
end
def asset_path(file)
- relative_path(root_directory + "assets" + file)
+ relative_path("assets/#{file}")
end
def file_path(file)
- relative_path(root_directory + file)
+ relative_path(file)
end
def smell_location_path(location)
file_path("#{location.pathname.sub_ext('.html')}#L#{location.line}")
end
private
- def relative_path(pathname)
- pathname.relative_path_from(file_directory)
+ def relative_path(file)
+ (root_directory + file).relative_path_from(file_directory)
end
def file_directory
raise NotImplementedError.new("The #{self.class} class must implement the #{__method__} method.")
end