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