Class: RocketFuel::Fix::FileSanitizerFix

Inherits:
AbstractFix show all
Defined in:
lib/rocket_fuel/fix/file_sanitizer_fix.rb

Direct Known Subclasses

MacportsFix, RbenvFix, RvmFix

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from AbstractFix

#check, fix_name, fix_name_value, register!

Class Method Details

.files_to_removeObject



19
20
21
# File 'lib/rocket_fuel/fix/file_sanitizer_fix.rb', line 19

def files_to_remove
  @files_to_remove
end

.remove_file(file) ⇒ Object



14
15
16
17
# File 'lib/rocket_fuel/fix/file_sanitizer_fix.rb', line 14

def remove_file(file)
  @files_to_remove ||= []
  @files_to_remove << file
end

Instance Method Details

#runObject



5
6
7
8
9
10
11
# File 'lib/rocket_fuel/fix/file_sanitizer_fix.rb', line 5

def run
  self.class.files_to_remove.each do |path|
    if FileTest.exist?(path)
      FileUtils.rm_rf(path)
    end
  end
end