--- layout: default title: "Contribute" current: "contribute" ---
Merb has a fledgling wiki that would love to meet you. The wiki is a great place to garner and contribute up-to-date information on all things Merb.
Found a bug? Ticket it! Go to our Lighthouse app and set up a login, then add your ticket. For any tickets that you do add, please try to be as descriptive as possible, the developers well thank you for it.
Even if you don’t feel you contribute code, reporting bugs is a huge help, so please report anything awry you encounter.
Contributing to Merb is as easy as checking the source out from Github, editing it, and creating a patch. Learn all about using git, Github, and making patches.
$ git clone git://github.com/merb/merb.git
$ cd merb-core
$ vim the_source_file.rb
$ git commit -a -m "fix a bug"
$ git-format-patch master..
There are a few guidelines your code should follow.
# BAD!
def my_method param, arg
puts "OH NOEZ!"
end
# GOOD!
def my_method(param, arg)
puts "HOORAYZ!" end
# BAD!
def tabby
puts "A fat tab!"
end
# GOOD!
def tabby
puts "Two spaces!"
end
We would like to move merb over to a YARD based documentation system. To that end, we ask if you touch a file, update it to YARD syntax.
The old style of the documentation follows this system:
There are a number of available types:
String
)Array[Type]
(e.g. Array[String]
, an Array of Strings)Array[Type, Type]
(e.g. Array[String, Symbol]
, an Array of two elements: a String followed by a Symbol)Hash{Type => Type}
(e.g. Hash{Symbol => String}
, a Hash whose keys are Symbols and values are Strings)Hash{Type => Type, Type => Type}
(e.g. Hash{Symbol => String, Class => String}
, a Hash with two elements)(String, Symbol)
; (e.g. Array[(String, Symbol)]
, an Array whose elements are Strings or Symbols)~to_s
(responds_to? :to_s
)Certain types of parameters do not require types:
*args
&blk
Parameters are defined in parameter blocks:
==== Parameters
foo<String>:: My foo string
bar<String>:: My bar string
The return value of a function is required:
==== Returns
String:: A cool string
If the method might possibly raise an error (including as a result of calling another method), it must be specified:
==== Raises
Exception:: A crazy Exception
If one of the parameters is an options Hash, it must be specified:
==== Options (opts)
:foo<String>:: The foo option
:bar<Symbol>:: The bar option
Cleverness for cleverness sake is not our friend; if something is only slightly more handy but infinitely more complex, then please reconsider your implementation.
80 column line width except in exceptional situations