Rails 3 app for playing the board game Go online.
Ruby JavaScript
Failed to load latest commit information.
app fixing bug where it would try to send an invitation email for a govsg… Jul 1, 2011
autotest switching to rspec Oct 15, 2010
config automatically clear old stuck games each day Feb 21, 2013
db send email containing chat message when user requests it Feb 12, 2011
doc initial commit with game model Oct 15, 2010
lib automatically clear old stuck games each day Feb 22, 2013
public bump up jquery ajax timeout so it doesn't leave long requests hanging Mar 7, 2011
script specifying path to bundler gemfile in worker Dec 8, 2010
spec fixing bug where it would try to send an invitation email for a govsg… Jul 1, 2011
vendor/plugins initial commit with game model Oct 16, 2010
.gitignore adding email notifications Dec 14, 2010
.rspec adding initial invitation feature Dec 13, 2010
.rvmrc updating .rvmrc May 15, 2011
.travis.yml use Ruby 1.9.2 in travis.yml Jul 1, 2011
Capfile adding basic deploy.rb script Oct 15, 2010
Gemfile send email move notification even when receipient is online because i… Jun 20, 2011
Gemfile.lock send email move notification even when receipient is online because i… Jun 20, 2011
Guardfile send email move notification even when receipient is online because i… Jun 20, 2011
LICENSE removing jquery-ui because I'm not using it (yet) Oct 18, 2010
README.markdown automatically clear old stuck games each day Feb 22, 2013
Rakefile initial commit with game model Oct 16, 2010
config.ru initial commit with game model Oct 16, 2010

README.markdown

Go vs Go

This is the source code for govsgo.com, a site for playing the board game Go online with other players or against the computer.

If you have problems or suggestions, please post them on the Issue Tracker.

Setup

Ruby 1.9.2 is required. If you're using RVM it should automatically switch to 1.9.2 when entering the directory.

Run the following commands to set it up. Note the Homebrew command to install GNU Go and Beanstalk. You may want to use a different packaging system or install them from the source.

bundle
cp config/database.example.yml config/database.yml
cp config/private.example.yml config/private.yml
rake db:create db:migrate
brew install gnu-go beanstalk

You can start up the server with rails s and run the specs with rake.

Background Process

In production, the computer moves are handled in a background process because GNU Go can take a while and we don't want to tie up the Rails process during this time.

If you want to test the background process, set background_process: true in your config/private.yml file. Next run beanstalkd and script/worker. to start up the processes. Alternatively you can use god to start and monitor it. See the config/god.rb file.

Fix GNU Go

If GNU Go seems to be stuck, it may have run into a game or two that it cannot complete. Run the following command in the rails console to clear out any old games that are stuck.

Game.where("current_player_id IS NULL AND finished_at IS NULL and updated_at < ?", 1.day.ago).update_all(:finished_at, Time.zone.now)

Then restart Beanstalkd, the worker, and web server.

sudo /etc/init.d/beanstalkd restart
god restart govsgo-worker
touch tmp/restart.txt

Credits

This site was originally created for Rails Rumble 2010 by Ryan Bates, James Edward Gray II and Phil Bates.