-
Notifications
You must be signed in to change notification settings - Fork 0
/
HACKING
97 lines (71 loc) · 3.31 KB
/
HACKING
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
= Noosfero instructions for developers
This document provides useful information to those who want to help with
Noosfero development.
== Requirements for development
First, install all requirements listed in INSTALL. Note that you do not need to
follow all the steps described there, you only need to install the packages
listed in the "Requirements" section.
After installing the requirements listed in INSTALL, you need to install some
packages be able to run Noosfero tests. On Debian GNU/Linux and Debian-based
systems, you install them with the following command:
# apt-get install libtidy-ruby libhpricot-ruby libmocha-ruby imagemagick po4a xvfb libxml2-dev libxslt-dev
On other systems, they may or may not be available through your regular package
management system. Below are the links to their homepages.
* Mocha: http://mocha.rubyforge.org/
* Tidy: http://tidy.sourceforge.net/
* Hpricot: http://github.com/whymirror/hpricot
* Imagemagick: http://wwwimagemagick.org/
* po4a: http://po4a.alioth.debian.org/
* xvfb: http://packages.debian.org/lenny/xvfb
* Libxml2: http://xmlsoft.org/
* Libxslt: http://xmlsoft.org/xslt
== Boostraping a development/test environment
You can copy and paste the commands below into a terminal (please review the
commands and make sure you understand what you are doing):
# checkout the code from repository
git clone git://gitorious.org/noosfero/noosfero.git
# enter the directory
cd noosfero
# copy a sample config file
cp config/database.yml.sqlite3 config/database.yml
# create tmp directory if it doesn't exist
mkdir tmp
# create the development database
rake db:schema:load
# run pending migrations
rake db:migrate
# compile translations:
rake makemo
# create some test data:
./script/sample-data
# install latest requirements for running tests
RAILS_ENV=cucumber rake gems:install
RAILS_ENV=test rake gems:install
# run the automated test suite to make sure your environment is sane:
rake test
You should now be ready to go. Issue the following command to start the Rails
development server:
./script/server
The server will be available at http://localhost:3000/ . If you want to use
another port than 3000, you can use the -p option of ./script/server:
./script/server -p 9999
The above command makes the server available at http://localhost:9999/
The sample-data data scripts creates two administrator users with login "ze" and
password "test" and login "adminuser" and password "admin".
Note that some operations, like generating image thumbnails, sending e-mails,
etc, are done in background in the context of a service independent from the
Rails application server. To have those tasks performed in a development
environment, you must run the delayed_job server like this:
./script/delayed_job run
This will block your terminal. To stop the delayed_job server, hit Control-C.
== Enabling exceptions notification
By default, exception notifications are disabled in development environment. If
you want to enable it then you need to change some files:
1) Add in config/environments/development.rb:
config.action_controller.consider_all_requests_local = false
2) Add in app/controller/application.rb:
local_addresses.clear
3) Add in config/noosfero.yml at development section:
exception_recipients: [[email protected]]
== Releasing and building Debian package
See RELEASING file.