Freehub Developer Guide

Alon Salant edited this page May 18, 2016 · 25 revisions

This developer guide is a work in progress with information added as we need to capture it.

Contributors

To contribute to Freehub, join the freehub-users google group and introduce yourself. We’ll take it from there.

You can check Freehub out from GitHub.

See Where To Find Things to start getting familiar with Freehub.

Development

Set up your development environment with recent versions of rvm, MySQL and Rails version 2.3.17 per http://rubyonrails.org/down.

Then check out Freehub, create the test and development databases, migrate the database the current version and run the test suite:

git clone http://github.com/asalant/freehub.git freehub
cd freehub
rake db:create:all
rake db:migrate
rake test

If all tests pass you are set up and ready to go. To load the fixture data so that you can play with Freehub in your development environment run:

rake db:fixtures:load

See test/fixtures/users.yml for test login information.

Linux Setup Notes

Installing the MySQL gem on Fedora requires the ruby-devel package. Ubuntu based (and probably Debian based) distros require package libmysql-ruby. It may be easier to install the gem from your package manager than using the gem install scripts.

Deployment

For http://freehub.bikekitchen.org Freehub is deployed on Engine Yard AppCloud from the ‘release’ branch of this GitHub project. Use the AppCloud dashboard to trigger new stage and production deploys.

Command Line

You may also trigger deploys with GitHub post-commit hooks.

To merge master to the stable release branch and deploy to staging:

git checkout release
git merge -m"[deploy Freehub_Staging migrate] Deploy release branch to staging" master 
git push origin release

To release the stable release branch to production:

git checkout release
git commit --allow-empty -m"[deploy Freehub_Production migrate] Deploy release branch to production" 
git push origin release

Related Projects/Tools

Freehub uses:

  • HAML for generating markup in its views.
  • the Ruby Test::Unit testing suite with Rails fixtures.
  • annotate-models plugin for model schema information

References and Tutorials

  • Rails API, method reference
  • Front to back Rails tutorial that uses github as its example VCS. Uses Heroku for deployment, eRB for views and rspec for testing, which isn’t that helpful, but it’s a good starter tutorial anyway.
  • RailsGuides In depth guides to particular features. Look here if you’re already familiar with rails, but need more.

License

Freehub is licensed for use under the Apache 2.0 License.