Method: RDoc::Servlet#do_GET

Defined in:
lib/rdoc/servlet.rb

#do_GET(req, res) ⇒ Object

GET request entry point. Fills in res for the path, etc. in req.



119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
# File 'lib/rdoc/servlet.rb', line 119

def do_GET req, res
  req.path.sub!(/\A#{Regexp.escape @mount_path}/, '') if @mount_path

  case req.path
  when '/' then
    root req, res
  when '/js/darkfish.js', '/js/jquery.js', '/js/search.js',
       %r%^/css/%, %r%^/images/%, %r%^/fonts/% then
    asset :darkfish, req, res
  when '/js/navigation.js', '/js/searcher.js' then
    asset :json_index, req, res
  when '/js/search_index.js' then
    root_search req, res
  else
    show_documentation req, res
  end
rescue WEBrick::HTTPStatus::NotFound => e
  generator = generator_for RDoc::Store.new

  not_found generator, req, res, e.message
rescue WEBrick::HTTPStatus::Status
  raise
rescue => e
  error e, req, res
end