Project

gem-ag

0.0
No commit activity in last 3 years
No release in over 3 years
Search installed gems with ag
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
 Dependencies

Development

~> 1.7
~> 10.0
 Project Readme

Gem::Ag

Quickly search through all the code in your installed gems using ag.

RubyGems plugin to search with The Silver Searcher, this was inspired by Jim Gay's Searching Through Your Bundled Gems blog post.

Installation

Install it with rubygems:

$ gem install gem-ag

Or to include it with your app add this line to your application's Gemfile:

gem 'gem-ag'

And then execute:

$ bundle

Usage

The gem ag command attempts to support all the same command line options as ag out of the box. The big difference is you cannot specify paths to search. Instead you can pass in a list of gem names.

$ gem ag PATTERN [GEMNAME ...] [options]

To see a full list of supported options run:

$ gem help ag

Examples

Search for "Hello World" in Rails and Active Record gems.

$ gem ag "Hello World" rails active-record

Search for "def" in the rake gem, and print ag stats.

$ gem ag --stats "def" rake

Search in all installed gems:

$ gem ag "Hello World"

By using bundle exec you can search only in the gems in yoru bundle. This does require you to include it in your application's Gemfile.

Search in all bundled gems:

$ bundle exec gem ag "Hello World"

Contributing

  1. Fork it
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature'), with a nice commit message.
  4. Push to the branch (git push origin my-new-feature)
  5. Create a new Pull Request