Class: RubocopTodoCorrector::Commands::Generate

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

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(rubocop_todo_path:, temporary_gemfile_path:) ⇒ Generate

Returns a new instance of Generate.



22
23
24
25
26
27
28
# File 'lib/rubocop_todo_corrector/commands/generate.rb', line 22

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

Class Method Details

.call(rubocop_todo_path:, temporary_gemfile_path:) ⇒ Object

Parameters:

  • rubocop_todo_path (String)
  • temporary_gemfile_path (String)


11
12
13
14
15
16
17
18
19
# File 'lib/rubocop_todo_corrector/commands/generate.rb', line 11

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

Instance Method Details

#callObject



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

def call
  ::Kernel.system(
    { 'BUNDLE_GEMFILE' => @temporary_gemfile_path },
    'bundle exec rubocop --regenerate-todo'
  )
end