I have a ruby script in emacs.
require 'watir'
ie=Watir::IE.new
When I puts the cursor on the word IE and press C+] , I want Emacs to open the definition of the IE class, which is in the source code of the watir gem.
How can I achieve that using Emacs and ctags?
Use the following command it the directory where your gems are installed:
ctags -e -a --Ruby-kinds=-fF -o TAGS -R .
Afterwards press M-. in Emacs while your cursor is over the Watir
word. Emacs will prompt you for the location of the TAGS file and afterwards it will jump to the definition of the type.
Basic etags usage in Emacs:
M-. goes to the method under the cursor, in the same window. First time it asks for the TAGS file. C-4 . goes to the method under the cursor. Opens a new window. First time it asks for the TAGS file. M-, cycles to the next selection.