This allows you to see the methods that are never called but are declared.
requirement :
- Rails > 6.1
- Ruby
Add this line to your application's Gemfile:
gem 'method_duplicator'
And then execute:
$ bundle
Or install it yourself as:
$ gem install method_duplicator
There is only one task at the moment that lists all the methods that are in the app/
folder and the number of times they are called.
$ rails method_duplicator:methods
- writing automatic tests (install RSpec)
- Filter the methods to have only the one with 0 declarations
- Make sure that in the file where the method is declared it can be called without the dot but not in the others
- Allow to pass parameters (path for example)
- customize colors for a better visibility
- optimization of the algo and the performance
- Export to CSV in tmp/
- Find another way (ctags, intellisense etc) to get the declarations without doing a complete parsing of the app
To contribute to this repository, feel free to create a new fork of the repository and submit a pull request.
- Fork / Clone and select the main branch.
- Create a new branch in your fork.
- Make your changes.
- Commit your changes, and push them.
- Submit a Pull Request here!
The gem is available as open source under the terms of the MIT License.