Class: CodeQualityCheck::Generators::UninstallGenerator

Inherits:
Rails::Generators::Base
  • Object
show all
Defined in:
lib/generators/code_quality_check/uninstall_generator.rb

Overview

Uninstall generator to remove Overcommit and RuboCop configuration files

Instance Method Summary collapse

Instance Method Details

#remove_filesObject

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_overcommitObject

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