mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* lib/rdoc/ri/paths.rb (RDoc::RI::Paths::HOMEDIR): no exception if
HOME is not set. [ruby-core:33867] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30382 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
cc479b25ba
commit
fc0df967d7
3 changed files with 13 additions and 8 deletions
|
@ -1,3 +1,8 @@
|
||||||
|
Sun Dec 26 12:16:29 2010 Nobuyoshi Nakada <nobu@ruby-lang.org>
|
||||||
|
|
||||||
|
* lib/rdoc/ri/paths.rb (RDoc::RI::Paths::HOMEDIR): no exception if
|
||||||
|
HOME is not set. [ruby-core:33867]
|
||||||
|
|
||||||
Sun Dec 26 11:39:11 2010 Nobuyoshi Nakada <nobu@ruby-lang.org>
|
Sun Dec 26 11:39:11 2010 Nobuyoshi Nakada <nobu@ruby-lang.org>
|
||||||
|
|
||||||
* parse.y (stmt): missing ripper rule. i.e., `a::B ||= c 1'.
|
* parse.y (stmt): missing ripper rule. i.e., `a::B ||= c 1'.
|
||||||
|
|
|
@ -19,12 +19,7 @@ module RDoc::RI::Paths
|
||||||
SYSDIR = File.join base, "system"
|
SYSDIR = File.join base, "system"
|
||||||
SITEDIR = File.join base, "site"
|
SITEDIR = File.join base, "site"
|
||||||
|
|
||||||
homedir = File.expand_path('~') ||
|
HOMEDIR = File.expand_path('~/.rdoc') rescue nil
|
||||||
ENV['HOME'] || ENV['USERPROFILE'] || ENV['HOMEPATH']
|
|
||||||
|
|
||||||
HOMEDIR = if homedir then
|
|
||||||
File.join homedir, ".rdoc"
|
|
||||||
end
|
|
||||||
#:startdoc:
|
#:startdoc:
|
||||||
|
|
||||||
@gemdirs = nil
|
@gemdirs = nil
|
||||||
|
|
|
@ -1,10 +1,11 @@
|
||||||
require 'rubygems'
|
require 'rubygems'
|
||||||
require 'minitest/autorun'
|
require 'test/unit'
|
||||||
require 'tmpdir'
|
require 'tmpdir'
|
||||||
require 'fileutils'
|
require 'fileutils'
|
||||||
require 'rdoc/ri/paths'
|
require 'rdoc/ri/paths'
|
||||||
|
require_relative '../ruby/envutil'
|
||||||
|
|
||||||
class TestRDocRIPaths < MiniTest::Unit::TestCase
|
class TestRDocRIPaths < Test::Unit::TestCase
|
||||||
|
|
||||||
def setup
|
def setup
|
||||||
RDoc::RI::Paths.instance_variable_set :@gemdirs, %w[/nonexistent/gemdir]
|
RDoc::RI::Paths.instance_variable_set :@gemdirs, %w[/nonexistent/gemdir]
|
||||||
|
@ -39,5 +40,9 @@ class TestRDocRIPaths < MiniTest::Unit::TestCase
|
||||||
assert_equal '/nonexistent/gemdir', path.shift
|
assert_equal '/nonexistent/gemdir', path.shift
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def test_homeless
|
||||||
|
bug4202 = '[ruby-core:33867]'
|
||||||
|
assert(assert_in_out_err([{"HOME"=>nil}, *%w"-rrdoc/ri/paths -e;"], bug4202).success?, bug4202)
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue