Rails is one of the most popular web development frameworks. For those who do not know, it represents a compilation of many commonly used programming libraries written in Ruby, and that comes with the pattern of convention over configuration. In other words, it saves you a lot of time by avoiding the need to repeat the same initial procedures of setting up a project and so you only need to start implementing the business logic.
There are other Ruby gems that do not come with Rails, and that you may need to add. More specifically, there are gems that can be used widely in the projects that you work on, and that you need to add each time you create a new Rails project. That might be a bit boring and tedious.
One Rails-type bundler of many helpful gems that I really like is suspenders, developed by thoughtbot – the team that is behind very popular Ruby gems such as factory_girl and paperclip. It is the base application used at this company, which was generous enough to share it with all of us.
Something that I really like about suspenders are the testing gems that come with suspenders. When you generate a new Rails application with suspenders, you will also have the project directories for your tests already set up. It is something very handy when you want to start writing an application using TDD – Test Driven Development and not want to have to follow the gems documentation on how to configure them. Here is a list with these gems:
- Capybara and Capybara WebKit for integration testing
- Factory Girl for test data
- Formulaic for integration testing HTML forms
- RSpec for unit testing
- RSpec Mocks for stubbing and spying
- Shoulda Matchers for common RSpec matchers
- Timecop for testing time
Moreover, suspenders also allows you to deploy your application to Heroku really quickly. It also includes many goodies that can save you time up front:
Suspenders also comes with:
- The ./bin/setup convention for new developer setup
- The ./bin/deploy convention for deploying to Heroku
- Rails’ flashes set up and in application layout
- A few nice time formats set up for localization
- Rack::Deflater to compress responses with Gzip
- A low database connection pool limit
- Safe binstubs
- t() and l() in specs without prefixing with I18n
- An automatically-created SECRET_KEY_BASE environment variable in all environments
- Configuration for CircleCI Continuous Integration (tests)
- Configuration for Hound Continuous Integration (style)
- The analytics adapter Segment (and therefore config for Google Analytics, Intercom, Facebook Ads, Twitter Ads, etc.)
For more details, please go to this gem’s GitHub page.
I hope you find this gem helpful for you!