Sha256: 4182e61d3c950154a2a1bc184eb4a2e670bff63c1c77ec3563940731569c1fb1

Contents?: true

Size: 408 Bytes

Versions: 4

Compression:

Stored size: 408 Bytes

Contents

module Ramdo
  class Cleaner
    def self.clean_up(disk)
      Dir.entries(disk.path).each do |dir|
        if dir =~ Store::NAME_PATTERN
          uuid = Regexp.last_match[1]
          timestamp = Regexp.last_match[2].to_i
          if (timestamp + DEFAULTS[:ttl]) < Time.now.utc.to_i
            FileUtils.rm_r File.join(disk.path, dir), :force => true
          end
        end
      end
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
ramdo-0.3.2 lib/ramdo/cleaner.rb
ramdo-0.3.1 lib/ramdo/cleaner.rb
ramdo-0.3.0 lib/ramdo/cleaner.rb
ramdo-0.2.1 lib/ramdo/cleaner.rb