Skip to content

Commit

Permalink
Fix for drive letters
Browse files Browse the repository at this point in the history
`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.
  • Loading branch information
nobu committed Aug 27, 2015
1 parent 1a3dd5d commit d884dfe
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion lib/rdoc/rdoc.rb
Expand Up @@ -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
Expand Down

0 comments on commit d884dfe

Please sign in to comment.