A Ruby on Rails app for managing time sheets of student assistants.
Branch | Travis CI | Code Analysis | Heroku Deploy | Errbit |
---|---|---|---|---|
master | [deployed app] | [link] | ||
dev | [codeclimate diff to master] | [deployed app] |
When TravisCI run all tests successfully, the build is deployed to heroku. This is done for the master branch as well as the dev branch.
bundle install
Install the required Ruby gem dependencies defined in the Gemfilecp database.sqlite.yml database.yml
Select database config (for development we recommend SQLite)rake db:create db:migrate db:seed
Setup database, run migrations, seed the database with defaultsrails s
Start the Rails development server (By default runs on localhost:3000)bundle exec rspec
Run all the tests (using the RSpec test framework)
If you want to use a VM to setup the project (e.g. when on Windows), we recommend Vagrant. Please keep in mind that this method may lead to a loss in performance, due to the added abstraction layer.
vagrant up # bring up the VM
vagrant ssh # login using SSH
cd hpi-swt2
echo "gem: --no-document" >> ~/.gemrc # disable docs for gems
bundle install # install dependencies
gem install pg # required for Postgres usage
cp config/database.psql.yml config/database.yml # in case you want to use Postgres
cp config/database.sqlite.yml config/database.yml # in case you want to user SQLite
exit # restart the session, required step
vagrant ssh # reconnect to the VM
cd hpi-swt2
rails s -b 0 # start the rails server
# the -b part is necessary since the app is running in a VM and would
# otherwise drop the requests coming from the host OS
The following environment variables should be set:
HOST
SECRET_KEY_BASE
EMAIL_PW
EMAIL_USER
IDENTITY_URL
bundle exec rake db:migrate && bundle exec rake db:migrate RAILS_ENV=test
Migrate dbsbundle exec rake assets:clobber && bundle exec rake assets:precompile
Redo asset generationbundle exec rspec spec/<rest_of_file_path>.rb
Specify a folder or test file to runrails c --sandbox
Test out some code in the Rails console without changing any datarails g migration DoSomething
Create migration _db/migrate/*DoSomething.rb.rails dbconsole
Starts the CLI of the database you're usingbundle exec rake routes
Show all the routes (and their names) of the applicationbundle exec rake about
Show stats on current Rails installation, including version numbersbundle exec rspec --profile
examine how much time individual tests take