bugfix: ruby code-gen capitalization
Change on 2015/01/06 by temiola <temiola@google.com>
-------------
Created by MOE: http://code.google.com/p/moe-java
MOE_MIGRATED_REVID=83391912
diff --git a/src/compiler/ruby_generator_string-inl.h b/src/compiler/ruby_generator_string-inl.h
index f74f2c7..85a76fa 100644
--- a/src/compiler/ruby_generator_string-inl.h
+++ b/src/compiler/ruby_generator_string-inl.h
@@ -93,12 +93,11 @@
return true;
}
-// CapitalizeString capitalizes a string.
-inline string CapitalizeString(string s) {
- if (!s.empty()) {
+// CapitalizeFirst capitalizes the first char in a string.
+inline string CapitalizeFirst(string s) {
+ if (s.empty()) {
return s;
}
- transform(s.begin(), s.end(), s.begin(), ::tolower);
s[0] = ::toupper(s[0]);
return s;
}
@@ -117,7 +116,7 @@
res += "::"; // switch '.' to the ruby module delim
}
if (i < prefixes_and_type.size() - 1) {
- res += CapitalizeString(prefixes_and_type[i]); // capitalize pkgs
+ res += CapitalizeFirst(prefixes_and_type[i]); // capitalize pkgs
} else {
res += prefixes_and_type[i];
}