aboutsummaryrefslogtreecommitdiffstats
path: root/lib/rdoc
diff options
context:
space:
mode:
Diffstat (limited to 'lib/rdoc')
-rw-r--r--lib/rdoc/generator/darkfish.rb7
-rw-r--r--lib/rdoc/servlet.rb12
2 files changed, 10 insertions, 9 deletions
diff --git a/lib/rdoc/generator/darkfish.rb b/lib/rdoc/generator/darkfish.rb
index bd0f617d84..b69d14855a 100644
--- a/lib/rdoc/generator/darkfish.rb
+++ b/lib/rdoc/generator/darkfish.rb
@@ -467,7 +467,7 @@ class RDoc::Generator::Darkfish
render_template template_file do |io| binding end
rescue => e
error = RDoc::Error.new \
- "error generating servlet_root: #{e.message} (#{e.class})"
+ "error generating servlet_not_found: #{e.message} (#{e.class})"
error.set_backtrace e.backtrace
raise error
@@ -484,13 +484,10 @@ class RDoc::Generator::Darkfish
debug_msg 'Rendering the servlet root page...'
- rel_prefix = rel_prefix = ''
+ rel_prefix = asset_rel_prefix = '.'
search_index_rel_prefix = rel_prefix
search_index_rel_prefix += @asset_rel_path if @file_output
- # suppress 1.9.3 warning
- asset_rel_prefix = asset_rel_prefix = ''
-
@title = 'Local RDoc Documentation'
render_template template_file do |io| binding end
diff --git a/lib/rdoc/servlet.rb b/lib/rdoc/servlet.rb
index a4aafeb252..d308288029 100644
--- a/lib/rdoc/servlet.rb
+++ b/lib/rdoc/servlet.rb
@@ -17,11 +17,13 @@ class RDoc::Servlet < WEBrick::HTTPServlet::AbstractServlet
new server, stores, @cache, *options
end
- def initialize server, stores, cache
+ def initialize server, stores, cache, mount_path = nil
super server
- @stores = stores
- @cache = cache
+ @cache = cache
+ @mount_path = mount_path
+ @stores = stores
+
@options = RDoc::Options.new
@options.op_dir = '.'
@@ -59,6 +61,8 @@ class RDoc::Servlet < WEBrick::HTTPServlet::AbstractServlet
end
def do_GET req, res
+ req.path.sub!(/^#{Regexp.escape @mount_path}/o, '') if @mount_path
+
case req.path
when '/' then
root req, res
@@ -128,7 +132,7 @@ class RDoc::Servlet < WEBrick::HTTPServlet::AbstractServlet
<title>Error - #{ERB::Util.html_escape e.class}</title>
-<link type="text/css" media="screen" href="/rdoc.css" rel="stylesheet">
+<link type="text/css" media="screen" href="#{@mouth_path}/rdoc.css" rel="stylesheet">
</head>
<body>
<h1>Error</h1>