1 * https://www.ruby-lang.org/ - The homepage of Ruby which has more links and some great tutorials.
 
   2 * http://rubyonrails.org/ - The homepage of Rails, also has links and tutorials
 
   6 When writing code it is generally a good idea to try and match your
 
   7 formatting to that of any existing code in the same file, or to other
 
   8 similar files if you are writing new code. Consistency of layout is
 
   9 far more important than the layout itself as it makes reading code
 
  12 One golden rule of formatting -- please don't use tabs in your code
 
  13 as they will cause the file to be formatted differently for different
 
  14 people depending on how they have their editor configured.
 
  18 Having a good suite of tests is very important to the stability and
 
  19 maintainability of any code base. The tests in the Rails port code are
 
  20 by no means complete, but they are extensive, and must continue to be
 
  21 so with any new functionality which is written. Tests are also useful
 
  22 in giving others confidence in the code you've written, and can
 
  23 greatly speed up the process of merging in new code.
 
  25 When hacking, you should:
 
  27 * Write new tests to cover the new functionality you've added.
 
  28 * Where appropriate, modify existing tests to reflect new or changed
 
  30 * Never comment out or remove a test just because it doesn't pass.
 
  32 You can run the existing test suite with:
 
  38 You can generate test coverage stats with:
 
  42 rcov -x gems test/*/*.rb
 
  45 The tests are automatically run on Pull Requests and other commits with the
 
  46 results shown on [Travis CI](https://travis-ci.org/openstreetmap/openstreetmap-website).
 
  50 Sometimes it's not apparent from the code itself what it does, or,
 
  51 more importantly, **why** it does that. Good comments help your fellow
 
  52 developers to read the code and satisfy themselves that it's doing the
 
  55 When hacking, you should:
 
  57 * Comment your code - don't go overboard, but explain the bits which
 
  58 might be difficult to understand what the code does, why it does it
 
  59 and why it should be the way it is.
 
  60 * Check existing comments to ensure that they are not misleading.
 
  64 To generate the HTML documentation of the API/rails code, run the command
 
  72 When you submit patches, the project maintainer has to read them and
 
  73 understand them. This is difficult enough at the best of times, and
 
  74 misunderstanding patches can lead to them being more difficult to
 
  75 merge. To help with this, when submitting you should:
 
  77 * Split up large patches into smaller units of functionality.
 
  78 * Keep your commit messages relevant to the changes in each individual
 
  81 When writing commit messages please try and stick to the same style as
 
  82 other commits, namely:
 
  84 * A one line summary, starting with a capital and with no full stop.
 
  86 * Full description, as proper sentences with capitals and full stops.
 
  88 For simple commits the one line summary is often enough and the body
 
  89 of the commit message can be left out.
 
  91 ## Sending the patches
 
  93 If you have forked on GitHub then the best way to submit your patches is to
 
  94 push your changes back to GitHub and then send a "pull request" on GitHub.
 
  96 Otherwise you should either push your changes to a publicly visible git repository
 
  97 and send the details to the [rails-dev](https://lists.openstreetmap.org/listinfo/rails-dev)
 
  98 list or generate patches with `git format-patch` and send them to the
 
  99 [rails-dev](https://lists.openstreetmap.org/listinfo/rails-dev) list.