1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00
ruby--ruby/tool/strip-rdoc.rb

15 lines
359 B
Ruby
Raw Normal View History

#!ruby
# frozen_string_literal: true
# Filter for preventing Doxygen from processing RDoc comments.
# Used by the Doxygen template.
print ARGF.binmode.read.tap {|src|
src.gsub!(%r|(/\*[!*])(?:(?!\*/).)+?^\s*\*\s?\-\-\s*$(.+?\*/)|m) {
marker = $1
comment = $2
comment.sub!(%r|^\s*\*\s?\+\+\s*$.+?(\s*\*/)\z|m, '\\1')
marker + comment
}
}