[ruby/rdoc] Support different drive latters in include paths
https://github.com/ruby/rdoc/commit/946d2592e2
This commit is contained in:
parent
b4da6fc1c2
commit
c8ce37d427
@ -555,7 +555,13 @@ class RDoc::Options
|
|||||||
|
|
||||||
@files << @page_dir.to_s
|
@files << @page_dir.to_s
|
||||||
|
|
||||||
page_dir = @page_dir.expand_path.relative_path_from @root
|
page_dir = nil
|
||||||
|
begin
|
||||||
|
page_dir = @page_dir.expand_path.relative_path_from @root
|
||||||
|
rescue ArgumentError
|
||||||
|
# On Windows, sometimes crosses different drive letters.
|
||||||
|
page_dir = @page_dir.expand_path
|
||||||
|
end
|
||||||
|
|
||||||
@page_dir = page_dir
|
@page_dir = page_dir
|
||||||
end
|
end
|
||||||
@ -1154,8 +1160,17 @@ Usage: #{opt.program_name} [options] [names...]
|
|||||||
|
|
||||||
path.reject do |item|
|
path.reject do |item|
|
||||||
path = Pathname.new(item).expand_path
|
path = Pathname.new(item).expand_path
|
||||||
relative = path.relative_path_from(dot).to_s
|
is_reject = nil
|
||||||
relative.start_with? '..'
|
relative = nil
|
||||||
|
begin
|
||||||
|
relative = path.relative_path_from(dot).to_s
|
||||||
|
rescue ArgumentError
|
||||||
|
# On Windows, sometimes crosses different drive letters.
|
||||||
|
is_reject = true
|
||||||
|
else
|
||||||
|
is_reject = relative.start_with? '..'
|
||||||
|
end
|
||||||
|
is_reject
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -507,8 +507,14 @@ rdoc_include:
|
|||||||
assert_empty out
|
assert_empty out
|
||||||
assert_empty err
|
assert_empty err
|
||||||
|
|
||||||
expected =
|
expected = nil
|
||||||
Pathname(Dir.tmpdir).expand_path.relative_path_from @options.root
|
begin
|
||||||
|
expected =
|
||||||
|
Pathname(Dir.tmpdir).expand_path.relative_path_from @options.root
|
||||||
|
rescue ArgumentError
|
||||||
|
# On Windows, sometimes crosses different drive letters.
|
||||||
|
expected = Pathname(Dir.tmpdir).expand_path
|
||||||
|
end
|
||||||
|
|
||||||
assert_equal expected, @options.page_dir
|
assert_equal expected, @options.page_dir
|
||||||
assert_equal [Dir.tmpdir], @options.files
|
assert_equal [Dir.tmpdir], @options.files
|
||||||
|
Loading…
x
Reference in New Issue
Block a user