class Sinatra::Base

def provides(*types)

Condition for matching mimetypes. Accepts file extensions.
def provides(*types)
  types.map! { |t| mime_types(t) }
  types.flatten!
  condition do
    if type = request.preferred_type(types)
      content_type(type)
      true
    else
      false
    end
  end
end