- Ruby 1.9.3
- Redis Server download here
- Ubuntu 11.10+ (recommended) or Mac OS X
./configure
make
make or make server
Runs Thin server in production mode (Captcha enabled)
make server-benchmark
Runs Thin server in benchmark mode (Captcha disabled)
make specs
Runs the RSpec tests
make kill
Shutdowns Thin server
make kill-redis
Shutdowns Redis server
-
Download redis
wget http://redis.googlecode.com/files/redis-2.4.17.tar.gz
-
Unpack redis
tar zxvf redis-2.4.17.tar.gz
-
Compile redis
cd redis-2.4.17
make
-
Start redis-server
cd src
./redis-server &
-
Clone this repository
git clone git://github.com/diegossilveira/voting.git
cd voting
-
Install required gems
gem install bundler
bundle install
-
Run
rackup config.ru -s thin -E [production|benchmark]
-
Test
Just access http://localhost:9292/voting
- production
- benchmark - use this one in order to skip captcha challenges
- GET /voting [Participant selection page]
- POST /voting/:id [Vote on participant]
- GET /voting/stats [Get voting statistics]
- GET /voting/reset [Reset the voting counts]
Unit tests were implemented using RSpec
`make specs`