From 96c9b489b4528a73f1cb54166c8a4fe68e692c5b Mon Sep 17 00:00:00 2001 From: Charlie Savage Date: Mon, 16 Jan 2006 10:46:08 +0000 Subject: [PATCH] Updated renaming rules. git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@8467 626c5289-ae23-0410-ae9c-e8d60b6d4f22 --- Lib/ruby/ruby.swg | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/Lib/ruby/ruby.swg b/Lib/ruby/ruby.swg index 8730bebb2..3582f1def 100644 --- a/Lib/ruby/ruby.swg +++ b/Lib/ruby/ruby.swg @@ -11,14 +11,18 @@ /* Class names are CamelCase */ %rename("%(camelcase)s", %isclass) ""; -/* Constants are UPPER_CASE */ +/* Constants created by %constant or #define are UPPER_CASE */ %rename("%(uppercase)s", %isconstant) ""; -%rename("%(undercase)s", %isvariable,%ismember) ""; -%rename("%(uppercase)s", %isvariable,%isimmutable) ""; -%rename("%(uppercase)s", %isvariable,%isstatic,%hasvalue,%hasconsttype) ""; -/* Method names should be changed so that they are - lower_case_with_underscores */ +/* SWIG only considers static class members with inline intializers + to be constants. For examples of what is and isn't considered + a constant by SWIG see naming.i in the Ruby test suite. */ +%rename("%(uppercase)s", %ismember, %isvariable,%isimmutable,%isstatic,%hasvalue,%hasconsttype) ""; + +/* Enums are mapped to constants and thus should be UPPER_CASE */ +%rename("%(uppercase)s", %isenumitem) ""; + +/* Method names should be lower_case_with_underscores */ %rename("%(undercase)s", %isfunction, %ismember, %not %ismemberget, %not %ismemberset) ""; #endif