Class: RubocopTodoCorrector::Cli

Inherits:
Thor
  • Object
show all
Defined in:
lib/rubocop_todo_corrector/cli.rb

Overview

Provide CLI sub-commands.

Instance Method Summary collapse

Instance Method Details

#bundleObject



9
10
11
12
13
14
15
# File 'lib/rubocop_todo_corrector/cli.rb', line 9

def bundle
  Commands::Bundle.call(
    rubocop_configuration_path: '.rubocop.yml',
    gemfile_lock_path: 'Gemfile.lock',
    temporary_gemfile_path: 'tmp/Gemfile_rubocop_todo_corrector.rb'
  )
end

#cleanObject



18
19
20
21
22
# File 'lib/rubocop_todo_corrector/cli.rb', line 18

def clean
  Commands::Clean.call(
    temporary_gemfile_path: 'tmp/Gemfile_rubocop_todo_corrector.rb'
  )
end

#correctObject



30
31
32
33
34
35
# File 'lib/rubocop_todo_corrector/cli.rb', line 30

def correct
  Commands::Correct.call(
    only_safe: options[:only_safe],
    temporary_gemfile_path: 'tmp/Gemfile_rubocop_todo_corrector.rb'
  )
end

#describeObject



43
44
45
46
47
48
# File 'lib/rubocop_todo_corrector/cli.rb', line 43

def describe
  Commands::Describe.call(
    cop_name: options[:cop_name],
    temporary_gemfile_path: 'tmp/Gemfile_rubocop_todo_corrector.rb'
  )
end

#generateObject



51
52
53
54
55
56
# File 'lib/rubocop_todo_corrector/cli.rb', line 51

def generate
  Commands::Generate.call(
    rubocop_todo_path: '.rubocop_todo.yml',
    temporary_gemfile_path: 'tmp/Gemfile_rubocop_todo_corrector.rb'
  )
end

#ignoreObject



64
65
66
67
68
69
# File 'lib/rubocop_todo_corrector/cli.rb', line 64

def ignore
  Commands::Ignore.call(
    ignore_file_path: '.rubocop_todo_corrector_ignore',
    cop_name: options[:cop_name]
  )
end

#pickObject



89
90
91
92
93
94
95
96
# File 'lib/rubocop_todo_corrector/cli.rb', line 89

def pick
  Commands::Pick.call(
    ignore_file_path: '.rubocop_todo_corrector_ignore',
    mode: options[:mode],
    only_safe: options[:only_safe],
    rubocop_todo_path: '.rubocop_todo.yml'
  )
end

#removeObject



104
105
106
107
108
109
# File 'lib/rubocop_todo_corrector/cli.rb', line 104

def remove
  Commands::Remove.call(
    cop_name: options[:cop_name],
    rubocop_todo_path: '.rubocop_todo.yml'
  )
end