Sha256: ed00832f1d2825a9b9955bb43b238b9d63f3cb18fbbc5e8004f352249e77511e

Contents?: true

Size: 409 Bytes

Versions: 17

Compression:

Stored size: 409 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

17 entries across 17 versions & 2 rubygems

Version Path
karl-loris-0.0.10 lib/filters/modified_filter.rb
karl-loris-0.0.11 lib/filters/modified_filter.rb
loris-0.2.3 lib/filters/modified_filter.rb
loris-0.2.2 lib/filters/modified_filter.rb
loris-0.2.1 lib/filters/modified_filter.rb
loris-0.2.0 lib/filters/modified_filter.rb
loris-0.1.7 lib/filters/modified_filter.rb
loris-0.1.5 lib/filters/modified_filter.rb
loris-0.1.4 lib/filters/modified_filter.rb
loris-0.1.3 lib/filters/modified_filter.rb
loris-0.1.2 lib/filters/modified_filter.rb
loris-0.1.1 lib/filters/modified_filter.rb
loris-0.1.0 lib/filters/modified_filter.rb
loris-0.0.16 lib/filters/modified_filter.rb
loris-0.0.15 lib/filters/modified_filter.rb
loris-0.0.14 lib/filters/modified_filter.rb
loris-0.0.12 lib/filters/modified_filter.rb