Inspired by suspenders, I decided to build out my own default Rails app.
Replace all the instances of 'basis' and 'Basis' with your app's name, using either all lowercase letters when replacing 'basis' and only the first letter uppercase when replacing 'Basis'. These are the files that should contain instances that need to be replaced (but you're better off doing a find/replace across all files in your text editor):
- .rvmrc
- app/views/layouts/application.html.erb, in title tag
- config/application.rb
- config/database.yml
- config/environment.rb
- config/environments/development.rb
- config/environments/production.rb
- config/environments/test.rb
- config/initializers/session_store.rb
Remove Gemfile.lock
from the .gitignore
file.
Edit this line from config/initializers/devise.rb
:
config.mailer_sender = '[email protected]'
Configure Errbit in config/initializers/errbit.rb
.
If you're not staying open-source, you'll probably want to:
- Remove the
.travis.yml
file - Remove the
gem 'coveralls', require: false
line from theGemfile
file - Remove the first two lines in the
spec/rails_helper.rb
file
bundle install
rake secret
- Replace the secret_key_base in
config/secrets.yml
with the result of this command
- Replace the secret_key_base in
rake db:create
- Run
rake db:migrate
to create the initial, blank, schema.rb file - Run
rake db:test:load
to set up the testing database - You will need to run
rake db:test:prepare
after every migration (do yourself a favor and addalias migrate="rake db:migrate && rake db:rollback && rake db:migrate && rake db:test:prepare"
to your.bash_profile
file) - Run
rspec
to run all the tests once (and to generate a coverage file incoverage/index.html
) - Run
guard
to monitor the project while you work (it will automatically run relevant tests whenever files are saved) - Optionally, install growlnotify from the Extras/growlnotify/growlnotify.pkg in Growl's disk image to get notifications from
guard
Errors are logged with Errbit
If you do not want to use Errbit:
- Remove the
gem 'airbrake'
line fromGemfile
- Remove the
config/initializers/errbit.rb
file
mailcatcher lets you view mail being sent by the app in the browser.
rvm default@mailcatcher --create
gem install mailcatcher
rvm wrapper default@mailcatcher --no-prefix mailcatcher catchmail
mailcatcher
- Go to http://localhost:1080
- Perform actions that produce emails
- http://localhost:1080 will automatically display the incoming email & provide notifications if you have Growl installed
metric_fu displays code metrics from the reports of many other tools.
To run it, run rspec
and then run metric_fu
in the Rails project directory.
Performance information can be logged to NewRelic:
- Uncomment the
# gem 'newrelic_rpm'
line fromGemfile
- Add your
newrelic.yml
file to theconfig
folder