]> git.openstreetmap.org Git - rails.git/blob - README.md
Potlatch 2 localisation updates
[rails.git] / README.md
1 # Description
2
3 This is the Rails port, the [Ruby on Rails](http://rubyonrails.org/)
4 application that powers [OpenStreetMap](http://www.openstreetmap.org).
5
6 The Rails port provides almost all the services which are available 
7 on the OpenStreetMap site, including:
8
9 * The web site itself, including the edit pages.
10 * The editing [API](http://wiki.openstreetmap.org/wiki/API_v0.6).
11 * Browse pages - a web front-end to the OpenStreetMap data.
12 * The user system, including preferences, diary entries, friends and
13   user-to-user messaging.
14 * GPX uploads, browsing and API.
15
16 There are some non-Rails services which the site includes, for 
17 example; tiles, geocoding, GPX file loading. There are also some
18 utilities which provide other services on the OpenStreetMap site,
19 or improve its function, but are not integrated with the Rails 
20 port, for example; Osmosis, CGImap.
21
22 # License
23
24 This software is licensed under the [GNU General Public License 2.0](http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt),
25 a copy of which can be found in the LICENSE file.
26
27 # Running it
28
29 You can find documentation on [how to setup and
30 run](http://wiki.openstreetmap.org/wiki/The_Rails_Port) the software
31 on the OpenStreetMap wiki.
32
33 # Hacking it
34
35 The canonical Git repository for this software is hosted at
36 [git.openstreetmap.org](http://git.openstreetmap.org/?p=rails.git),
37 but much of the development is done on GitHub and for most people
38 [this repository on Github](https://github.com/openstreetmap/openstreetmap-website)
39 will be a better place to start.
40
41 Anybody hacking on the code is welcome to join the
42 [rails-dev](http://lists.openstreetmap.org/listinfo/rails-dev) mailing
43 list where other people hacking on the code hang out and will be happy
44 to help with any problems you may encounter. If you are looking for a
45 project to help out with, please take a look at the list of 
46 [Top Ten Tasks](http://wiki.openstreetmap.org/wiki/Top_Ten_Tasks) that
47 EWG maintains on the wiki.
48
49 There are also weekly IRC meetings, at 1800 GMT on Mondays in #osm-ewg on
50 the OFTC network where questions can be asked and ideas discussed. For more 
51 information, please see [the EWG page]
52 (http://www.osmfoundation.org/wiki/Engineering_Working_Group#Meetings). You can
53 join the channel using your favourite IRC client or [irc.openstreetmap.org](http://irc.openstreetmap.org/).
54
55 ## Rails
56
57 If you're not already familiar with Ruby on Rails then it's probably
58 worth having a look at [Rails Guides](http://guides.rubyonrails.org/) for an introduction.
59
60 While working with Rails you will probably find the [API documentation](http://api.rubyonrails.org/)
61 helpful as a reference.
62
63 ## Coding style
64
65 When writing code it is generally a good idea to try and match your
66 formatting to hat of any existing code in the same file, or to other
67 similar files if you are writing new code. Consistency of layout is
68 far more important that the layout itself as it makes reading code
69 much easier.
70
71 One golden rule of formatting -- please don't use tabs in your code
72 as they will cause the file to be formatted differently for different
73 people depending on how they have their editor configured.
74
75 ## Testing
76
77 Having a good suite of tests is very important to the stability and
78 maintainability of any code base. The tests in the Rails port code are
79 by no means complete, but they are extensive, and must continue to be
80 so with any new functionality which is written. Tests are also useful
81 in giving others confidence in the code you've written, and can
82 greatly speed up the process of merging in new code.
83
84 When hacking, you should:
85
86 * Write new tests to cover the new functionality you've added.
87 * Where appropriate, modify existing tests to reflect new or changed
88 functionality.
89 * Never comment out or remove a test just because it doesn't pass.
90
91 ## Comments
92
93 Sometimes it's not apparent from the code itself what it does, or,
94 more importantly, **why** it does that. Good comments help your fellow
95 developers to read the code and satisfy themselves that it's doing the
96 right thing.
97
98 When hacking, you should:
99
100 * Comment your code - don't go overboard, but explain the bits which
101 might be difficult to understand what the code does, why it does it
102 and why it should be the way it is.
103 * Check existing comments to ensure that they are not misleading.
104
105 ## Committing
106
107 When you submit patches, the project maintainer has to read them and
108 understand them. This is difficult enough at the best of times, and
109 misunderstanding patches can lead to them being more difficult to
110 merge. To help wit this, when submitting you should:
111
112 * Split up large patches into smaller units of functionality.
113 * Keep your commit messages relevant to the changes in each individual
114 unit.
115
116 When writing commit messages please try and stick to the same style as
117 other commits, namely:
118
119 * A one line summary, starting with a capital and with no full stop.
120 * A blank line.
121 * Full description, as proper sentences with capitals and full stops.
122
123 For simple commits the one line summary is often enough and the body
124 of the commit message can be left out.
125
126 ## Sending the patches
127
128 If you have forked on GitHub then the best way to submit your patches is to
129 push your changes back to GitHub and then send a "pull request" on GitHub.
130
131 Otherwise you should either push your changes to a publicly visible git repository
132 and send the details to the [rails-dev](http://lists.openstreetmap.org/listinfo/rails-dev)
133 list or generate patches with `git format-patch` and send them to the
134 [rails-dev](http://lists.openstreetmap.org/listinfo/rails-dev) list.
135