diff options
author | drbrain <drbrain@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2012-11-27 04:28:14 +0000 |
---|---|---|
committer | drbrain <drbrain@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2012-11-27 04:28:14 +0000 |
commit | 1c279a7d2753949c725754e1302f791b76358114 (patch) | |
tree | 36aa3bdde250e564445eba5f2e25fcb96bcb6cef /lib/rdoc/generator/ri.rb | |
parent | c72f0daa877808e4fa5018b3191ca09d4b97c03d (diff) | |
download | ruby-1c279a7d2753949c725754e1302f791b76358114.tar.gz |
* lib/rdoc*: Updated to RDoc 4.0 (pre-release)
* bin/rdoc: ditto
* test/rdoc: ditto
* NEWS: Updated with RDoc 4.0 information
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37889 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib/rdoc/generator/ri.rb')
-rw-r--r-- | lib/rdoc/generator/ri.rb | 70 |
1 files changed, 7 insertions, 63 deletions
diff --git a/lib/rdoc/generator/ri.rb b/lib/rdoc/generator/ri.rb index 939a165cfb..b9c4141a5e 100644 --- a/lib/rdoc/generator/ri.rb +++ b/lib/rdoc/generator/ri.rb @@ -1,6 +1,3 @@ -require 'rdoc/generator' -require 'rdoc/ri' - ## # Generates ri data files @@ -16,70 +13,17 @@ class RDoc::Generator::RI ## # Set up a new ri generator - def initialize options #:not-new: - @options = options - @old_siginfo = nil - @current = nil - - @store = RDoc::RI::Store.new '.' - @store.dry_run = @options.dry_run - @store.encoding = @options.encoding if @options.respond_to? :encoding - end - - ## - # Build the initial indices and output objects based on an array of TopLevel - # objects containing the extracted information. - - def generate top_levels - install_siginfo_handler - - @store.load_cache - - RDoc::TopLevel.all_classes_and_modules.each do |klass| - @current = "#{klass.class}: #{klass.full_name}" - - @store.save_class klass - - klass.each_method do |method| - @current = "#{method.class}: #{method.full_name}" - @store.save_method klass, method - end - - klass.each_attribute do |attribute| - @store.save_method klass, attribute - end - end - - @current = 'saving cache' - - @store.save_cache - - ensure - @current = nil - - remove_siginfo_handler + def initialize store, options #:not-new: + @options = options + @store = store + @store.path = '.' end ## - # Installs a siginfo handler that prints the current filename. - - def install_siginfo_handler - return unless Signal.list.key? 'INFO' - - @old_siginfo = trap 'INFO' do - puts @current if @current - end - end - - ## - # Removes a siginfo handler and replaces the previous - - def remove_siginfo_handler - return unless Signal.list.key? 'INFO' - - handler = @old_siginfo || 'DEFAULT' + # Writes the parsed data store to disk for use by ri. - trap 'INFO', handler + def generate + @store.save end end |