class RDoc::Servlet

def installed_docs

def installed_docs
  extra_counter = 0
  ri_paths.map do |path, type|
    store = RDoc::Store.new path, type
    exists = File.exist? store.cache_path
    case type
    when :gem then
      gem_path = path[%r%/([^/]*)/ri$%, 1]
      [gem_path, "#{gem_path}/", exists, type, path]
    when :system then
      ['Ruby Documentation', 'ruby/', exists, type, path]
    when :site then
      ['Site Documentation', 'site/', exists, type, path]
    when :home then
      ['Home Documentation', 'home/', exists, type, path]
    when :extra then
      extra_counter += 1
      store.load_cache if exists
      title = store.title || "Extra Documentation"
      [title, "extra-#{extra_counter}/", exists, type, path]
    end
  end
end