class Sprockets::Base

def logical_path_for_filename(filename, filters)

def logical_path_for_filename(filename, filters)
  logical_path = attributes_for(filename).logical_path.to_s
  if matches_filter(filters, logical_path)
    return logical_path
  end
  # If filename is an index file, retest with alias
  if File.basename(logical_path)[/[^\.]+/, 0] == 'index'
    path = logical_path.sub(/\/index\./, '.')
    if matches_filter(filters, path)
      return path
    end
  end
  nil
end