Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Provide filter_results to refine a search #282

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

ekohl
Copy link
Member

@ekohl ekohl commented Jul 21, 2023

rspec-puppet-facts has a pattern where it does a lot of small searches for every OS. By doing a single complex FacterDB.get_facts call to get the only supported operating systems and then further refining that result it can use the cache provided by FacterDB.get_facts.

This is quite hacky now because it duplicates internals from JGrep to avoid serializing to JSON and parsing that again. The conversions to symbols and back to strings is also inefficient.

voxpupuli/rspec-puppet-facts#158 was the inspiration for this.

rspec-puppet-facts has a pattern where it does a lot of small searches
for every OS. By doing a single complex FacterDB.get_facts call to get
the only supported operating systems and then further refining that
result it can use the cache provided by FacterDB.get_facts.

This is quite hacky now because it duplicates internals from JGrep to
avoid serializing to JSON and parsing that again. The conversions to
symbols and back to strings is also inefficient.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants