From 696ebcd8cafece7c0ed6407af9679699a16a5c5a Mon Sep 17 00:00:00 2001 From: drbrain Date: Fri, 30 Nov 2012 01:39:03 +0000 Subject: * lib/rdoc/ri/driver.rb: Relaxed matching for pages to be more user-friendly. * test/rdoc/test_rdoc_ri_driver.rb: Test for above. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@38021 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- lib/rdoc/ri/driver.rb | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'lib/rdoc/ri') diff --git a/lib/rdoc/ri/driver.rb b/lib/rdoc/ri/driver.rb index 4beda55881..4f5e13034e 100644 --- a/lib/rdoc/ri/driver.rb +++ b/lib/rdoc/ri/driver.rb @@ -842,10 +842,12 @@ The ri pager can be set with the 'RI_PAGER' environment variable or the unless pages.include? page_name then found_names = pages.select do |n| - n =~ /^#{Regexp.escape page_name}\.[^.]+$/ + n =~ /#{Regexp.escape page_name}\.[^.]+$/ end - if found_names.length > 1 then + if found_names.length.zero? then + return display_page_list store, pages + elsif found_names.length > 1 then return display_page_list store, found_names, page_name end -- cgit v1.2.3