mruby is an open-source project which is looking forward to each contribution.
To make it easy to review and understand your change please keep the following things in mind before submitting your pull request:
Work on the latest possible state of mruby/master Create
a branch which is dedicated to your change Test your changes before
creating a pull request (./minirake test) If possible write a
test case which confirms your change Don’t mix several features or
bug-fixes in one pull request Create a meaningful commit message Explain
your change (i.e. with a link to the issue you are fixing)
How to style your C and Ruby code which you want to submit.
The core part (parser, bytecode-interpreter, core-lib, etc.) of mruby is written in the C programming language. Please note the following hints for your C code:
mruby should be highly portable to other systems and compilers. For this it is recommended to keep your code as close as possible to the C99 standard (www.open-std.org/jtc1/sc22/WG14/www/docs/n1256.pdf).
Although we target C99, Visual C++ is also an important target for mruby. For this reason a declaration of a local variable has to be at the beginning of a scope block.
The dependencies to libraries should be kept to an absolute minimum. This increases the portability but makes it also easier to cut away parts of mruby on-demand.
This is the prefered comment style
Use C++ style comments only for temporary comment e.g. commenting out some code lines.
int
main(void)
{
...
}
Parts of the standard library of mruby are written in the Ruby programming language itself. Please note the following hints for your Ruby code:
mruby is currently targeting to execute Ruby code which complies to ISO/IEC 30170:2012 (www.iso.org/iso/iso_catalogue/catalogue_tc/catalogue_detail.htm?csnumber=59579).
Commenting is here to help enhance the documentation. For example, code samples, or clarification of the documentation.
If you have questions about Ruby or the documentation, please post to one of the Ruby mailing lists. You will get better, faster, help that way.
If you wish to post a correction of the docs, please do so, but also file bug report so that it can be corrected for the next release. Thank you.
If you want to help improve the Ruby documentation, please see Improve the docs, or visit Documenting-ruby.org.