Class: CodeQualityCheck::Generators::UninstallGenerator
- Inherits:
-
Rails::Generators::Base
- Object
- Rails::Generators::Base
- CodeQualityCheck::Generators::UninstallGenerator
- Defined in:
- lib/generators/code_quality_check/uninstall_generator.rb
Overview
Uninstall generator to remove Overcommit and RuboCop configuration files
Instance Method Summary collapse
-
#remove_files ⇒ Object
Remove Overcommit and RuboCop configuration files.
-
#uninstall_overcommit ⇒ Object
Uninstall Overcommit.
Instance Method Details
#remove_files ⇒ Object
Remove Overcommit and RuboCop configuration files
12 13 14 15 16 17 18 19 20 21 22 |
# File 'lib/generators/code_quality_check/uninstall_generator.rb', line 12 def remove_files # List of files to be removed files_to_remove = ['config/initializers/overcommit.rb', '.overcommit.yml', '.rubocop.yml'] files_to_remove.each do |file| if File.exist?(file) remove_file file say_status('removed', file) end end end |
#uninstall_overcommit ⇒ Object
Uninstall Overcommit
25 26 27 28 |
# File 'lib/generators/code_quality_check/uninstall_generator.rb', line 25 def uninstall_overcommit # uninstall overcommit run 'bundle exec overcommit --uninstall' end |