method
install_rdoc
v2_2_9 -
Show latest stable
-
0 notes -
Class: SetupCommand
- 1_8_6_287
- 1_8_7_72
- 1_8_7_330
- 1_9_1_378
- 1_9_2_180
- 1_9_3_125 (0)
- 1_9_3_392 (0)
- 2_1_10 (0)
- 2_2_9 (0)
- 2_4_6 (0)
- 2_5_5 (0)
- 2_6_3 (0)
- What's this?
install_rdoc()
public
Hide source
# File lib/rubygems/commands/setup_command.rb, line 287 def install_rdoc gem_doc_dir = File.join Gem.dir, 'doc' rubygems_name = "rubygems-#{Gem::VERSION}" rubygems_doc_dir = File.join gem_doc_dir, rubygems_name begin Gem.ensure_gem_subdirectories Gem.dir rescue SystemCallError # ignore end if File.writable? gem_doc_dir and (not File.exist? rubygems_doc_dir or File.writable? rubygems_doc_dir) then say "Removing old RubyGems RDoc and ri" if @verbose Dir[File.join(Gem.dir, 'doc', 'rubygems-[0-9]*')].each do |dir| rm_rf dir end require 'rubygems/rdoc' fake_spec = Gem::Specification.new 'rubygems', Gem::VERSION def fake_spec.full_gem_path File.expand_path '../../../..', __FILE__ end generate_ri = options[:document].include? 'ri' generate_rdoc = options[:document].include? 'rdoc' rdoc = Gem::RDoc.new fake_spec, generate_rdoc, generate_ri rdoc.generate return true elsif @verbose then say "Skipping RDoc generation, #{gem_doc_dir} not writable" say "Set the GEM_HOME environment variable if you want RDoc generated" end return false end