Skip to content
This repository has been archived by the owner on Mar 14, 2021. It is now read-only.

Ruby JSON parsing #2

Merged
merged 2 commits into from
Sep 2, 2017
Merged

Ruby JSON parsing #2

merged 2 commits into from
Sep 2, 2017

Conversation

laughedelic
Copy link
Owner

One way to make completions faster would be to use brew JSON output for commands like brew info --json=v1 --installed, but I guess, we can't require any external dependencies, so no jq.

Homebrew requires Ruby so we could just interpret some tiny Ruby scripts for JSON parsing, which should be quite easy (the idea is taken from this PR, which does it in Python).

@laughedelic laughedelic self-assigned this Aug 19, 2017
@laughedelic
Copy link
Owner Author

See Homebrew/brew#3072

@laughedelic
Copy link
Owner Author

In the end I'm using only for the existing cache (managed by Homebrew): ~/Library/Caches/Homebrew/desc_cache.json which contains all formulae with descriptions.

I left some code commented out for the things that would use brew info --json=v1 --installed cache, in case it will be useful later.

@laughedelic laughedelic merged commit 41922e0 into master Sep 2, 2017
@laughedelic laughedelic deleted the json/ruby-parsing branch September 2, 2017 19:00
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant