From e2efe8e81dc7e9fce40b024df6a20bbf4b830350 Mon Sep 17 00:00:00 2001 From: drbrain Date: Tue, 28 Dec 2010 22:08:56 +0000 Subject: Import RDoc 3.1 git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30413 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- lib/rdoc/ri/paths.rb | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'lib/rdoc/ri/paths.rb') 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 -- cgit v1.2.3