class Filters::ResourcesFilter

Public: Static resource filter.

Public Instance Methods

filter(index, link, base_uri) click to toggle source

Public: Filters out static resources.

Returns the link if it should be indexed else nil.

# File lib/sitemap/filters/filters.rb, line 196
def filter(index, link, base_uri)
  link = Filters::Util.make_URI(link)
  if link.nil? || link.path.nil? || link.path.to_s.empty?
    return true
  end
  return true unless link.path.to_s.match(/.*\.[a-zA-Z0-9_\-\s]+(?!\/)$/)
  log.debug("Rejecting link #{link} as it is a static resource #{link.path}")
  false
end