class Sinatra::Base

def extensions

Extension modules registered on this class and all superclasses.
def extensions
  if superclass.respond_to?(:extensions)
    (@extensions + superclass.extensions).uniq
  else
    @extensions
  end
end