summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Lib/ruby/ruby.swg5
-rw-r--r--Source/Modules/ruby.cxx10
2 files changed, 8 insertions, 7 deletions
diff --git a/Lib/ruby/ruby.swg b/Lib/ruby/ruby.swg
index 37305941b..90e06fd87 100644
--- a/Lib/ruby/ruby.swg
+++ b/Lib/ruby/ruby.swg
@@ -7,6 +7,11 @@
/* ------------------------------------------------------------
* The Ruby global rename rules
* ------------------------------------------------------------ */
+/* Class names are CamelCase */
+%rename("%(ctitle)s", %isclass) "";
+
+/* Constants are UPPER_CASE */
+%rename("%(upper)s", %isconstant) "";
/* Method names should be changed so that they are
lower_case_with_underscores */
diff --git a/Source/Modules/ruby.cxx b/Source/Modules/ruby.cxx
index eb42cea53..f5a8e6f5a 100644
--- a/Source/Modules/ruby.cxx
+++ b/Source/Modules/ruby.cxx
@@ -1521,16 +1521,12 @@ public:
if (!name || name[0] == '\0')
return name;
+ /* Check to see that constants start with an upper case
+ letter and if they don't raise a warning. Note that
+ renames are specified via %renames in ruby.swg. */
if (isupper(name[0]))
return name;
- if (islower(name[0])) {
- name[0] = toupper(name[0]);
- Swig_warning(WARN_RUBY_WRONG_NAME, input_file, line_number,
- "Wrong %s name (corrected to `%s')\n", reason, name);
- return name;
- }
-
Swig_warning(WARN_RUBY_WRONG_NAME, input_file, line_number,
"Wrong %s name %s\n", reason, name);