Class: RubocopTodoCorrector::Commands::Correct

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

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(only_safe:, temporary_gemfile_path:) ⇒ Correct

Returns a new instance of Correct.



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

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

Class Method Details

.call(only_safe:, temporary_gemfile_path:) ⇒ Object

Parameters:

  • only_safe (Boolean)
  • temporary_gemfile_path (String)


9
10
11
12
13
14
15
16
17
# File 'lib/rubocop_todo_corrector/commands/correct.rb', line 9

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

Instance Method Details

#callObject



28
29
30
31
32
33
# File 'lib/rubocop_todo_corrector/commands/correct.rb', line 28

def call
  ::Kernel.system(
    { 'BUNDLE_GEMFILE' => @temporary_gemfile_path },
    "bundle exec rubocop #{rubocop_options}"
  )
end