Information about the project, etc.
Generally the project coding standard follows Ruby Garden (the below is pretty much a copy/paste from there)
CONSTANTS_USE_UPPER_CASE
-- for example:Math::PI
,Curses::KEY_DOWN
,OptionParser::REQUIRED_ARGUMENT
ClassesUsePascalCase
-- join words of class names by capitalizing the first letter of each word. The same goes forModuleNames
as well.- methods use underscores, as do
local_variables
,@instance_variables
, and@@class_variables
-- join words with underscores (akasnake_case
) - Keep acronyms in class names capitalized.
MyXMLClass
, notMyXmlClass
. Variables should use all lower-case.
There is no place in Ruby where camelCase is ever used.
Method Parameters:
- put parentheses around non-trivial parameter lists
- don't put spaces between a method name and its parameter list
- Use two spaces for indentation
- Tabs versus spaces is a matter of personal preference when editing, but the community generally agrees that two-spaces is how you should release all your code. Space indentation outnumbers tab indentation more than 10:1 in the source code.
Use curly braces for one-line blocks, use do...end for multi-line blocks