Sha256: c1d2ea550b44246db7ac265200d29de78d63e007f587cd04fed6f6027c60c5bb

Contents?: true

Size: 385 Bytes

Versions: 7

Compression:

Stored size: 385 Bytes

Contents

require 'singleton'
require 'fileutils'
class RemoteTable
  class Cleaner
    include ::Singleton
    def paths_for_removal
      @paths_for_removal ||= []
    end
    def cleanup
      paths_for_removal.each do |path|
        ::FileUtils.rm_rf path
        paths_for_removal.delete path
      end
    end
    def remove_at_exit(path)
      paths_for_removal << path
    end
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
remote_table-1.1.2 lib/remote_table/cleaner.rb
remote_table-1.1.1 lib/remote_table/cleaner.rb
remote_table-1.1.0 lib/remote_table/cleaner.rb
remote_table-1.0.3 lib/remote_table/cleaner.rb
remote_table-1.0.2 lib/remote_table/cleaner.rb
remote_table-1.0.1 lib/remote_table/cleaner.rb
remote_table-1.0.0 lib/remote_table/cleaner.rb