Class: Quipper::Rubocop::Config::CLI

Inherits:
Thor
  • Object
show all
Defined in:
lib/quipper/rubocop/config.rb

Constant Summary collapse

RUBOCOP_CONFIG_FILE_NAME =
".rubocop.yml"
RUBOCOP_TODO_FILE_NAME =
".rubocop_todo.yml"
GITHOOK_FILE_PATH =
".git/hooks/pre-push"

Instance Method Summary collapse

Instance Method Details

#installObject



16
17
18
19
# File 'lib/quipper/rubocop/config.rb', line 16

def install
  create_rubocop_config!(RUBOCOP_CONFIG_FILE_NAME)
  create_rubocop_todo_file! if options[:with_todo]
end

#install_prepushObject



22
23
24
# File 'lib/quipper/rubocop/config.rb', line 22

def install_prepush
  create_prepush_hook!(GITHOOK_FILE_PATH)
end

#uninstallObject



28
29
30
31
32
33
34
# File 'lib/quipper/rubocop/config.rb', line 28

def uninstall
  remove_file(RUBOCOP_CONFIG_FILE_NAME) unless options[:hook]
  remove_file(RUBOCOP_TODO_FILE_NAME) unless options[:hook]
  remove_file(GITHOOK_FILE_PATH)

  puts "Uninstallation complete"
end