Permalink
Browse files

create once the view

  • Loading branch information...
1 parent d5bd2aa commit bc361869df548bdda94a64a264a2aaab530d0c0d @seki committed Sep 2, 2011
Showing with 3 additions and 3 deletions.
  1. +3 −3 sample/demo4book/demo_ui_webrick.rb
@@ -22,11 +22,11 @@ class DemoListView
end
class DemoUIServlet < WEBrick::HTTPServlet::AbstractServlet
- def initialize(server, crawler, indexer)
+ def initialize(server, crawler, indexer, list_view)
super(server)
@crawler = crawler
@indexer = indexer
- @list_view = DemoListView.new
+ @list_view = list_view
end
def req_query(req, key)
@@ -62,7 +62,7 @@ def do_GET(req, res)
server = WEBrick::HTTPServer.new({:Port => 10080,
:BindAddress => '127.0.0.1'})
- server.mount('/', DemoUIServlet, crawler, indexer)
+ server.mount('/', DemoUIServlet, crawler, indexer, DemoListView.new)
trap('INT') { server.shutdown }
server.start
crawler.quit

0 comments on commit bc36186

Please sign in to comment.