From d884dfe8ecf5bfb2f0655e169a8759f5f0b12db5 Mon Sep 17 00:00:00 2001 From: Nobuyoshi Nakada Date: Thu, 27 Aug 2015 12:10:52 +0900 Subject: [PATCH] Fix for drive letters `Pathname#relative_path_from` raises an `ArgumentError` when the self path and the base directory have different prefixes, on Windows and DOSish systems which have drive letters (or UNC). The absolute path just works fine in that case. --- lib/rdoc/rdoc.rb | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lib/rdoc/rdoc.rb b/lib/rdoc/rdoc.rb index 4d45d47978..f4bb58e14b 100644 --- a/lib/rdoc/rdoc.rb +++ b/lib/rdoc/rdoc.rb @@ -353,7 +353,11 @@ def parse_file filename return unless content filename_path = Pathname(filename).expand_path - relative_path = filename_path.relative_path_from @options.root + begin + relative_path = filename_path.relative_path_from @options.root + rescue ArgumentError + relative_path = filename_path + end if @options.page_dir and relative_path.to_s.start_with? @options.page_dir.to_s then