Documentation Introduction Usage What's up with the PANACEA.md file? What’s included with Panacea? What questions will Panacea ask me?

Documentation

Introduction

Panacea will help you to start working directly in the business logic of your app. Removing the pain of integrating some of the most common gems by asking you if you want to do so.

What usually takes at least 2 hours of your work day, you can get it achieved in less than 2 minutes.

Panacea uses Rails Templates and Thor actions to do it’s magic.

Usage

Panacea support most of the Rails arguments, feel free to use them to tweak how your Rails app is going to be generated.

You can see the complete list of accepted arguments with the following command →

$ panacea --help

The most important argument is the database to use. Panacea works without it, but it assumes that you want to use postgresql.

$ panacea my-app

The previous command will create a Rails app that uses Postgres as its database.

Be aware that if you want to use a different database, you should pass the Rails argument to do so:

$ panacea my-app --database=mysql

What's up with the PANACEA.md file?

Every time you use Panacea, you will get a PANACEA.md file in the root dir of your Rails App. This file contains a list of the things that were installed/setup for you by Panacea.

What’s included with Panacea?

Here is the list of Gems that are included by default when using the Panacea generator (other than the already included by normal Rails generator) →

All environments

Development and Test

  • pry - helps to stop code execution and to debug
  • rubocop-rails_config - set up rubocop to follow the same rules as the Rails development team

Development

  • brakeman - static code analyzer with focus on security
  • bullet - helps to identify N+1 queries in ActiveRecord
  • letter_opener - helps you to preview emails on a different tab when sent in development

Test

  • simplecov - helps to get test coverage metrics

What questions will Panacea ask me?

This section will list the settings or gems that Panacea can configure for you. Panacea does it though the following questions:

Please choose your app's default time zone

One of the most common mistakes is to never set up your app’s default time zone. Please select one option, the list contains all the zones supported by Rails. The recommended is UTC but we know that all apps are unique. This will add a config setting on your config/application.rb file.

Please choose your app's default locale

If you want to override the default locale which is english, this is the place to do it. Please select one option, the list contains the most popular languages. This will add a config setting on your config/application.rb file.

Which background jobs adapter do you want to use?

Here you can choose between none, sidekiq, resque and sucker_punch. Panacea will setup ActiveJob with the technology that you selected.

Which framework do you want to use in your tests?

Here you can choose between minitest or rspec. Panacea will update your app’s test environment to use the tool that you chose.

Which tool do you want to use to stub out HTTP requests?

Here you can choose between none, webmock or vcr. Panacea will setup your app's test environment to use the tool that you selected.

What should be the minimum coverage expected by Simplecov?

Here you can enter a value between 0 a 100. 80 is the default value and it will be used if you hit the return key.

It will create the test/support/simplecov.rb or spec/support/simplecov.rb file (based on what you chose in the previous question). In that file you should be able to customize your Coverage settings if you want.

Panacea only sets the setting: SimpleCov.minimum_coverage with the value you entered.

Do you want to setup Headless Chrome as default driver for System Tests?

By default Rails apps open a Chrome browser to run the system tests. Here you will be able to setup your Rails apps to work with a Headless Chrome driver. Useful if you want to run your system tests on a CI environment. Default answer is no.

Do you want to use FactoryBot in your tests?

Here you will be able to tell Panacea to setup FactoryBot for you. Default answer is no.

If answer is yes, it will add the gem to the Gemfile and also configure your test classes (minitest or rspec) to include the FactoryBot methods.

Do you want to use Faker in your tests?

Here you will be able to tell Panacea to setup Faker for you. Default answer is no.

If answer is yes, it will add the gem to the Gemfile and also configure your test helper to require the gem

Do you want to setup Dotenv to manage ENV variables in development?

Here you will be able to instruct Panacea to setup the dotenv-rails gem for you. Default answer is no. If you answer yes, it will add the gem to the Gemfile, setup the Gem, create the .env file and add that file to the .gitignore file.

Do you want to use Webpacker to manage your app's frontend?

