]> git.openstreetmap.org Git - rails.git/blob - README.md
Fixed incorrect link generation in sent message list
[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.
45
46 There are also weekly IRC meetings, at 1800 GMT on Mondays in #osm-ewg on
47 the OFTC network where questions can be asked and ideas discussed. For more 
48 information, please see [the EWG page]
49 (http://www.osmfoundation.org/wiki/Engineering_Working_Group#Meetings). You can
50 join the channel using your favourite IRC client or [irc.openstreetmap.org](http://irc.openstreetmap.org/).
51
52 ## Rails
53
54 If you're not already familiar with Ruby on Rails then it's probably
55 worth having a look at [Rails Guides](http://guides.rubyonrails.org/) for an introduction.
56
57 While working with Rails you will probably find the [API documentation](http://api.rubyonrails.org/)
58 helpful as a reference.
59
60 ## Coding style
61
62 When writing code it is generally a good idea to try and match your
63 formatting to hat of any existing code in the same file, or to other
64 similar files if you are writing new code. Consistency of layout is
65 far more important that the layout itself as it makes reading code
66 much easier.
67
68 One golden rule of formatting -- please don't use tabs in your code
69 as they will cause the file to be formatted differently for different
70 people depending on how they have their editor configured.
71
72 ## Testing
73
74 Having a good suite of tests is very important to the stability and
75 maintainability of any code base. The tests in the Rails port code are
76 by no means complete, but they are extensive, and must continue to be
77 so with any new functionality which is written. Tests are also useful
78 in giving others confidence in the code you've written, and can
79 greatly speed up the process of merging in new code.
80
81 When hacking, you should:
82
83 * Write new tests to cover the new functionality you've added.
84 * Where appropriate, modify existing tests to reflect new or changed
85 functionality.
86 * Never comment out or remove a test just because it doesn't pass.
87
88 ## Comments
89
90 Sometimes it's not apparent from the code itself what it does, or,
91 more importantly, **why** it does that. Good comments help your fellow
92 developers to read the code and satisfy themselves that it's doing the
93 right thing.
94
95 When hacking, you should:
96
97 * Comment your code - don't go overboard, but explain the bits which
98 might be difficult to understand what the code does, why it does it
99 and why it should be the way it is.
100 * Check existing comments to ensure that they are not misleading.
101
102 ## Committing
103
104 When you submit patches, the project maintainer has to read them and
105 understand them. This is difficult enough at the best of times, and
106 misunderstanding patches can lead to them being more difficult to
107 merge. To help wit this, when submitting you should:
108
109 * Split up large patches into smaller units of functionality.
110 * Keep your commit messages relevant to the changes in each individual
111 unit.
112
113 When writing commit messages please try and stick to the same style as
114 other commits, namely:
115
116 * A one line summary, starting with a capital and with no full stop.
117 * A blank line.
118 * Full description, as proper sentences with capitals and full stops.
119
120 For simple commits the one line summary is often enough and the body
121 of the commit message can be left out.
122
123 ## Sending the patches
124
125 If you have forked on GitHub then the best way to submit your patches is to
126 push your changes back to GitHub and then send a "pull request" on GitHub.
127
128 Otherwise you should either push your changes to a publicly visible git repository
129 and send the details to the [rails-dev](http://lists.openstreetmap.org/listinfo/rails-dev)
130 list or generate patches with `git format-patch` and send them to the
131 [rails-dev](http://lists.openstreetmap.org/listinfo/rails-dev) list.
132