HomePhorge

Finer-grained protocol for property `insync?`.
48726b662d2fUnpublished

Unpublished Commit ยท Learn More

Repository Importing: This repository is still importing.

Description

Finer-grained protocol for property insync?.

Previously the protocol for a property was that it should override the entire
insync? method when it wanted to do custom matching. This worked, but meant
that a number of bits of logic had to be replicated in each property
individually.

This changes that by introducing property_match?(current, desired) to the
protocol, which is used to compare an individual current and desired propriety
value pair.

The default implementation mirrors the previous behaviour of this code, but
now individual property implementations can override only the direct
comparison operation and get the right behaviour more easily.

Signed-off-by: Daniel Pittman <daniel@puppetlabs.com>