X-Git-Url: https://sigrok.org/gitweb/?a=blobdiff_plain;f=bindings%2Fswig%2Fdoc.py;h=e8767af8b987b898944b047de2fed82f29bd869f;hb=fdcdfe53d8fa27e101f7d4b206f05a4f3513c306;hp=f71493d4d69993a81246970d6241a94a4e3cd6b2;hpb=8eb4299c5b5dac419b769d2e6581707cec47ea6b;p=libsigrok.git diff --git a/bindings/swig/doc.py b/bindings/swig/doc.py index f71493d4..e8767af8 100644 --- a/bindings/swig/doc.py +++ b/bindings/swig/doc.py @@ -45,6 +45,8 @@ for compound in index.findall('compound'): if brief: if language == 'python': print('%%feature("docstring") %s "%s";' % (class_name, brief)) + elif language == 'ruby': + print('%%feature("docstring") %s "/* Document-class: %s\\n%s */\\n";' % (class_name, class_name.replace("sigrok", "Sigrok", 1), brief)) elif language == 'java': print('%%typemap(javaclassmodifiers) %s "/** %s */\npublic class"' % ( class_name, brief)) @@ -73,6 +75,12 @@ for compound in index.findall('compound'): class_name, member_name, brief)] + [ '@param %s %s' % (name, desc) for name, desc in parameters.items()]) + '";') + if language == 'ruby' and kind == 'public-func': + print(str.join('\n', [ + '%%feature("docstring") %s::%s "/* %s' % ( + class_name, member_name, brief)] + [ + '@param %s %s' % (name, desc) + for name, desc in parameters.items()]) + ' */\\n";') elif language == 'java' and kind == 'public-func': print(str.join('\n', [ '%%javamethodmodifiers %s::%s "/** %s' % ( @@ -101,3 +109,6 @@ for compound in index.findall('compound'): print('%s.%s.__doc__ = """%s"""' % ( trimmed_name, member_name, brief)) print('%}') + elif language == 'ruby' and constants: + for member_name, brief in constants: + print('%%feature("docstring") %s::%s "/* %s */\\n";' % (class_name, member_name, brief))