Speed up your Sinatra development with OpeningAct

OpeningAct creates a template for your Sinatra application.

Having built a handful of Sinatra applications, I’ve come to enjoy the charming lightweight framework and the control it provides. However, the initial file creation can be tedious, especially when you add in databases and tests. I was sure I wasn’t the first person to think this, especially with other ruby gems and frameworks that take care of file creation for you, such as Bundler’s gem template andRails.

However, when I looked online for such gems, I came up empty handed. There is a Sinatra template on GitHub (which I used to help create the OpeningAct template) but that still didn’t provide me a quick and easy way of creating a template from the command line. That’s where OpeningAct was born.

OpeningAct is a gem that provides a simple Sinatra template so you can focus on your application development. Using OpeningAct is as simple as a two commands:

$ gem install opening_act
$ opening

After being prompted for a name and test framework preference, a project directory will be created:

├── .git
├── Gemfile
├── Gemfile.lock
├── LICENSE.txt
├── Procfile
├── README.md
├── Rakefile
├── config.ru
├── environment.rb
├── public
│ ├── javascript
│ │ └── script.js
│ └── stylesheets
│ ├── main.css
│ └── reset.css
├── sample.rb
├── test
│ ├── sample_test.rb
│ └── test_helper.rb
└── views
├── index.erb
└── layout.erb
5 directories, 17 files

And you will be ready for development. It even comes with some built in rake tasks that make testing a cinch.

If you want to see the progress of your application at any time, just run:

ruby your_app_name.rb
heroku local web

As of right now, OpeningAct only supports a template for the main application and testing. However, I’m hoping to add template support for databases, such as Datamapper and Sequel/PostgreSQL.

If this gem interests you, install it on your machine via the CLI gem install opening_act. And if you wish to contribute, please fork the project on Github.