Mactag is a plugin for Rails developers that do their development in an editor that supports Ctags (Emacs, Vim, TextMate, ...). With Ctags you can follow tags (of functions, variables, macros, whatever) to their definitions.
First off, you must install Ctags. Some systems comes with a ctags command already. If you have the ctags executable, but have problems creating the tags file. Then make sure that you are using Exuberant Ctags and not some other version.
Install the plugin: $ rails plugin install git://github.com/rejeep/mactag.git
Install the gem: $ gem install mactag
Add mactag to the Gemfile: group :development do gem 'mactag' end
To generate a template configuration file (config/mactag.rb), which contains a basic setup and some examples of how to configure Mactag, use the mactag generator: $ rails generate mactag
Mactag::Config.rvm = false
Mactag::Config.gem_home = '/usr/lib/ruby/gems/1.8/gems'
Mactag::Config.binary = 'etags -o {OUTPUT} {INPUT}'
Mactag::Config.tags_file = 'TAGS'
Mactag do
app 'app/**/*.rb', 'lib/*.rb'
plugins 'thinking-sphinx', 'whenever'
gems 'paperclip', 'authlogic'
gem 'formtastic', :version => '0.9.7'
rails :except => :actionmailer, :version => '2.3.5'
end
The available configuration options are described below.
If true, use Rvm when indexing gems.
Defaults to: true
Path to gems. No need to set this when using Mactag::Config.rvm.
Defaults to: /Library/Ruby/Gems/1.8/gems
The command to run when creating the TAGS-file. {OUTPUT} will be
replaced with the value of Mactag::Config.tags_file. {INPUT}
will be replaced with all files to index.
Defaults to: ctags -o {OUTPUT} -e {INPUT}
Name of the output tags file.
Defaults to: TAGS
To create the TAGS file, simply run: $ rake mactag
Copyright (c) 2010 Johan Andersson, released under the MIT license