Creates rake tasks for building, rebuilding and removing TAGS files.
In your Rakefile add:
require 'rdoc/tags_task' RDoc::TagsTask.new
Then run from the commandline:
$ rake tags # build $ rake retag # rebuild $ rake clobber_tags # remove
Use the Hoe::RDoc_tags plugin instead if you're using Hoe.
Rake::FileList of files to be used for tag generation.
Your gem's require paths are probably sufficient.
Tag style to output. Defaults to vim, emacs is also supported.
Creates a new RDoc task that will build a TAGS
file. Default task names are tags
to build,
retag
to rebuild and clobber_tags
to remove.
These may be overridden using the names
hash with the
:tags
, :retag
and :clobber
keys
respectively.
# File lib/rdoc/tags_task.rb, line 75 def initialize names = {} # :yield: self @clobber_task = names[:clobber] || 'clobber_tags' @retag_task = names[:retag] || 'retag' @tags_task = names[:tags] || 'tags' @files = Rake::FileList.new 'lib/**/*.rb' @tags_dir = './.rdoc' @tags_file = 'TAGS' @tag_style = 'vim' @ctags_merge = false @ctags_path = nil yield self if block_given? define end
Defines tasks for building, rebuilding and clobbering the TAGS file
# File lib/rdoc/tags_task.rb, line 130 def define desc 'Build TAGS file' task @tags_task => @tags_file desc 'Rebuild TAGS file' task @retag_task => [@clobber_task, @tags_task] desc 'Clobber TAGS file' task @clobber_task do rm_f tags_path, :verbose => Rake.application.options.trace end directory @tags_dir file @tags_file => [@tags_dir, Rake.application.rakefile, *@files] do build_tags end self end