summaryrefslogtreecommitdiff
path: root/lib/rdoc
diff options
context:
space:
mode:
Diffstat (limited to 'lib/rdoc')
-rw-r--r--lib/rdoc/ri/paths.rb23
1 files changed, 17 insertions, 6 deletions
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)