Sha256: e5aa68c4969225fbb53b6304e62a6a95bd33bde8547c62bbc11eddd06ca840d3
Contents?: true
Size: 622 Bytes
Versions: 18
Compression:
Stored size: 622 Bytes
Contents
module Snapsync # A simple policy that synchronizes only the last snapshot (that is, # snapsync's own synchronization point) class SyncLastPolicy def self.from_config(config) new end def to_config Array.new end def pretty_print(pp) pp.text "will keep only the latest snapshot" end # (see DefaultSyncPolicy#filter_snapshots) def filter_snapshots(snapshots) last = snapshots.sort_by(&:num).reverse. find { |s| !s.synchronization_point? } [last] end end end
Version data entries
18 entries across 18 versions & 1 rubygems