Skip to content

Latest commit

 

History

History
107 lines (71 loc) · 1.47 KB

CONTRIBUTING.md

File metadata and controls

107 lines (71 loc) · 1.47 KB

Contributing

Development Environment Setup

Prerequisites

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"

Installation

Obtain source code:

git clone git@github.com:data-creative/next-train.git
cd next-train

Install gem dependencies.

bundle install --without production

Database Setup

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

Web Server

Start development web server:

rails s

Then view in browser at localhost:3000.

Mail Server

Start a local mail server:

mailcatcher

Local Development Console

Start development console:

rails c

Testing

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