Permalink
Browse files

updated webrick dispatcher and initializer for recent changes to disp…

…atcher
  • Loading branch information...
1 parent c26238d commit decf68c2375f9c06eda6ab01ffd93cdfa3a48ec8 @jlong committed Nov 21, 2009
Showing with 4 additions and 2 deletions.
  1. +2 −1 lib/acoustic/initializer.rb
  2. +2 −1 lib/acoustic/webrick_dispatcher.rb
@@ -1,14 +1,15 @@
module Acoustic
class Initializer
- attr_accessor :project_root, :config
+ attr_accessor :project_root, :config, :router
def initialize(project_root)
@project_root = project_root
add_load_path project_root
add_load_path project_root + "/lib"
require "acoustic"
@config = Settings.new
+ @router = Router.load(project_root + "/urls.rb")
initialize_configuration
end
@@ -7,7 +7,8 @@ class DispatchServlet < WEBrick::HTTPServlet::AbstractServlet
def initialize(server, options)
@initializer = Initializer.instance
@file_handler = WEBrick::HTTPServlet::FileHandler.new(server, options[:server_root])
- @dispatcher = Acoustic::Dispatcher.new(@initializer.project_root, @initializer.config)
+ @router = @initializer.router
+ @dispatcher = Acoustic::Dispatcher.new(@router)
end
def service(request, response)

0 comments on commit decf68c

Please sign in to comment.