summaryrefslogtreecommitdiff
path: root/lib/rdoc/ri/paths.rb
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2009-03-26 02:33:16 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2009-03-26 02:33:16 +0000
commite0b7af69b461773c66ebfef29e2303f13b111d13 (patch)
treeae7d1f806fb24adb0ae0b5c4886f12569ff54a42 /lib/rdoc/ri/paths.rb
parent340d9c59fd491e1fc97a18706dd0b81d9b461b85 (diff)
* lib/rdoc/ri/paths.rb (RDoc::RI::Paths): considers
--program-prefix and --program-suffix. reapplied r19923. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@23070 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib/rdoc/ri/paths.rb')
-rw-r--r--lib/rdoc/ri/paths.rb11
1 files changed, 9 insertions, 2 deletions
diff --git a/lib/rdoc/ri/paths.rb b/lib/rdoc/ri/paths.rb
index fcafb279fd..11bbf4573f 100644
--- a/lib/rdoc/ri/paths.rb
+++ b/lib/rdoc/ri/paths.rb
@@ -28,10 +28,17 @@ module RDoc::RI::Paths
VERSION = RbConfig::CONFIG['ruby_version']
- base = File.join(RbConfig::CONFIG['datadir'], "ri", VERSION)
+ 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)
SYSDIR = File.join(base, "system")
SITEDIR = File.join(base, "site")
- HOMEDIR = (File.expand_path("~/.rdoc") rescue nil)
+ HOMEDIR = (File.expand_path("~/.#{rdoc}") rescue nil)
begin
require 'rubygems' unless defined?(Gem) and defined?(Gem::Enable) and