diff options
Diffstat (limited to 'lib')
-rw-r--r-- | lib/rdoc/rubygems_hook.rb | 26 | ||||
-rw-r--r-- | lib/rdoc/store.rb | 2 |
2 files changed, 17 insertions, 11 deletions
diff --git a/lib/rdoc/rubygems_hook.rb b/lib/rdoc/rubygems_hook.rb index 9fcb783425..f001c6d66c 100644 --- a/lib/rdoc/rubygems_hook.rb +++ b/lib/rdoc/rubygems_hook.rb @@ -68,10 +68,12 @@ class RDoc::RubygemsHook ## # Creates a new documentation generator for +spec+. RDoc and ri data - # generation can be disabled through +generate_rdoc+ and +generate_ri+ - # respectively. + # generation can be enabled or disabled through +generate_rdoc+ and + # +generate_ri+ respectively. + # + # Only +generate_ri+ is enabled by default. - def initialize spec, generate_rdoc = true, generate_ri = true + def initialize spec, generate_rdoc = false, generate_ri = true @doc_dir = spec.doc_dir @force = false @rdoc = nil @@ -139,13 +141,11 @@ class RDoc::RubygemsHook setup - options = ::RDoc::Options.new - options.default_title = "#{@spec.full_name} Documentation" - options.files = [] - options.files.concat @spec.require_paths - options.files.concat @spec.extra_rdoc_files + options = nil args = @spec.rdoc_options + args.concat @spec.require_paths + args.concat @spec.extra_rdoc_files case config_args = Gem.configuration[:rdoc] when String then @@ -155,7 +155,13 @@ class RDoc::RubygemsHook end delete_legacy_args args - options.parse args + + Dir.chdir @spec.full_gem_path do + options = ::RDoc::Options.new + options.default_title = "#{@spec.full_name} Documentation" + options.parse args + end + options.quiet = !Gem.configuration.really_verbose @rdoc = new_rdoc @@ -167,7 +173,7 @@ class RDoc::RubygemsHook store.main = options.main_page store.title = options.title - @rdoc.store = RDoc::Store.new + @rdoc.store = store say "Parsing documentation for #{@spec.full_name}" diff --git a/lib/rdoc/store.rb b/lib/rdoc/store.rb index 9beced6423..2a2acf4edb 100644 --- a/lib/rdoc/store.rb +++ b/lib/rdoc/store.rb @@ -596,7 +596,7 @@ class RDoc::Store def load_class_data klass_name file = class_file klass_name - obj = open file, 'rb' do |io| + open file, 'rb' do |io| Marshal.load io.read end rescue Errno::ENOENT => e |