summaryrefslogtreecommitdiff
path: root/lib/rubygems/doc_manager.rb
diff options
context:
space:
mode:
-rw-r--r--lib/rubygems/doc_manager.rb54
1 files changed, 35 insertions, 19 deletions
@@ -41,12 +41,23 @@ class Gem::DocManager
begin
require 'rdoc/rdoc'
rescue LoadError => e
raise Gem::DocumentError,
- "ERROR: RDoc documentation generator not installed!"
end
end
##
# Updates the RI cache for RDoc 2 if it is installed
@@ -94,10 +105,8 @@ class Gem::DocManager
# RI docs generation to fail if run after RDoc).
def generate_ri
- if @spec.has_rdoc then
- setup_rdoc
- install_ri # RDoc bug, ri goes first
- end
FileUtils.mkdir_p @doc_dir unless File.exist?(@doc_dir)
end
@@ -110,10 +119,8 @@ class Gem::DocManager
# RI docs generation to fail if run after RDoc).
def generate_rdoc
- if @spec.has_rdoc then
- setup_rdoc
- install_rdoc
- end
FileUtils.mkdir_p @doc_dir unless File.exist?(@doc_dir)
end
@@ -151,8 +158,17 @@ class Gem::DocManager
args << '--quiet'
args << @spec.require_paths.clone
args << @spec.extra_rdoc_files
args = args.flatten.map do |arg| arg.to_s end
r = RDoc::RDoc.new
old_pwd = Dir.pwd
@@ -194,20 +210,20 @@ class Gem::DocManager
original_name = [
@spec.name, @spec.version, @spec.original_platform].join '-'
- doc_dir = File.join @spec.installation_path, 'doc', @spec.full_name
- unless File.directory? doc_dir then
- doc_dir = File.join @spec.installation_path, 'doc', original_name
- end
- FileUtils.rm_rf doc_dir
- ri_dir = File.join @spec.installation_path, 'ri', @spec.full_name
- unless File.directory? ri_dir then
- ri_dir = File.join @spec.installation_path, 'ri', original_name
- end
- FileUtils.rm_rf ri_dir
end
end