Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Allow : inside the function list for a ChangeLog

Fixed autotest for ChangeLog
  • Loading branch information...
commit ea865b609d5189c5d385cf7ae193fe54d0193777 1 parent 86c788e
Eric Hodel drbrain authored
5 .autotest
View
@@ -15,7 +15,10 @@ Autotest.add_hook :initialize do |at|
f = s.sub(/^test#{sep}/, '').sub(/\.rb$/, '').split(sep)
f = f.map { |path| path.split(/_|(\d+)/).map { |seg| seg.capitalize }.join }
f = f.map { |path| path =~ /^Test/ ? path : "Test#{path}" }
- f.join('::').gsub('Rdoc', 'RDoc').gsub('Ri', 'RI')
+ f.join('::').
+ gsub('Rdoc', 'RDoc').
+ gsub('Ri', 'RI').
+ gsub('Changelog', 'ChangeLog')
end
end
6 lib/rdoc/parser/changelog.rb
View
@@ -55,7 +55,11 @@ def create_items items
list = RDoc::Markup::List.new :NOTE
items.each do |item|
- title, body = item.split(/:\s*/, 2)
+ item =~ /\A(.*?(?:\([^)]+\))?):\s*/
+
+ title = $1
+ body = $'
+
paragraph = RDoc::Markup::Paragraph.new body
list_item = RDoc::Markup::ListItem.new title, paragraph
list << list_item
19 test/test_rdoc_parser_changelog.rb
View
@@ -129,6 +129,25 @@ def test_create_entries
assert_equal expected, parser.create_entries(entries)
end
+ def test_create_entries_colons
+ parser = util_parser
+
+ entries = [
+ ['Wed Dec 5 12:17:11 2012 Naohisa Goto <ngotogenome@gmail.com>',
+ ['func.rb (DL::Function#bind): log stuff [ruby-core:50562]']],
+ ]
+
+ expected = [
+ head(3,
+ 'Wed Dec 5 12:17:11 2012 Naohisa Goto <ngotogenome@gmail.com>'),
+ blank_line,
+ list(:NOTE,
+ item('func.rb (DL::Function#bind)',
+ para('log stuff [ruby-core:50562]')))]
+
+ assert_equal expected, parser.create_entries(entries)
+ end
+
def test_create_items
parser = util_parser
Please sign in to comment.
Something went wrong with that request. Please try again.