Instantly share code, notes, and snippets.

Embed
What would you like to do?
#! /usr/bin/env ruby
# Generate all tags for all gems included by bundler in gems.tags
#
# Basically does the same as "bundle show gemname", except for all gems.
# Interestingly enough, "bundle show" without any arguments falls back to
# "bundle list", otherwise the whole thing could have been a bash one-liner.
require 'bundler'
paths = Bundler.load.specs.map(&:full_gem_path)
system("ctags -R -f gems.tags #{paths.join(' ')}")
@wraithgar

This comment has been minimized.

Show comment
Hide comment
@wraithgar

wraithgar Aug 15, 2012

Bundle show lists paths with the --paths parameter, so:

ctags -R -f gems.tags bundle show --paths

There's your one liner

wraithgar commented Aug 15, 2012

Bundle show lists paths with the --paths parameter, so:

ctags -R -f gems.tags bundle show --paths

There's your one liner

@wikimatze

This comment has been minimized.

Show comment
Hide comment
@wikimatze

wikimatze Jul 16, 2013

Hi @wraothgar,

thanks for your one liner addition. It worked for me as soon as I placed backticks arounf the bundle show --paths command in the terminal.

ctags -R -f gems.tag `bundle show --paths`

wikimatze commented Jul 16, 2013

Hi @wraothgar,

thanks for your one liner addition. It worked for me as soon as I placed backticks arounf the bundle show --paths command in the terminal.

ctags -R -f gems.tag `bundle show --paths`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment