Sha256: 88662f9d4e79f9a9409f42e2e178fe9ba8b937d190de6023f2ede1852b21cbe0

Contents?: true

Size: 411 Bytes

Versions: 3

Compression:

Stored size: 411 Bytes

Contents

class ModifiedFilter
  
  def initialize(file_class, last_modified = nil)
    @file_class = file_class
    @last_modified = last_modified
    @modifieds = []
  end
  
  def filter(path)
    modified = @file_class.mtime(path)
    @modifieds << modified
    
    return @last_modified.nil? || modified > @last_modified
  end
  
  def complete()
    @last_modified = @modifieds.max
    @modifieds = []
  end
  
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
karl-loris-0.0.6 lib/modified_filter.rb
karl-loris-0.0.7 lib/modified_filter.rb
karl-loris-0.0.9 lib/filters/modified_filter.rb