From 8875ffc4120fd8ef273f1b584803bc83891ff23b Mon Sep 17 00:00:00 2001 From: yugui Date: Sat, 23 May 2009 16:07:46 +0000 Subject: * configure.in ($ridir): new configuration. [ruby-core:23520]. c.f. [ruby-core:23519]. (--with-ridir): new configure option. * tool/instruby.rb (:doc, :rdoc): uses $ridir instead of a fixed path. * lib/rdoc/ri/paths.rb: follows $ridir. * Makefile.in: removes RIDATADIR which is no longer used. * bcc32/Makefile.sub: generates the 'ridir' entry for RbConfig. removes RIDATADIR which is no longer used. * win32/Makefile.sub: ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@23554 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- lib/rdoc/ri/paths.rb | 23 +++++++++++++++++------ 1 file changed, 17 insertions(+), 6 deletions(-) (limited to 'lib/rdoc/ri') diff --git a/lib/rdoc/ri/paths.rb b/lib/rdoc/ri/paths.rb index 11bbf4573f..bce71b46f0 100644 --- a/lib/rdoc/ri/paths.rb +++ b/lib/rdoc/ri/paths.rb @@ -28,14 +28,25 @@ module RDoc::RI::Paths VERSION = RbConfig::CONFIG['ruby_version'] - if m = /ruby/.match(RbConfig::CONFIG['RUBY_INSTALL_NAME']) - m = [m.pre_match, m.post_match] + if VERSION > '1.9.1' + if m = /ruby/.match(RbConfig::CONFIG['RUBY_INSTALL_NAME']) + m = [m.pre_match, m.post_match] + else + m = [""] * 2 + end + ri = "#{m[0]}ri#{m[1]}" + rdoc = "#{m[0]}rdoc#{m[1]}" + base = File.join(RbConfig::CONFIG['datadir'], ri, VERSION) else - m = [""] * 2 + if m = /ruby/.match(RbConfig::CONFIG['RUBY_BASE_NAME']) + m = [m.pre_match, m.post_match] + else + m = [""] * 2 + end + ri = "#{m[0]}ri#{m[1]}" + rdoc = "#{m[0]}rdoc#{m[1]}" + base = File.join(RbConfig::CONFIG['ridir'], VERSION) end - ri = "#{m[0]}ri#{m[1]}" - rdoc = "#{m[0]}rdoc#{m[1]}" - base = File.join(RbConfig::CONFIG['datadir'], ri, VERSION) SYSDIR = File.join(base, "system") SITEDIR = File.join(base, "site") HOMEDIR = (File.expand_path("~/.#{rdoc}") rescue nil) -- cgit v1.2.3