Skip to content

Commit

Permalink
Restore earlier behavior of -- to stop comments. Bug ruby#7
Browse files Browse the repository at this point in the history
  • Loading branch information
drbrain committed Jan 29, 2011
1 parent dda5105 commit 9a97f62
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 2 deletions.
2 changes: 2 additions & 0 deletions History.txt
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@
test can be created. RubyForge bug #28821 by Usaku Nakamura.
* Fixed line-height of headings in method and alias descriptions. RubyForge
Bug #2770 by Adam Avilla
* Relaxed RDoc::Parser::Ruby#remove_private_comments to consume more dashes
as older versions once did. Bug #7 by Claus Folke Brobak.

=== 3.4 / 2010-01-06

Expand Down
4 changes: 2 additions & 2 deletions lib/rdoc/parser/ruby.rb
Original file line number Diff line number Diff line change
Expand Up @@ -1647,8 +1647,8 @@ def remove_private_comments(comment)
empty = ''
empty.force_encoding comment.encoding if Object.const_defined? :Encoding

comment.gsub!(/^#--\n.*?^#\+\+\n?/m, empty)
comment.sub!(/^#--\n.*\n?/m, empty)
comment.gsub!(/^#--.*?^#\+\+\n?/m, empty)
comment.sub!(/^#--.*/m, '')
end

##
Expand Down
19 changes: 19 additions & 0 deletions test/test_rdoc_parser_ruby.rb
Original file line number Diff line number Diff line change
Expand Up @@ -203,6 +203,25 @@ def test_remove_private_comments_encoding
assert_equal Encoding::IBM437, comment.encoding
end

def test_remove_private_comments_long
util_parser ''

comment = <<-EOS
#-----
#++
# this is text
#-----
EOS

expected = <<-EOS
# this is text
EOS

@parser.remove_private_comments(comment)

assert_equal expected, comment
end

def test_remove_private_comments_rule
util_parser ''

Expand Down

0 comments on commit 9a97f62

Please sign in to comment.