summaryrefslogtreecommitdiff
path: root/lib/rdoc/options.rb
diff options
context:
space:
mode:
authoraycabta <aycabta@gmail.com>2019-10-28 01:44:09 +0900
committeraycabta <aycabta@gmail.com>2019-10-29 12:34:44 +0900
commitc8ce37d4271a58132fb7fc5548e0ba7d85419152 (patch)
tree81c15f13ece54815806adf50a4cad142451c173e /lib/rdoc/options.rb
parentb4da6fc1c277190bbd10e795ebf3be45772038e8 (diff)
[ruby/rdoc] Support different drive latters in include paths
https://github.com/ruby/rdoc/commit/946d2592e2
Diffstat (limited to 'lib/rdoc/options.rb')
-rw-r--r--lib/rdoc/options.rb21
1 files changed, 18 insertions, 3 deletions
diff --git a/lib/rdoc/options.rb b/lib/rdoc/options.rb
index 53cc3af63c9..43494c85be4 100644
--- a/lib/rdoc/options.rb
+++ b/lib/rdoc/options.rb
@@ -555,7 +555,13 @@ class RDoc::Options
@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
end
@@ -1154,8 +1160,17 @@ Usage: #{opt.program_name} [options] [names...]
path.reject do |item|
path = Pathname.new(item).expand_path
- relative = path.relative_path_from(dot).to_s
- relative.start_with? '..'
+ is_reject = nil
+ 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