aboutsummaryrefslogtreecommitdiffstats
path: root/lib/rdoc/ri/paths.rb
diff options
context:
space:
mode:
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