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

#applyObject



19
20
21
22
23
24
25
26
# File 'lib/rubocop_todo_corrector/cli.rb', line 19

def apply
  Commands::Apply.call(
    cop_name: options[:cop_name],
    only_safe: options[:only_safe],
    rubocop_todo_path: '.rubocop_todo.yml',
    temporary_gemfile_path: 'tmp/Gemfile_rubocop_todo_corrector.rb'
  )
end

#bundleObject



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

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



38
39
40
41
42
# File 'lib/rubocop_todo_corrector/cli.rb', line 38

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

#correctObject



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

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

#describeObject



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

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

#generateObject



71
72
73
74
75
76
# File 'lib/rubocop_todo_corrector/cli.rb', line 71

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

#ignoreObject



84
85
86
87
88
89
# File 'lib/rubocop_todo_corrector/cli.rb', line 84

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

#pickObject



109
110
111
112
113
114
115
116
# File 'lib/rubocop_todo_corrector/cli.rb', line 109

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



124
125
126
127
128
129
# File 'lib/rubocop_todo_corrector/cli.rb', line 124

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