Getting started with a new project should be as simple as possible, even for someone who is not technical. As a maintainer, you must make sure that anyone can clone your project and get it up and running in a few minutes.
After you clone a project, you should follow two steps:
In this example, the project is a web application, but it works for other projects too.
You should have a small bash script called
bin/setup in every project. You
could use Ruby for the script if that’s
what you prefer.
At OmbuLabs , one of our latest
looks like this:
In order for our script to work, you must have a
.env.sample file that
has some default values for your
.env file. Every project you start must
.env file with environment configuration. Why?
If you are using Rails, starting an application is simple:
If you are using Bundler , then you would need to run it like this:
bundle exec shotgun config.ru
What if you want to use Foreman ?
You get the point. There are way too many ways to start a web application. We
need to standardize this into something flexible like
One of our latest
bin/start scripts looks like this:
From now on, all the web applications that we build at OmbuLabs will be able to get started like this:
It won’t matter if we use Foreman, Sinatra,
Cuba , Rails, Shotgun, or whatever.
bin/start will know how to get the application started in a development
I love how simple it can be to tell anyone to clone the project and run these steps:
cd path/to/project ./bin/setup ./bin/start
A web designer that has no experience with Ruby/Rails can setup and start a web application in a few minutes.
I’m a big fan of Convention over Configuration . Also, I hate it when it takes me half a day to setup a new application in my environment. It should never take more than a few minutes.