Class: Gem::Commands::EtagsCommand

Inherits:
Gem::Command
  • Object
show all
Defined in:
lib/rubygems/commands/etags_command.rb

Instance Method Summary collapse

Constructor Details

#initializeEtagsCommand

Returns a new instance of EtagsCommand.



4
5
6
# File 'lib/rubygems/commands/etags_command.rb', line 4

def initialize
  super 'etags', 'Generate etags for gems'
end

Instance Method Details

#executeObject



8
9
10
11
12
13
14
15
16
17
# File 'lib/rubygems/commands/etags_command.rb', line 8

def execute
  Gem::Specification.each do |spec|
    Dir.chdir(spec.full_gem_path) do
      unless File.exist?('TAGS')
        say "Generating etags for #{spec.full_name}"
        system('ctags', '-eR', *spec.require_paths)
      end
    end
  end
end