Skip to content
This repository has been archived by the owner on Nov 10, 2023. It is now read-only.

Commit

Permalink
Use %r literal to avoid escaping
Browse files Browse the repository at this point in the history
  • Loading branch information
dtan4 committed Jan 10, 2017
1 parent ed7db0a commit 9e4df68
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion script/generate
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ EOS
def camelize(string)
string
.sub(/^[a-z\d]*/) { |match| match.capitalize }
.gsub(/(?:_|(\/))([a-z\d]*)/i) { "#{$1}#{$2.capitalize}" }
.gsub(%r{(?:_|(/))([a-z\d]*)}i) { "#{$1}#{$2.capitalize}" }
.gsub('/'.freeze, '::'.freeze)
end

Expand Down

0 comments on commit 9e4df68

Please sign in to comment.