summaryrefslogtreecommitdiff
path: root/tool/strip-rdoc.rb
diff options
context:
space:
mode:
authoryugui <yugui@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-12-22 13:19:08 +0000
committeryugui <yugui@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-12-22 13:19:08 +0000
commitc09e5abeee5e08e6c261e3618afa60020371eb96 (patch)
tree0871288276c8d388f2c269df6d560220edf77d2d /tool/strip-rdoc.rb
parenta550f2992bfbde8649e975eb345a4b478adbdd05 (diff)
* Doxyfile.in: new file. Template of a configuration file for
Doxygen. Intorduces C-level API reference generation with Doxygen. * tool/file2lastrev.rb: wrapper script that abstracts subversion and git-svn. * tool/strip-rdoc.rb: filter for preventing doxygen from processing rdoc comments. * configure.in: (Doxyfile): Doxyfile is generated together with Makefile. (PACKAGE): configuration $(PACKAGE) is necessary for $(docdir). * instruby.rb: adds a new install target 'capi' * common.mk (capi): new target that generates C API documents with Doxygen. (install-capi): new target. (pre-install-capi): ditto. (do-install-capi): ditto. (post-install-capi): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@20919 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'tool/strip-rdoc.rb')
-rw-r--r--tool/strip-rdoc.rb22
1 files changed, 22 insertions, 0 deletions
diff --git a/tool/strip-rdoc.rb b/tool/strip-rdoc.rb
new file mode 100644
index 0000000000..205aecccac
--- /dev/null
+++ b/tool/strip-rdoc.rb
@@ -0,0 +1,22 @@
+#!ruby
+
+source = ARGF.read
+source = source.gsub(%r{/\*\*((?!\*/).+?)\*/}m) do |comment|
+ comment = $1
+ next "/**#{comment}*/" unless /^\s*\*\s?\-\-\s*$/ =~ comment
+ doxybody = nil
+ comment.each_line do |line|
+ if doxybody
+ if /^\s*\*\s?\+\+\s*$/ =~ line
+ break
+ end
+ doxybody << line
+ else
+ if /^\s*\*\s?--\s*$/ =~ line
+ doxybody = "\n"
+ end
+ end
+ end
+ "/**#{doxybody}*/"
+end
+print source