Generates a index files for use as a gem server.
See `gem help generate_index`
# File lib/rubygems/commands/generate_index_command.rb, line 11 11: def initialize 12: super 'generate_index', 13: 'Generates the index files for a gem server directory', 14: :directory => '.', :build_legacy => true, :build_modern => true 15: 16: add_option '-d', '--directory=DIRNAME', 17: 'repository base dir containing gems subdir' do |dir, options| 18: options[:directory] = File.expand_path dir 19: end 20: 21: add_option '--[no-]legacy', 22: 'Generate indexes for RubyGems older than', 23: '1.2.0' do |value, options| 24: unless options[:build_modern] or value then 25: raise OptionParser::InvalidOption, 'no indicies will be built' 26: end 27: 28: options[:build_legacy] = value 29: end 30: 31: add_option '--[no-]modern', 32: 'Generate indexes for RubyGems newer', 33: 'than 1.2.0' do |value, options| 34: unless options[:build_legacy] or value then 35: raise OptionParser::InvalidOption, 'no indicies will be built' 36: end 37: 38: options[:build_modern] = value 39: end 40: 41: add_option '--update', 42: 'Update modern indexes with gems added', 43: 'since the last update' do |value, options| 44: options[:update] = value 45: end 46: 47: add_option :RSS, '--rss-gems-host=GEM_HOST', 48: 'Host name where gems are served from,', 49: 'used for GUID and enclosure values' do |value, options| 50: options[:rss_gems_host] = value 51: end 52: 53: add_option :RSS, '--rss-host=HOST', 54: 'Host name for more gems information,', 55: 'used for RSS feed link' do |value, options| 56: options[:rss_host] = value 57: end 58: 59: add_option :RSS, '--rss-title=TITLE', 60: 'Set title for RSS feed' do |value, options| 61: options[:rss_title] = value 62: end 63: end
# File lib/rubygems/commands/generate_index_command.rb, line 110 110: def execute 111: if options[:update] and 112: (options[:rss_host] or options[:rss_gems_host]) then 113: alert_error '--update not compatible with RSS generation' 114: terminate_interaction 1 115: end 116: 117: if not File.exist?(options[:directory]) or 118: not File.directory?(options[:directory]) then 119: alert_error "unknown directory name #{directory}." 120: terminate_interaction 1 121: else 122: indexer = Gem::Indexer.new options.delete(:directory), options 123: 124: if options[:update] then 125: indexer.update_index 126: else 127: indexer.generate_index 128: end 129: end 130: end
Disabled; run with --debug to generate this.
Generated with the Darkfish Rdoc Generator 1.1.6.