Parent

RDoc::Generator::RI

Generates ri data files

Public Class Methods

for(options) click to toggle source
    # File lib/rdoc/generator/ri.rb, line 11
11:   def self.for options
12:     new options
13:   end
new(options) click to toggle source

Set up a new ri generator

    # File lib/rdoc/generator/ri.rb, line 18
18:   def initialize options #:not-new:
19:     @options     = options
20:     @store       = RDoc::RI::Store.new '.'
21:     @old_siginfo = nil
22:     @current     = nil
23:   end

Public Instance Methods

generate(top_levels) click to toggle source

Build the initial indices and output objects based on an array of TopLevel objects containing the extracted information.

    # File lib/rdoc/generator/ri.rb, line 29
29:   def generate top_levels
30:     install_siginfo_handler
31: 
32:     RDoc::TopLevel.all_classes_and_modules.each do |klass|
33:       @current = "#{klass.class}: #{klass.full_name}"
34: 
35:       @store.save_class klass
36: 
37:       klass.each_method do |method|
38:         @current = "#{method.class}: #{method.full_name}"
39:         @store.save_method klass, method
40:       end
41: 
42:       klass.each_attribute do |attribute|
43:         @store.save_method klass, attribute
44:       end
45:     end
46: 
47:     @current = 'saving cache'
48: 
49:     @store.save_cache
50: 
51:   ensure
52:     @current = nil
53: 
54:     remove_siginfo_handler
55:   end
install_siginfo_handler() click to toggle source

Installs a siginfo handler that prints the current filename.

    # File lib/rdoc/generator/ri.rb, line 60
60:   def install_siginfo_handler
61:     return unless Signal.list.key? 'INFO'
62: 
63:     @old_siginfo = trap 'INFO' do
64:       puts @current if @current
65:     end
66:   end
remove_siginfo_handler() click to toggle source

Removes a siginfo handler and replaces the previous

    # File lib/rdoc/generator/ri.rb, line 71
71:   def remove_siginfo_handler
72:     return unless Signal.list.key? 'INFO'
73: 
74:     handler = @old_siginfo || 'DEFAULT'
75: 
76:     trap 'INFO', handler
77:   end

Disabled; run with --debug to generate this.

[Validate]

Generated with the Darkfish Rdoc Generator 1.1.6.