What is water?
Water is system for managing the hand-in and reviewing of programming assignments. It combines a git-based backend with an awesome web interface.
What is awesome about it?
- Hand-ins can be made via the command line using a git push or via the awesome web interface
- The web interface is awesome because you can:
- upload multiple files simultaneously
- see and manage the tree structure of your hand-in
- mix hand-ins via git and the web interface
- Teachers and assistants can comment on specific lines of code
- Hand-ins can be automatically checked for compliance with a set of technical requirements - no more waiting days just to be rejected because a mere technicality
- Make sure you run ruby 1.9.2 or above using
ruby -v, otherwise install it.
- Install beanstalkd, used for internal messaging.
- Install and start PostgreSQL.
- Install foreman using
gem install foreman
- Make sure you have some kind of
- Clone project using
git clone firstname.lastname@example.org:water/mainline.git water
- Checkout the master branch.
git checkout master
- Navigate to the config folder, create a file called
database.ymlwith the your postgresql credentials. Example credentials
- Install all dependencies using
- Create two empty log files, just in case rails complains about it,
touch log/development.log log/test.log
gitorious.ymland change hosts and usernames to suit your system
- Create the db and migrate it
bundle exec rake db:create db:migrate.
- Start poller, git-daemon beanstalkd and spork by running
- Seed the db
CLEAR=1 bundle exec rake db:seed
- Start server,
- Navigate to localhost:3000
- Login using the information from
- Install PostgreSQL, use your favorite package manager or download src from http://www.postgresql.org/download/
- Start the server deamon, the precompiled binary packages comes with init-scripts (eg
rc.d start postgresql||
service postgresql start) or you can run
- Create a user
sudo su postgres
CREATE ROLE username WITH SUPERUSER CREATEDB CREATEROLE PASSWORD 'password' LOGIN;
- (optional) Add postgres to autostart using distro-specific methods eg (
chkconfig postgresql on|| add it to runlevel 5 init-scripts, run-level 3 for servers)
sudo apt-get install postgresql postgresql-server-dev-9.1
- Follow the Linux guidelines above about creating a user
sudo service postgresql restart
brew install postgresql
pg_ctl -D /usr/local/var/postgres -l /usr/local/var/postgres/server.log start
- Get the binary from http://www.postgresql.org/download/macosx/ The binary includes the pgAdmin program which may aid in development and debugging.
sudo apt-get install beanstalkd
brew install beanstalkd
Generating nice graphic of model
To better get a understanding for our model, it's nice to get a graphical
overview of it.
railroady can create it for you automatically, install
if first by
gem install railroady and then issue
railroady -M | grep -v "Overwriting" | dot -Tsvg > Model.svg
grep -v part is a hack to get rid of the warnings rails
wrongly writes to stdin rather than stderr.
- Migrate test database
RAILS_ENV=test bundle exec rake db:create db:migrate
- Start the DRb server (spork) by running
- Wait until it says Spork is ready and listening on 8988!, which takes about ~20 sec.
- Download fixtures using
git submodule update --init
- Run a test
- a specific test file
- all specs
- a specific line in a specific file
rspec spec/my_spec.rb -l 10
- a specific test file