diff options
Diffstat (limited to 'lib/rubygems/commands/rdoc_command.rb')
-rw-r--r-- | lib/rubygems/commands/rdoc_command.rb | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/lib/rubygems/commands/rdoc_command.rb b/lib/rubygems/commands/rdoc_command.rb index 9bb07245cd..df00f3a5df 100644 --- a/lib/rubygems/commands/rdoc_command.rb +++ b/lib/rubygems/commands/rdoc_command.rb @@ -1,6 +1,7 @@ require 'rubygems/command' require 'rubygems/version_option' require 'rubygems/rdoc' +require 'fileutils' class Gem::Commands::RdocCommand < Gem::Command include Gem::VersionOption @@ -72,6 +73,11 @@ The rdoc command builds RDoc and RI documentation for installed gems. Use doc.force = options[:overwrite] + if options[:overwrite] then + FileUtils.rm_rf File.join(spec.doc_dir, 'ri') + FileUtils.rm_rf File.join(spec.doc_dir, 'rdoc') + end + begin doc.generate rescue Errno::ENOENT => e |