Class Gem::Commands::GenerateIndexCommand
In: lib/rubygems/commands/generate_index_command.rb
Parent: Gem::Command

Methods

execute   new  

Public Class methods

[Source]

    # File lib/rubygems/commands/generate_index_command.rb, line 6
 6:   def initialize
 7:     super 'generate_index',
 8:           'Generates the index files for a gem server directory',
 9:           :directory => '.'
10: 
11:     add_option '-d', '--directory=DIRNAME',
12:                'repository base dir containing gems subdir' do |dir, options|
13:       options[:directory] = File.expand_path dir
14:     end
15:   end

Public Instance methods

[Source]

    # File lib/rubygems/commands/generate_index_command.rb, line 46
46:   def execute
47:     if not File.exist?(options[:directory]) or
48:        not File.directory?(options[:directory]) then
49:       alert_error "unknown directory name #{directory}."
50:       terminate_interaction 1
51:     else
52:       indexer = Gem::Indexer.new options[:directory]
53:       indexer.generate_index
54:     end
55:   end

[Validate]