From 06e7a0e166aec9695ba2489e0e733fa149192fbf Mon Sep 17 00:00:00 2001 From: Thomas Ingram Date: Fri, 8 Nov 2013 17:55:01 -0500 Subject: [PATCH] Allow underscore before character to match in second alteration A quick test at http://rubular.com/r/YkPh9ZROVi indicates it still works. I had to change \A to ^ to test multiple inputs on Rubular. --- lib/case_converter.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/case_converter.rb b/lib/case_converter.rb index 554ae69..3a9aa9d 100644 --- a/lib/case_converter.rb +++ b/lib/case_converter.rb @@ -1,6 +1,6 @@ class CaseConverter def upcase_characters(string) - string.gsub(/(\A_?[a-z]|(?<=_)[a-z])/) {|char| char.upcase} + string.gsub(/(\A[a-z]|(?<=_)[a-z])/) {|char| char.upcase} end def remove_underscores(string)