kafo_parsers should support selecting available providers with soft deps
kafo_parsers should provide a method to recommend a parser based on those providers that are available in the local environment. The current parser only loads on Puppet 3 when available in the same Ruby environment, while #7848 adds a new puppet-strings parser which will only load with that module installed.
For Kafo itself to select a provider, the hard dependency on the puppet gem in the current parser should be removed and the providers should be able to indicate if they are available/ready.
fixes #14448 - change Puppet to a soft dep, add helper to find parser
Each parser's `.available?` method now tries to load any dependencies
and indicates if the parser is usable. An exception may be thrown with
`KafoParsers::Parsers.find_available` finds the first parser that's
available, which should be the preferred way of using kafo_parsers.
refs #14448 - use kafo_parsers .find_available to load parser
By using the parser cache, the parser is now optional and will raise an
error at runtime if the cache misses and no parser is available. Tests
still require the Puppet 3.x parser to test validations etc.
#7 Updated by Dominic Cleal over 5 years ago
- Status changed from Ready For Testing to Closed
- % Done changed from 0 to 100
Applied in changeset kafo_parsers|fbfbeadaf8dd6c1a1dcf2f16b5d9e54cc165f1ae.