Class: RemoteTable::Cleaner

Inherits:
Object
  • Object
show all
Includes:
Singleton
Defined in:
lib/remote_table/cleaner.rb

Instance Method Summary collapse

Instance Method Details

#cleanupObject



9
10
11
12
13
14
# File 'lib/remote_table/cleaner.rb', line 9

def cleanup
  paths_for_removal.each do |path|
    ::FileUtils.rm_rf path
    paths_for_removal.delete path
  end
end

#paths_for_removalObject



6
7
8
# File 'lib/remote_table/cleaner.rb', line 6

def paths_for_removal
  @paths_for_removal ||= []
end

#remove_at_exit(path) ⇒ Object



15
16
17
# File 'lib/remote_table/cleaner.rb', line 15

def remove_at_exit(path)
  paths_for_removal << path
end