Skip to content

Instantly share code, notes, and snippets.

@kmdsbng
Created February 29, 2012 11:00
Show Gist options
  • Select an option

  • Save kmdsbng/1939997 to your computer and use it in GitHub Desktop.

Select an option

Save kmdsbng/1939997 to your computer and use it in GitHub Desktop.
gemの関数も参照できるようにtagsファイルを作る
#!/bin/env ruby
# -*- encoding: utf-8 -*-
# railsルートからこのコマンドを実行する
# gems.tagsを作るところは guard-ctags-bundler のコードをパクった
require './config/environment.rb'
require 'bundler'
require 'bundler/runtime'
system('ctags -R')
runtime = ::Bundler::Runtime.new Dir.pwd, ::Bundler.definition
paths = runtime.specs.map(&:full_gem_path).join(' ')
system("find #{paths.strip} -type f -name \\*.rb | ctags -f gems.tags -L -")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment