Class: RubocopTodoCorrector::Commands::Clean

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

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(temporary_gemfile_path:) ⇒ Clean

Returns a new instance of Clean.



19
20
21
22
23
# File 'lib/rubocop_todo_corrector/commands/clean.rb', line 19

def initialize(
  temporary_gemfile_path:
)
  @temporary_gemfile_path = temporary_gemfile_path
end

Class Method Details

.call(temporary_gemfile_path:) ⇒ Object

Parameters:

  • temporary_gemfile_path (String)


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

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

Instance Method Details

#callObject



25
26
27
28
29
30
31
32
# File 'lib/rubocop_todo_corrector/commands/clean.rb', line 25

def call
  ::FileUtils.rm_f(
    [
      @temporary_gemfile_path,
      "#{@temporary_gemfile_path}.lock"
    ]
  )
end