lib/resugan/kernel.rb in resugan-0.1.2 vs lib/resugan/kernel.rb in resugan-0.1.4

- old
+ new

@@ -1,9 +1,17 @@ module Resugan class Kernel + def self.set_default_dispatcher(dispatcher) + @default_dispatcher ||= dispatcher.new + end + + def self.default_dispatcher + @default_dispatcher || Resugan::Engine::InlineDispatcher.new + end + def self.dispatcher_for(namespace = '') @dispatchers = {} unless @dispatchers - @dispatchers[namespace] || Resugan::Engine::InlineDispatcher.new + @dispatchers[namespace] || default_dispatcher end def self.register_dispatcher(dispatcher, namespace = '') @dispatchers = {} unless @dispatchers @dispatchers[namespace] = dispatcher