mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
[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
This commit is contained in:
parent
d1f50b9872
commit
14e013cdbb
1 changed files with 3 additions and 14 deletions
|
@ -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:
|
||||
|
||||
##
|
||||
|
|
Loading…
Add table
Reference in a new issue