~ubuntu-branches/ubuntu/wily/ruby-ferret/wily

« back to all changes in this revision

Viewing changes to lib/ferret/browser/webrick.rb

  • Committer: Bazaar Package Importer
  • Author(s): Antonio Terceiro
  • Date: 2011-07-28 00:02:49 UTC
  • Revision ID: james.westby@ubuntu.com-20110728000249-v0443y69ftcpxwi6
Tags: upstream-0.11.6
ImportĀ upstreamĀ versionĀ 0.11.6

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
module WEBrick
 
2
  class FerretBrowserHandler < WEBrick::HTTPServlet::AbstractServlet
 
3
    # Creates a FerretBrowserHandler, which answers for the application
 
4
    # within +klass+.
 
5
    def initialize(server, reader, path)
 
6
        super(server)
 
7
        @delegator = Ferret::Browser::Delegator.new(reader, path)
 
8
    end
 
9
    # Handler for WEBrick requests (also aliased as do_POST).
 
10
    def do_GET(req, res)
 
11
      res.status, res.content_type, res.body = @delegator.run(req.meta_vars)
 
12
    end
 
13
  end
 
14
end