Skip to content

Latest commit

 

History

History
42 lines (25 loc) · 4.39 KB

rails-template.md

File metadata and controls

42 lines (25 loc) · 4.39 KB

Not a Rails Template

We have noted that any template that is kept in code needs to be maintained, but are generally not. Therefore instead of maintaining a template we are going to utilize another method of pointing to existing code repos for our current understanding of best practices.

As you utilize this documentation please update it with the latest information

Generate a basic Rails Application

You will want to generate your new application using rails new For ORCID@Princeton we utilized this tutorial for integrating vite with rails. The tutorial suggest utilizing tailwind as your javascript framework, but after trying it we decided against it and just went with bootstrap.

Add in rspec

We utilize rspec instead of minitest so remove minitest and add rspec. Here is an example of this on ORCID@princeton

Add in Lando

We utilize lando (which is a layer above docker) for running dependencies like the database and solr. Here is an example of a lando config file for just a database and one that has solr

We utilize a rake task for starting the servers and a script to set the lando information in the Rails environment

Add in Simplecov

We utilize simplecov to check that our code remains covered as we develop it. Here is a rake task to check our coverage.

Add in Rubocop

We utilize rubocop and bixby (from the samvera community) to make sure our code looks consistant. Add in the bixby gem and create an initial rubocop install. Here is an example rubocop configuration file from OCID@Pricneton

Add in eslint

We utilize eslint to make sure our javascript looks consistent. Here is an example eslint configuration file from OCRID@Princeton

We generally start with the airbnb base and a few other packages installed with yarn.

Add in Circle CI

We utilize circle ci for continuos integration. Here is a tutorial for implementing continuos integration. And here is the config file from OCID@Princeton. Note the coverage is initially set to zero on line 112!

Add in Capistrano

We utilize capistrano to deploy to the production and staging servers. Here is an example commit for adding in capistrano to ORCID@princeton which was created following the install instructions here

Add in Vite

If you followed the instructions for a new rails application from the vite tutorial you should already have vite install.

Make sure you remove sprockets so that vite is handling all your assets.