test.rb

module Olelo
  # Main class of the application
  class Application
    include Util
    include Hooks
    include ErrorHandler
    include Routing
    include ApplicationHelper

    patterns path: Page::PATH_PATTERN
    attr_reader :page
    attr_setter :on_error

    has_around_hooks :routing, :action, :login_buttons,
                     :edit_buttons, :attributes_buttons, :upload_buttons
    has_hooks :auto_login, :render, :menu, :head

    def self.reserved_path?(path)
      path = '/' + path.cleanpath
      path.starts_with?('/static') ||
      router.any? do |method, r|
        r.any? do |name,pattern,keys,function|
          name !~ /^\/\(?:path\)?$/ && pattern.match(path)
        end
      end
    end