From 23d081b993746ffe47d2f42266e4b7856f2450c3 Mon Sep 17 00:00:00 2001 From: dave Date: Thu, 19 Feb 2004 03:23:51 +0000 Subject: Fix typos (Doug Kearns) git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@5779 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- lib/rdoc/markup/simple_markup/preprocess.rb | 7 ++++++- lib/rdoc/parsers/parse_c.rb | 21 +++++++++++++++++++++ lib/rdoc/ri/ri_options.rb | 4 ++-- 3 files changed, 29 insertions(+), 3 deletions(-) (limited to 'lib') diff --git a/lib/rdoc/markup/simple_markup/preprocess.rb b/lib/rdoc/markup/simple_markup/preprocess.rb index dbf4b216ca..08ac66139b 100644 --- a/lib/rdoc/markup/simple_markup/preprocess.rb +++ b/lib/rdoc/markup/simple_markup/preprocess.rb @@ -45,7 +45,12 @@ module SM def include_file(name, indent) if (full_name = find_include_file(name)) content = File.open(full_name) {|f| f.read} - res = content.gsub(/^#?/, indent) + # strip leading '#'s, but only if all lines start with them + if content =~ /^[^#]/ + content.gsub(/^/, indent) + else + content.gsub(/^#?/, indent) + end else $stderr.puts "Couldn't find file to include: '#{name}'" '' diff --git a/lib/rdoc/parsers/parse_c.rb b/lib/rdoc/parsers/parse_c.rb index d491e3d88d..d97e08bf4d 100644 --- a/lib/rdoc/parsers/parse_c.rb +++ b/lib/rdoc/parsers/parse_c.rb @@ -44,6 +44,27 @@ # # C classes can be diagramed (see /tc/dl/ruby/ruby/error.c), and RDoc # integrates C and Ruby source into one tree + # + # The comment blocks may include special direcives: + # + # [Document-class: name] + # This comment block is documentation for the given class. Use this + # when the Init_xxx method is not named after the class. + # + # [Document-method: name] + # This comment documents the named method. Use when RDoc cannot outomatically + # find the method from it's declaration + # + # [call-seq: text up to an empty line] + # Because C source doesn't give descripive names to Ruby-level parameters, + # you need to document the calling sequence explicitly + # + # In additon, RDoc assumes by default that the C method implementing a + # Ruby function is in the same source file as the rb_define_method call. + # If this isn't the case, add the comment + # + # rb_define_method(....); // in: filename + # # Classes and modules built in to the interpreter. We need # these to define superclasses of user objects diff --git a/lib/rdoc/ri/ri_options.rb b/lib/rdoc/ri/ri_options.rb index 0e720a9c64..8aec57e9a1 100644 --- a/lib/rdoc/ri/ri_options.rb +++ b/lib/rdoc/ri/ri_options.rb @@ -120,7 +120,7 @@ module RI ri zip Note that shell quoting may be required for method names - containing puncuation: + containing punctuation: ri 'Array.[]' ri compact\\! @@ -150,7 +150,7 @@ module RI end puts end - puts "Options may also be passed in the 'RI' environment varaible" + puts "Options may also be passed in the 'RI' environment variable" exit 0 end end -- cgit v1.2.3