If you want to use Webpacker in your Rails app you should answer yes to this question. Default is no. It will add the gem to the Gemfile and run the rake tasks needed for you.

What framework do you want to pre-configure Webpack with?

This question will only appear if you answered yes to the previous question. It helps you to setup your Webpack environment with one of the followings frameworks: none, react, vue, angular, elm, stimulus.

For any option except none, Panacea will run the rake task provided by the gem to setup the framework of your choice.

Do you want to use a Bootswatch 3 template?

If you want to setup a Bootswatch 3 theme for your application, you should answer yes. Default answer is no. It will add the gem to the Gemfile and some other dependencies.

Which template do you want to setup?

This question will only appear if you answered yes to the previous question. It allows you to select one of the following themes: cerulean, cosmo, cyborg, darkly, flatly, journal, lumen, paper, readable, sandstone, simplex, slate, spacelab, superhero, united or yeti.

Do you want to use pg_search gem to enable PostgreSQL's full text search?

If you answer yes, Panacea will add the gem to the Gemfile. Default answer is no.

Do you want to use Devise to handle users in your app?

Here you can tell Panacea to install the Devise gem in your Rails app. Default answer is no. If you answer yes then it will add the gem to the Gemfile and run the Devise generator.

What should be your Devise model name?

This question will only show if you answered yes to the previous question. It helps you to generate your Devise model. Default value is user. You can name it whatever you want i.e. admin, visitor, etc.

Do you want to add the Devise's views in your app?

This question will only appear if you wanted to setup Devise. Default answer is no. If you say yes, then Panacea will generate the Devise views in your app so you can easily update them.

Do you want to use Pundit to handle authorizations?

If you want to use the Pundit gem, you should answer yes to this question, it will add the gem to the Gemfile and run the Pundit generator. Default answer is no.

Do you want to use Kaminari to handle pagination?

If you want to use the Kaminari gem, you should answer yes to this question, it will add the gem to the Gemfile and create the Kaminari initializer. Default answer is no.

Do you want to use OJ to optimize JSON handling in your app?

OJ is useful to make faster the parse/serialization of your JSON objects. Default answer is no. If your answer is yes, Panacea will add the gem and create the initializer.

Do you want to use Money Rails to handle money amounts in your app?

Here you can tell Panacea to integrate the money-rails gem, which is useful to work with amounts of money. Default answer is no. If you answer yes it will add the gem to the Gemfile and also create the initializer.

Do you want to use Redcarpet to handle Markdown in your app?

If you want to process markdown in your app, Panacea offers you the option to add the redcarpet gem so you can fulfill that feature. Default answer is no. If your answer is yes, it will add the gem to the Gemfile.

Do you want to use Foreman to manage your app's processes?

Here you can tell Panacea to install foreman gem for you and create a Procfile that will contain the configuration for the Rails process and if you answered yes to the Webpack question, it will include the configuration for the Webpack process as well. Default answer is no.

Do you want to use AwesomePrint in your console sessions?

If you answer yes to this question. Panacea will include the gem in the Gemfile. Default answer is no.

Do you want to add a Git hook to help you to improve your workflow?

Panacea can help you to reduce broken builds or bad formatted code. It does it via a git hook that you can choose if you want to. Default answer is no.

Which Git hook do you want to add?

If you answered yes to the previous question then you can choose what git hook to configure, the options are pre-commit or pre-push. Both git hooks run Rubocop to find any style issues and also run the test suite via the bundle exec rake to ensure all tests pass.

Do you want to auto-generate the initial commit?

Panacea can generate the initial commit of your brand new Rails app if you want to. Default answer is no.

What should be the commit's message?

If your answer to the previous question was yes, then you can edit the default commit message by answering this question. Default commit message is Initialize Rails App powered with Panacea.

Do you want to help us improve Panacea by sharing with us your answers?

If you answer yes, then Panacea will submit your answers to Usage Statistics App. The recollected information will help us to improve your experience with Panacea. We don't track personal information. We use the IP address of the request to know from where in the world you are using Panacea, that's it.