Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Rubygems plugin to print info about installed gems, with fuzzy matching.
Ruby
branch: master

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.
lib
spec
.document Initial commit to gem_info.
.gitignore
CHANGELOG
DESCRIPTION Add info command.
Gemfile
LICENSE
README.rdoc
Rakefile
gem_info.gemspec

README.rdoc

Gem Info

A rubygems plugin which adds an `info' command that prints information about installed gems.

Unlike the built-in gem commands, it allows fuzzy matching on gem names and versions by default, and allows precise formatting of the output, making it easy on the command line and in scripts.

Examples

View dependencies at a glance:

$ gem info -f '%name-%version: %dependencies' act
activesupport-2.3.3: 
activesupport-2.3.4: 
activeresource-2.3.4: activesupport = 2.3.4
activerecord-2.3.4: activesupport = 2.3.4
actionpack-2.3.4: activesupport = 2.3.4, rack ~> 1.0.0
actionmailer-2.3.4: actionpack = 2.3.4

Handy alias to `cd' to a gem directory:

function cdrg {
    if [ $# -eq 0 ]; then
        cd `gem env gemdir`/gems
    elif gem info --exactly-one $@ > /dev/null; then
      local dir=`gem info -f '%path' $@`
      if [ -d $dir/lib ]; then
          cd $dir/lib
      else
          cd $dir
      fi
    fi
}

$ cdrg rails    # oops!
2 matching gems:
  rails 2.3.3
  rails 2.3.4
$ cdrg rails 4  # only 2.3.4 contains '4'
$ pwd
/usr/lib/ruby/gems/1.8/gems/rails-2.3.4/lib

Contributing

Copyright

Copyright © 2009 George Ogata. See LICENSE for details.

Something went wrong with that request. Please try again.