def load_dir(dir)
      logger.debug { "Loading the class definitions in #{dir}..." }
      # Import the classes.
      srcs = sources(dir)
      # Introspect and load the classes in reverse class order, i.e. superclass before subclass.
      klasses = srcs.keys.transitive_closure { |k| [k.superclass] }.select { |k| srcs[k] }.reverse
      # Introspect the classes as necessary.
      klasses.each { |klass| add_metadata(klass) unless introspected?(klass) }
      # Load the classes.
      klasses.each do |klass|
        file = srcs[klass]
        load_definition(klass, file)
      end
      logger.debug { "Loaded the class definitions in #{dir}." }
    end
def load_dir(dir)
      logger.debug { "Loading the class definitions in #{dir}..." }
      # Import the classes.
      srcs = sources(dir)
      # Introspect and load the classes in reverse class order, i.e. superclass before subclass.
      klasses = srcs.keys.transitive_closure { |k| [k.superclass] }.select { |k| srcs[k] }.reverse
      # Introspect the classes as necessary.
      klasses.each { |klass| add_metadata(klass) unless introspected?(klass) }
      # Load the classes.
      klasses.each do |klass|
        file = srcs[klass]
        load_definition(klass, file)
      end
      logger.debug { "Loaded the class definitions in #{dir}." }
    end
Loads the Ruby source files in the given directory.

 @param [String] dir the source directory