From: Tilman Sauerbeck Date: 2005-04-26T17:51:36+09:00 Subject: Re: rdoc external include... --YZ5djTAD1cGYuMQK Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Jeff Rose [2005-04-26 17:18]: > Problem: > When I put this in the README file ":include:examples/sample.rb" it > does include the source, but it takes the # symbols off the comments in > the code, which makes it un-runnable if someone copy and pastes. (It > also looks lame...) > > Anyone know how to have it include the source but either turn off rdoc > completely or treat it as regular stuff rather than cutting out #'s? The attached patch should fix this, didn't try it though. -- Regards, Tilman --YZ5djTAD1cGYuMQK Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename="rdoc-include_dont_remove_comments.diff" Only in ruby-1.8.2/lib/rdoc/markup/simple_markup: .preprocess.rb.swp diff -aur ruby-1.8.2.orig/lib/rdoc/markup/simple_markup/preprocess.rb ruby-1.8.2/lib/rdoc/markup/simple_markup/preprocess.rb --- ruby-1.8.2.orig/lib/rdoc/markup/simple_markup/preprocess.rb 2004-11-26 05:32:11.000000000 +0100 +++ ruby-1.8.2/lib/rdoc/markup/simple_markup/preprocess.rb 2005-04-26 10:49:09.000000000 +0200 @@ -43,7 +43,7 @@ def include_file(name, indent) if (full_name = find_include_file(name)) content = File.open(full_name) {|f| f.read} - res = content.gsub(/^#?/, indent) + res = content.gsub(/^\s*/, indent) else $stderr.puts "Couldn't find file to include: '#{name}'" '' --YZ5djTAD1cGYuMQK--