How to hack on One Click Orgs
- Ruby 1.9.3 (recommended). 2.0.0 is also supported.
- RubyGems 1.3.7 or higher
- Bundler 1.3 or higher (install with
gem install bundler)
- MySQL, including client libraries (e.g. libmysqlclient-dev on Debian)
- wkhtmltopdf N.B. One Click Orgs is not compatible with the wkhtmltopdf in Debian/Ubuntu's packages.
Grab the source:
$ git clone git://github.com/oneclickorgs/one-click-orgs.git $ cd one-click-orgs
If you want to work on the version 1 branch (the associations platform), check it out:
$ git branch v1.x origin/v1.x $ git checkout v1.x
Install the required gems using Bundler:
$ bundle install # installs gem system-wide
$ bundle install --path vendor/bundle # vendors everything, no system gems
Create your local config files:
$ bundle exec rake oco:generate_config
Set up your database connection settings, by editing config/database.yml as desired.
If your database user doesn't have CREATE DATABASE permissions, create the databases manually, e.g.:
$ mysql -u root -p mysql> create database one_click_development; mysql> create database one_click_test; mysql> exit;
(Create and) migrate the database:
$ bundle exec rake db:setup
Start the web server:
$ bundle exec rails server
(Optional) In another shell, start the job server (which sends emails and closes proposals):
$ script/delayed_job run # run in foreground $ script/delayed_job start # start as daemon (check log/delayed_job.log) $ bundle exec rake jobs:work # foreground, from rake $ bundle exec rake jobs:clear # clear queue
You can just choose 'single organisation mode', or if you want to test multi-tenancy mode, you'll need lines in your hosts file which point
yourorganisation.localhost, etc. to
Quickly creating an association
Unless you're working on the founding stage itself, it can be handy to create an active association to experiment with, without having to walk through all the founding steps manually.
To do this, run the
oco:dev:create_association rake task:
$ bundle exec rake oco:dev:create_association
When you pull updates from the repository, you may need to update your gem bundle (if
Gemfile.lock has changed) and/or migrate your database (if
db/migrate has changed):
$ bundle install $ bundle exec rake db:migrate
These commands will safely no-op if no changes are necessary.
Before you submit any patches make sure that no tests fail:
$ bundle exec rake spec $ bundle exec rake cucumber
To submit a patch, you have several options:
Put your changes in a branch with an appropriate name, and push it to your GitHub repository, and send a pull request to
Open or reply to an issue in the issue tracker, and tell us where to find your commits.
Send a patch to the mailing list.
There is a mailing list and an IRC channel, #oneclickorgs on irc.freenode.net.