mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
Update to RubyGems 1.3.4 r2223
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@23659 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
a6afbaeb3b
commit
31c94ffeb5
126 changed files with 7610 additions and 3747 deletions
|
@ -41,12 +41,23 @@ class Gem::DocManager
|
|||
|
||||
begin
|
||||
require 'rdoc/rdoc'
|
||||
|
||||
@rdoc_version = if defined? RDoc::VERSION then
|
||||
Gem::Version.new RDoc::VERSION
|
||||
else
|
||||
Gem::Version.new '1.0.1' # HACK parsing is hard
|
||||
end
|
||||
|
||||
rescue LoadError => e
|
||||
raise Gem::DocumentError,
|
||||
"ERROR: RDoc documentation generator not installed!"
|
||||
"ERROR: RDoc documentation generator not installed: #{e}"
|
||||
end
|
||||
end
|
||||
|
||||
def self.rdoc_version
|
||||
@rdoc_version
|
||||
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
|
||||
setup_rdoc
|
||||
install_ri # RDoc bug, ri goes first
|
||||
|
||||
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
|
||||
setup_rdoc
|
||||
install_rdoc
|
||||
|
||||
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 << '--title' << "#{@spec.full_name} Documentation"
|
||||
args = args.flatten.map do |arg| arg.to_s end
|
||||
|
||||
if self.class.rdoc_version >= Gem::Version.new('2.4.0') then
|
||||
args.delete '--inline-source'
|
||||
args.delete '--promiscuous'
|
||||
args.delete '-p'
|
||||
args.delete '--one-file'
|
||||
# HACK more
|
||||
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
|
||||
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
|
||||
FileUtils.rm_rf doc_dir
|
||||
|
||||
ri_dir = File.join @spec.installation_path, 'ri', @spec.full_name
|
||||
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
|
||||
unless File.directory? ri_dir then
|
||||
ri_dir = File.join @spec.installation_path, 'ri', original_name
|
||||
end
|
||||
|
||||
FileUtils.rm_rf ri_dir
|
||||
FileUtils.rm_rf ri_dir
|
||||
end
|
||||
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue