Merge pull request #180 from victor/patch-1

Allow capitalization after a period.
This commit is contained in:
Brandon Mathis 2011-09-28 13:35:42 -07:00
commit a35c780616

View File

@ -11,8 +11,8 @@ class String
# capitalize first and last words
x.first.to_s.smart_capitalize!
x.last.to_s.smart_capitalize!
# small words after colons are capitalized
x.join(" ").gsub(/:\s?(\W*#{small_words.join("|")}\W*)\s/) { ": #{$1.smart_capitalize} " }
# small words after colons or periods are capitalized
x.join(" ").gsub(/(:|\.)\s?(\W*#{small_words.join("|")}\W*)\s/) { "#{$1} #{$2.smart_capitalize} " }
end
def titlecase!