The core API behind the Velocitas GPS route analytics service.
Generated with Raygun.
To run the specs or fire up the server, be sure you have these installed (and running):
- Ruby 2.2 (see .ruby-version).
- PostgreSQL 9.x (
brew install postgresql) with superuser 'postgres' with no password (
createuser -s postgres).
brew install phantomjs).
First Time Setup
After cloning, run bin/setup to install missing gems and prepare the database.
rake db:sample_data loads a small set of data for development. Check out db/sample_data.rb
Running the Specs
Running the Application Locally
$ foreman start $ open http://localhost:3000
developmentis auto-deployed to acceptance.
masteris auto-deployed to production.
- Create feature branches off of
developmentusing the naming convention
(features|chores|bugs)/a-brief-description-######, where ###### is the tracker id.
- Rebase your branch before merging into
developmentto produce clean merge bubbles.
- Retain merge commits for multi-commit branches when merging into
git merge --no-ff branchname).
- Craft atomic commits that make sense on their own and can be easily cherry-picked or reverted if necessary.
Generally speaking, follow the Ruby Style Guide. Additionally, these are other guidelines adopted by the team:
Always use double quotes for test/spec descriptions, unless the subject is a class/module.
describe SomeController do context "when logged in as an admin" do describe "#some_method" do it "does some thing" end end end `
Additional/Optional Development Details
Code Coverage (local)
Coverage for the ruby specs:
$ COVERAGE=true rspec
Code coverage is reported to Code Climate on every CI build so there's a record of trending.
Guard is configured to run ruby and jasmine specs, and also listen for livereload connections.
$ bundle exec guard
$ gem install mailcatcher $ mailcatcher $ open http://localhost:1080/
Learn more at mailcatcher.me. And please don't add mailcatcher to the Gemfile.
Continuous Integration and Deployment with CircleCI
This project is configured for continuous integration and deployment with CircleCI and Heroku.
Acceptance and Production are hosted on Heroku under the firstname.lastname@example.org account.
Several common features and operational parameters can be set using environment variables.
SECRET_KEY_BASE- Secret key base for verfying signed cookies. Should be 30+ random characters and secret!
HOSTNAME- Canonical hostname for this application. Other incoming requests will be redirected to this hostname.
BASIC_AUTH_PASSWORD- Enable basic auth with this password.
BASIC_AUTH_USER- Set a basic auth username (not required, password enables basic auth).
PORT- Port to listen on (default: 3000).
Third Party Services
- Heroku for hosting.
- CircleCI for continuous integration and deployment.
Heroku needs a buildpack:
$ heroku buildpacks:add https://github.com/cyberdelia/heroku-geo-buildpack.git#1.3