Improve ruby code using Code Analyzer

Rubocop is a code analyzer gem which allows you to write code that follows the style guide dictated by the Ruby community, The gem also has lots of configuration options

Let's install Rubocop

gem install rubocop
cd your_rails_app
This will scan all of your Ruby files in your application.

rubocop app
This will scan only the app directory.

rubocop -o code.rb
-o writes output to a file instead of STDOUT


Popular posts from this blog

Inserting and Moving elements inside Ruby Array

Remove duplicates from a JavaScript Array

Difference between Validations, Callbacks and Observers