Install dependencies for a Ruby on Rails application:
ruby
(install via rbenv the version specified in the Gemfile)bundler
rails
mysql
mailcatcher
Add the following environment variable(s) to your profile, modifying value(s) as desired:
export GTFS_SOURCE_URL="http://www.shorelineeast.com/google_transit.zip"
Obtain source code:
git clone git@github.com:data-creative/next-train.git
cd next-train
Install gem dependencies.
bundle install --without production
Create database user:
mysql -uroot -p
mysql> CREATE USER 'next_train'@'localhost' IDENTIFIED BY 'next_train';
mysql> GRANT ALL ON *.* to 'next_train'@'localhost';
mysql> exit
Create database:
bundle exec rake db:create
bundle exec rake db:migrate
Populate database:
bundle exec rake db:seed
bundle exec rake gtfs:import
Start development web server:
rails s
Then view in browser at localhost:3000.
Start a local mail server:
mailcatcher
Start development console:
rails c
Prepare test environment database:
bundle exec rake db:test:prepare
Run tests:
bundle exec rspec spec
Generate test coverage report:
COVERAGE=true bundle exec rspec spec