Ruby add support for docstring option in %module()

This was already documented but not actually implemented.
This commit is contained in:
Aurelien Jacobs 2016-01-11 16:33:26 +01:00
commit c63562744b

View file

@ -1011,6 +1011,8 @@ public:
virtual int top(Node *n) {
String *mod_docstring = NULL;
/**
* See if any Ruby module options have been specified as options
* to the %module directive.
@ -1032,6 +1034,7 @@ public:
multipleInheritance = true;
director_multiple_inheritance = 1;
}
mod_docstring = Getattr(options, "docstring");
}
}
@ -1146,6 +1149,13 @@ public:
Printf(f_header, "#define SWIG_init Init_%s\n", feature);
Printf(f_header, "#define SWIG_name \"%s\"\n\n", module);
if (mod_docstring && Len(mod_docstring)) {
Printf(f_header, "/*\n Document-module: %s\n\n%s\n*/\n", module, mod_docstring);
Delete(mod_docstring);
mod_docstring = NULL;
}
Printf(f_header, "static VALUE %s;\n", modvar);
/* Start generating the initialization function */