module RestCore
the simplest middleware
Constants
- Universal
- VERSION
Public Class Methods
eagerload(const=self, loaded={})
click to toggle source
You might want to call this before launching your application in a threaded environment to avoid thread-safety issue in autoload.
# File lib/rest-core.rb, line 53 def self.eagerload const=self, loaded={} return if loaded[const.name] loaded[const.name] = true const.constants(false).each{ |n| begin c = const.const_get(n) rescue LoadError, NameError => e warn "RestCore: WARN: #{e} for #{const}\n" \ " from #{e.backtrace.grep(/top.+required/).first}" end eagerload(c, loaded) if c.respond_to?(:constants) && !loaded[n] } end