Class: RubocopTodoCorrector::Commands::Apply

Inherits:
Object
  • Object
show all
Defined in:
lib/rubocop_todo_corrector/commands/apply.rb

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(cop_name:, only_safe:, rubocop_todo_path:, temporary_gemfile_path:) ⇒ Apply

Returns a new instance of Apply.

Parameters:

  • cop_name (String)
  • only_safe (Boolean)
  • rubocop_todo_path (String)
  • temporary_gemfile_path (String)


35
36
37
38
39
40
41
42
43
44
45
# File 'lib/rubocop_todo_corrector/commands/apply.rb', line 35

def initialize(
  cop_name:,
  only_safe:,
  rubocop_todo_path:,
  temporary_gemfile_path:
)
  @cop_name = cop_name
  @only_safe = only_safe
  @rubocop_todo_path = rubocop_todo_path
  @temporary_gemfile_path = temporary_gemfile_path
end

Class Method Details

.call(cop_name:, only_safe:, rubocop_todo_path:, temporary_gemfile_path:) ⇒ void

This method returns an undefined value.

Parameters:

  • cop_name (String)
  • only_safe (Boolean)
  • rubocop_todo_path (String)
  • temporary_gemfile_path (String)


16
17
18
19
20
21
22
23
24
25
26
27
28
# File 'lib/rubocop_todo_corrector/commands/apply.rb', line 16

def call(
  cop_name:,
  only_safe:,
  rubocop_todo_path:,
  temporary_gemfile_path:
)
  new(
    cop_name:,
    only_safe:,
    rubocop_todo_path:,
    temporary_gemfile_path:
  ).call
end

Instance Method Details

#callvoid

This method returns an undefined value.



48
49
50
51
52
# File 'lib/rubocop_todo_corrector/commands/apply.rb', line 48

def call
  check_rubocop_todo_existence
  update_rubocop_todo
  autocorrect_excluded_files
end