class Syntropy::Router

def initialize(opts, module_loader = nil)

def initialize(opts, module_loader = nil)
  raise 'Invalid location given' if !File.directory?(opts[:location])
  @opts = opts
  @machine = opts[:machine]
  @root = File.expand_path(opts[:location])
  @mount_path = opts[:mount_path] || '/'
  @rel_path_re ||= /^#{@root}/
  @module_loader = module_loader
  @cache        = {} # maps url path to route entry
  @routes       = {} # maps canonical path to route entry (actual routes)
  @files        = {} # maps filename to entry
  @deps         = {} # maps filenames to array of dependent entries
  @x  = {} # maps directories to hook chains
  scan_routes
end