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 Marshal.4.8' do |value, options|
23: unless options[:build_modern] or value then
24: raise OptionParser::InvalidOption, 'no indicies will be built'
25: end
26:
27: options[:build_legacy] = value
28: end
29:
30: add_option '--[no-]modern',
31: 'Generate indexes for RubyGems newer',
32: 'than 1.2.0' do |value, options|
33: unless options[:build_legacy] or value then
34: raise OptionParser::InvalidOption, 'no indicies will be built'
35: end
36:
37: options[:build_modern] = value
38: end
39:
40: add_option '--update',
41: 'Update modern indexes with gems added',
42: 'since the last update' do |value, options|
43: options[:update] = value
44: end
45:
46: add_option :RSS, '--rss-gems-host=GEM_HOST',
47: 'Host name where gems are served from,',
48: 'used for GUID and enclosure values' do |value, options|
49: options[:rss_gems_host] = value
50: end
51:
52: add_option :RSS, '--rss-host=HOST',
53: 'Host name for more gems information,',
54: 'used for RSS feed link' do |value, options|
55: options[:rss_host] = value
56: end
57:
58: add_option :RSS, '--rss-title=TITLE',
59: 'Set title for RSS feed' do |value, options|
60: options[:rss_title] = value
61: end
62: end