From 6d1266a879a94a6f76106e1bbdfa3576b6612a69 Mon Sep 17 00:00:00 2001 From: drbrain Date: Tue, 27 Nov 2012 08:54:03 +0000 Subject: * lib/rdoc/*: Added --root option for building documentation outside the source directory. * test/rdoc/*: ditto * common.mk (rdoc): Added --root to rdoc rule git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37896 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- lib/rdoc/rdoc.rb | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'lib/rdoc/rdoc.rb') diff --git a/lib/rdoc/rdoc.rb b/lib/rdoc/rdoc.rb index d72e686249..eabf4fd3f7 100644 --- a/lib/rdoc/rdoc.rb +++ b/lib/rdoc/rdoc.rb @@ -2,6 +2,7 @@ require 'rdoc' require 'find' require 'fileutils' +require 'pathname' require 'time' ## @@ -345,7 +346,10 @@ option) return unless content - top_level = @store.add_file filename + filename_path = Pathname(filename).expand_path + relative_path = filename_path.relative_path_from @options.root + + top_level = @store.add_file filename, relative_path.to_s parser = RDoc::Parser.for top_level, filename, content, @options, @stats -- cgit v1.2.3