Jake Worth

Silver Searcher RDoc Support

Published: October 31, 2015 2 min read

  • ruby

Today I submitted my first pull request to The Silver Searcher project:

https://github.com/ggreer/thesilversearcher/pull/782

Silver Searcher can be installed on OSX with Homebrew and is a fantastic command line search tool. Here’s a search I wrote recently to hunt down Ruby getter methods:

$ ag 'def (\w+);?\s+@\1;?\s+end'

ag … for Silver. And it’s a search tool. Get it?

My pull request adds support for the RDoc file extension, which is common in many Ruby projects, including Rails. If it gets merged, the following search will be scoped only to RDoc files.

$ ag 'foo' --rdoc

This pull request allowed me to write and test in C, something I’ve never done before. I hope that this feature will allow programmers and OSS contributors to more easily navigate documentation from the command line. In a large project like Rails, a flag that can cut through the noise should be helpful.

Update (November 12, 2015)

This pull request was merged; Silver Searcher now accepts --rdoc as a filter flag.

✉️ Get better at programming by learning with me. Subscribe to Jake Worth's Newsletter for bi-weekly ideas, creations, and curated resources from across the world of programming. Join me today!


Blog of Jake Worth, software engineer in Maine.

© 2022 Jake Worth.