Skip to content

Commit

Permalink
update comment parsing rules to exclude non sentence terminating peri…
Browse files Browse the repository at this point in the history
…ods, include exclamation marks
  • Loading branch information
leethomas committed May 15, 2016
1 parent 4bd340f commit 355d1ac
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions lib/rake/task.rb
Original file line number Diff line number Diff line change
Expand Up @@ -304,10 +304,10 @@ def transform_comments(separator, &block)
private :transform_comments

# Get the first sentence in a string. The sentence is terminated
# by the first period or the end of the line. Decimal points do
# not count as periods.
# by the first period, exclamation mark, or the end of the line.
# Decimal points do not count as periods.
def first_sentence(string)
string.split(/\.[ \t]|\.$|\n/).first
string.split(/(?<=\w)(\.|!)[ \t]|(\.$|!)|\n/).first
end
private :first_sentence

Expand Down

0 comments on commit 355d1ac

Please sign in to comment.