diff options
author | Nobuyoshi Nakada <nobu@ruby-lang.org> | 2020-04-20 18:41:03 +0900 |
---|---|---|
committer | aycabta <aycabta@gmail.com> | 2020-04-23 15:13:27 +0900 |
commit | 14e013cdbbd937ab229a929d8743f271c6f89ab2 (patch) | |
tree | 30a75e0f76564b729c4400e1a1f4bad3fc96e1b9 /lib/rdoc | |
parent | d1f50b9872f2768d8790170904ccf6d28aaee633 (diff) |
[ruby/rdoc] Drop old rubies
* `RbConfig::CONFIG['ridir']` has been set since 1.9.2
* `ENV["HOME"]` has been defaulted to `USERPROFILE` since 1.9.0,
and backported to 1.8.5 or later.
https://github.com/ruby/rdoc/commit/a3a614e676
Diffstat (limited to 'lib/rdoc')
-rw-r--r-- | lib/rdoc/ri/paths.rb | 17 |
1 files changed, 3 insertions, 14 deletions
diff --git a/lib/rdoc/ri/paths.rb b/lib/rdoc/ri/paths.rb index f76721d318..b1d584878b 100644 --- a/lib/rdoc/ri/paths.rb +++ b/lib/rdoc/ri/paths.rb @@ -12,23 +12,12 @@ module RDoc::RI::Paths version = RbConfig::CONFIG['ruby_version'] - BASE = if RbConfig::CONFIG.key? 'ridir' then - File.join RbConfig::CONFIG['ridir'], version - else - File.join RbConfig::CONFIG['datadir'], 'ri', version - end + BASE = File.join RbConfig::CONFIG['ridir'], version - homedir = begin - File.expand_path('~') + HOMEDIR = begin + File.expand_path('~/.rdoc') rescue ArgumentError end - - homedir ||= ENV['HOME'] || - ENV['USERPROFILE'] || ENV['HOMEPATH'] # for 1.8 compatibility - - HOMEDIR = if homedir then - File.join homedir, ".rdoc" - end #:startdoc: ## |