require 'dissident' class Nukumi2::DefaultRegistry < Dissident::Container def page(view, flavor) Nukumi2::Page.new(view, flavor) end # Make this a :prototype if you want dynamic template loading. # (no cache!) def engine(flavor) Tangerine::XML.new(",,@page", Nukumi2::FlavorTagLib.new(flavor)) end def webrick s = WEBrick::HTTPServer.new(:Port => 2000) s.mount("/data", WEBrick::HTTPServlet::FileHandler, File.expand_path("data"), {:FancyIndexing => true}) s.mount("/graphics", WEBrick::HTTPServlet::FileHandler, File.expand_path("graphics"), {:FancyIndexing => true}) s end # provide :blog, Nukumi2::Blog def blog Nukumi2::Blog.new end def backends Kernel.abort "No backends given! (Replace with a namespace)" end def all_backends backends.values end def configparser Nukumi2::ConfigParser.new "config.rb" end provide :blogconfig, Nukumi2::ConfigParser::Blog def config begin container.configparser.load rescue warn "Error loading config file: #{$!.inspect}" raise end end def show_last container.config.show_last || 15 end def default_flavor container.config.default_flavor || 'html' end provide :topictree, Topical::TopicTree def registry container end end PluginLoader.new(File.join(File.dirname(__FILE__), "plugins")).load! PluginLoader.new("plugins").load!