mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
Should match the beginning/end of string
This commit is contained in:
parent
3ee63cfe88
commit
e62a60927e
1 changed files with 4 additions and 4 deletions
|
@ -112,7 +112,7 @@ class RDoc::Servlet < WEBrick::HTTPServlet::AbstractServlet
|
||||||
# GET request entry point. Fills in +res+ for the path, etc. in +req+.
|
# GET request entry point. Fills in +res+ for the path, etc. in +req+.
|
||||||
|
|
||||||
def do_GET req, res
|
def do_GET req, res
|
||||||
req.path.sub!(/^#{Regexp.escape @mount_path}/o, '') if @mount_path
|
req.path.sub!(/\A#{Regexp.escape @mount_path}/o, '') if @mount_path
|
||||||
|
|
||||||
case req.path
|
case req.path
|
||||||
when '/' then
|
when '/' then
|
||||||
|
@ -150,9 +150,9 @@ class RDoc::Servlet < WEBrick::HTTPServlet::AbstractServlet
|
||||||
|
|
||||||
if klass = store.find_class_or_module(name) then
|
if klass = store.find_class_or_module(name) then
|
||||||
res.body = generator.generate_class klass
|
res.body = generator.generate_class klass
|
||||||
elsif page = store.find_text_page(name.sub(/_([^_]*)$/, '.\1')) then
|
elsif page = store.find_text_page(name.sub(/_([^_]*)\z/, '.\1')) then
|
||||||
res.body = generator.generate_page page
|
res.body = generator.generate_page page
|
||||||
elsif page = store.find_text_page(text_name.sub(/_([^_]*)$/, '.\1')) then
|
elsif page = store.find_text_page(text_name.sub(/_([^_]*)\z/, '.\1')) then
|
||||||
res.body = generator.generate_page page
|
res.body = generator.generate_page page
|
||||||
else
|
else
|
||||||
not_found generator, req, res
|
not_found generator, req, res
|
||||||
|
@ -419,7 +419,7 @@ version. If you're viewing Ruby's documentation, include the version of ruby.
|
||||||
RDoc::Store.new RDoc::RI::Paths.system_dir, :system
|
RDoc::Store.new RDoc::RI::Paths.system_dir, :system
|
||||||
when 'site' then
|
when 'site' then
|
||||||
RDoc::Store.new RDoc::RI::Paths.site_dir, :site
|
RDoc::Store.new RDoc::RI::Paths.site_dir, :site
|
||||||
when /^extra-(\d+)$/ then
|
when /\Aextra-(\d+)\z/ then
|
||||||
index = $1.to_i - 1
|
index = $1.to_i - 1
|
||||||
ri_dir = installed_docs[index][4]
|
ri_dir = installed_docs[index][4]
|
||||||
RDoc::Store.new ri_dir, :extra
|
RDoc::Store.new ri_dir, :extra
|
||||||
|
|
Loading…
Reference in a new issue