[Rubygems-developers] --rdoc option does not have an effect
Hugh Sasse
hgs at dmu.ac.uk
Fri Jun 10 07:49:25 EDT 2005
On Fri, 10 Jun 2005, Chad Fowler wrote:
>
> Actually, the rdoc spec is being used to avoid running rdoc on gems that
> really have no rdoc (like "rails"). There was a case where rdoc was crashing
> on one of these
> gems, and the author used the rdoc spec attribute to explicitly stop rdoc
> from running.
>
> Chad
>
So what about something like this (untested) code (patch made
against rubygems-0.8.10):
--- ./doc_manager.rb.orig 2005-02-28 23:26:58.000000000 +0000
+++ ./doc_manager.rb 2005-06-10 12:42:58.927496000 +0100
@@ -35,7 +35,8 @@
end
def generate_rdoc
- return if @spec.has_rdoc == false
+ # return if @spec.has_rdoc == false
+ # Now taken care of with rescue clause.
require 'fileutils'
Gem::FilePermissionError.new(@doc_dir) if File.exist?(@doc_dir) && !File.writable?(@doc_dir)
FileUtils.mkdir_p @doc_dir unless File.exist?(@doc_dir)
@@ -58,6 +59,8 @@
r.document(['--quiet', '--op', rdoc_dir] + @rdoc_args.flatten + source_dirs)
rescue Errno::EACCES => e
raise Gem::FilePermissionError.new(File.dirname(e.message.split("-")[1].strip))
+ rescue => e
+ say "Performing RDoc failed with \"#{e.message}\", but it is known to crash occasionally"
end
#TODO: Why is this throwing an error?
#ri = RDoc::RDoc.new
By which I mean, "we know it will fail sometimes and we don't know
why yet, so let's trap those cases and carry on, because thw world
probably hasn't ended if we get no rdocs."
Hugh
More information about the Rubygems-developers
mailing list