CodigoDelSur's Ruby and Rails useful gems
Ruby Gems is a package manager for Ruby that provides the distribution of Ruby programs and libraries in a format called "gem", a tool designed to easily manage the installation of gems, and a server for distributing them.
This is a list of useful gems, some added by its fame and some others used for our Ruby on Rails projects and that we find very intersing and want to share with you. Please visit the gems page for more details and full documentation.
- User
- Active Record
- Plugins
- API
- File Uploading
- Searching
- Scheduled/Recurrence Jobs
- View Helper
- Environment Variables
- Admin Panel
- Logging
- Debug
- Coding Style
- Testing
- Production
- Error Logging
User
Authentication
- Devise - Devise is a flexible authentication solution for Rails based on Warden.
- Knock - Seamless JWT authentication for Rails API.
- Clearance - Rails authentication with email & password.
- Devise token auth - Token based authentication for Rails JSON APIs.
Authorization
- Pundit - Pundit provides a set of helpers which guide you in leveraging regular Ruby classes and object oriented design patterns to build a simple, robust and scaleable authorization system.
- cancancan - Continuation of CanCan, the authorization Gem for Ruby on Rails.CanCan is an authorization library for Ruby on Rails which restricts what resources a given user is allowed to access. All permissions are defined in a single location (the Ability class) and not duplicated across controllers, views, and database queries.
- rolify - Role management library with resource scoping.
Omniauth
Active Record
- Enumerize - Enumerated attributes with I18n and ActiveRecord/Mongoid support. It can be integrated with Simple Form.
- Sequenced - Sequenced is a simple gem that generates scoped sequential IDs for ActiveRecord models.
- FriendlyId - FriendlyId is the “Swiss Army bulldozer” of slugging and permalink plugins for ActiveRecord. It allows you to create pretty URL’s and work with human-friendly strings as if they were numeric ids for ActiveRecord models.
- AASM - State machines for Ruby classes (plain Ruby, Rails Active Record, Mongoid).
- PaperTrail - PaperTrail lets you track changes to your models' data. It's good for auditing or versioning.
- paranoia - ActiveRecord plugin allowing you to hide and restore records without actually deleting them.
- Validates - Validates provides collection of useful custom validators for Rails applications, including:
- EmailValidator
- UrlValidator
- SlugValidator
- MoneyValidator
- IpValidator
- AssociationLengthValidator
- AbsolutePathValidator
- UriComponentValidator
- ColorValidator
- EanValidator (EAN-8 & EAN-13)
Plugins
- kaminari - A Scope & Engine based, clean, powerful, customizable and sophisticated paginator for Rails 3 and 4.
- Slack Notifier is a simple wrapper to send notifications to Slack webhooks.
- Rails ERD - Generate Entity-Relationship Diagrams for Rails applications.
- Bitly - Compress your link with Bitly shortcut urls.
API
- ActiveModel::Serializers - Serializer brings convention over configuration to your JSON generation.
- Jbuilder - Jbuilder gives you a simple DSL for declaring JSON structures that beats massaging giant hash structures. This is particularly helpful when the generation process is fraught with conditionals and loops.
- rest-client - Simple HTTP and REST client for Ruby, inspired by microframework syntax for specifying actions.
- has_scope - Map incoming controller parameters to named scopes in your resources.
- Documentation
- Grape Swagger - Autogenerate documentation on Grape API.
- Grape Swagger UI - Display documentation that is generated using Grape Swagger.
- apiary - Work together to quickly design, prototype, document and test APIs.
- letter_opener - Preview mail in the browser instead of sending.
File Uploading
- Carrierwave - Carrierwave is a classier solution for file uploads for Rails, Sinatra and other Ruby web frameworks.
- carrierwave_backgrounder - Offload CarrierWave's image processing and storage to a background process using Delayed Job, Resque, Sidekiq, Qu, Queue Classic or Girl Friday.
- CarrierWave Crop - Carrierwave extension to crop uploaded images using Jcrop plugin with preview.
- CarrierWave ImageOptimizer - This gem allows you to simply optimize CarrierWave images via jpegoptim or optipng using the image_optimizer gem.
- refile - Refile is a modern file upload library for Ruby applications. It is simple, yet powerful.
- Paperclip - Easy file attachment management for ActiveRecord.
Searching
- ransack - Ransack enables the creation of both simple and advanced search forms for your Ruby on Rails application.
- elasticsearch-rails - Elasticsearch integrations for ActiveModel/Record and Ruby on Rails.
- Chewy - High-level Elasticsearch Ruby framework based on the official elasticsearch-ruby client.
- pg_search - pg_search builds ActiveRecord named scopes that take advantage of PostgreSQL's full text search
Scheduled/Recurrence Jobs
- Whenever - Whenever is a Ruby gem that provides a clear syntax for writing and deploying cron jobs.
- Resque - Redis-backed Ruby library for creating background jobs, placing them on multiple queues, and processing them later.
- Rufus-Scheduler - Rufus-scheduler is a Ruby gem for scheduling pieces of code (jobs). It understands running a job AT a certain time, IN a certain time, EVERY x time or simply via a CRON statement.
- Delayed Job - Database based asynchronous priority queue system.
- Sidekiq - Simple, efficient background processing for Ruby.
- sidetiq - Recurring jobs for sidekiq.
- sidekiq-cron - Scheduler / Cron for Sidekiq jobs
- sidekiq-scheduler - Lightweight job scheduler extension for Sidekiq
Environment Variables
- Config - Multi-environment YAML style configurations that helps easily manage environment specific settings in an easy and usable manner.
- Figaro - Figaro is very simple, Heroku-friendly Rails app configuration using ENV and a single YAML file.
- dotenv - Dotenv is a gem that allows you to set your environment variables in .env file, and it will load it in to ENV.
Admin Panel
- Active Admin - Ruby on Rails framework for creating elegant backends for website administration.
Logging
- Impressionist - Impressionist can log page impressions (technically action impressions), but it is not limited to that. You can log impressions multiple times per request. And you can also attach it to a model. The goal of this project is to provide customizable stats that are immediately accessible in your application as opposed to using Google Analytics and pulling data using their API.
- Ahoy - Ahoy provides a solid foundation to track visits and events in Ruby, JavaScript, and native apps.
- Lograge - An attempt to tame Rails' default policy to log everything.
Debug
- byebug - Byebug is a simple to use, feature rich debugger for Ruby 2. It uses the new TracePoint API for execution control and the new Debug Inspector API for call stack navigation, so it doesn't depend on internal core sources.
- awesome_print - Awesome Print is a Ruby library that pretty prints Ruby objects in full color exposing their internal structure with proper indentation.
- web-console - Web Console is a debugging tool for your Ruby on Rails applications.
- spring - Spring is a Rails application preloader. It speeds up development by keeping your application running in the background so you don't need to boot it every time you run a test, rake task or migration.
- letter_opener - Preview email in the default browser instead of sending it. This means you do not need to set up email delivery in your development environment, and you no longer need to worry about accidentally sending a test email to someone else's address.
Coding Style
- RuboCop - Rubocop is a Ruby static code analyzer. Out of the box it will enforce many of the guidelines outlined in the community Ruby Style Guide.
- Rails Best Practice - Rails best practice is a code metric tool to check the quality of rails codes.
- Pronto - Quick automated code review of your changes
Testing
- rspec-rails - Rspec-rails is a testing framework for Rails 3.x and 4.x.
- Capybara - Capybara helps you test web applications by simulating how a real user would interact with your app. And drivers:
- capybara-webkit - Capybara-webkit is a capybara driver that uses Webkit via QtWebkit.
- selenium-webdriver - Selenium-webdriver provides ruby bindings for WebDriver.
- poltergeist - Poltergeist allows you to run your Capybara tests on a headless WebKit browser, provided by PhantomJS.
- factory_girl - Factory_girl is a fixtures replacement with a straightforward definition syntax, support for multiple build strategies (saved instances, unsaved instances, attribute hashes, and stubbed objects), and support for multiple factories for the same class (user, admin_user, and so on), including factory inheritance.
- factory_girl_rails - Factory_girl_rails provides Rails integration for factory_girl.
- Database Cleaner - Database Cleaner is a set of strategies for cleaning your database in Ruby.Support ActiveRecord, DataMapper, Sequel, MongoMapper, Mongoid, CouchPotato, Ohm and Redis.
- shoulda-matchers - Shoulda-matchers provides serveral matchers for testing common Rails functionality.
- ResponseCodeMatchers - ResponseCodeMatchers provides rspec matchers to match http response code.
- SimpleCov - SimpleCov is a code coverage analysis tool for Ruby.
- Timecop - A gem providing "time travel" and "time freezing" capabilities, making it dead simple to test time-dependent code.
Security
- brakeman - Brakeman is a static analysis tool which checks Ruby on Rails applications for security vulnerabilities.
- bundle-audit - bundler-audit is a patch-level verification tool for Bundler which checks for vulnerable versions of gems and insecure gem sources.
Production
- Capistrano - Remote multi-server automation tool.
- Rack Attack - Rack middleware to blocking & throttling.
- Responders - A set of Rails responders to dry up your application.
- production_rails - Best practices for running Rails in production.