summaryrefslogtreecommitdiff
path: root/lib/rdoc/ri/paths.rb
diff options
context:
space:
mode:
authordrbrain <drbrain@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2010-12-28 22:08:56 +0000
committerdrbrain <drbrain@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2010-12-28 22:08:56 +0000
commite2efe8e81dc7e9fce40b024df6a20bbf4b830350 (patch)
tree942e66e071e759c7db670a42daeac26c7437f25b /lib/rdoc/ri/paths.rb
parent90d5bcf9104fe58887cf705b718a9c7b537b51a5 (diff)
Import RDoc 3.1
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30413 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib/rdoc/ri/paths.rb')
-rw-r--r--lib/rdoc/ri/paths.rb12
1 files changed, 11 insertions, 1 deletions
diff --git a/lib/rdoc/ri/paths.rb b/lib/rdoc/ri/paths.rb
index f44b0e1e95..a3c65bf928 100644
--- a/lib/rdoc/ri/paths.rb
+++ b/lib/rdoc/ri/paths.rb
@@ -19,7 +19,17 @@ module RDoc::RI::Paths
SYSDIR = File.join base, "system"
SITEDIR = File.join base, "site"
- HOMEDIR = File.expand_path('~/.rdoc') rescue nil
+ homedir = begin
+ File.expand_path('~')
+ rescue ArgumentError
+ end
+
+ homedir ||= ENV['HOME'] ||
+ ENV['USERPROFILE'] || ENV['HOMEPATH'] # for 1.8 compatibility
+
+ HOMEDIR = if homedir then
+ File.join homedir, ".rdoc"
+ end
#:startdoc:
@gemdirs = nil