method
main_url
v1_9_1_378 -
Show latest stable
- Class:
RDoc::Generator::HTML
main_url()private
Returns the url of the main page
# File lib/rdoc/generator/html.rb, line 337
def main_url
main_page = @options.main_page
#
# If a main page has been specified (--main), then search for it
# in the AllReferences array. This allows either files or classes
# to be used for the main page.
#
if main_page then
main_page_ref = RDoc::Generator::AllReferences[main_page]
if main_page_ref then
return main_page_ref.path
else
$stderr.puts "Could not find main page #{main_page}"
end
end
#
# No main page has been specified, so just use the README.
#
@files.each do |file|
if file.name =~ /^README/ then
return file.path
end
end
#
# There's no README (shame! shame!). Just use the first file
# that will be documented.
#
@files.each do |file|
if file.document_self then
return file.path
end
end
#
# There are no files to be documented... Something seems very wrong.
#
raise RDoc::Error, "Couldn't find anything to document (perhaps :stopdoc: has been used in all classes)!"
end Related methods
- Instance methods
- generate
- Class methods
- for
- new
- Private methods
-
build_indices -
gen_an_index -
gen_class_index -
gen_file_index -
gen_into -
gen_main_index -
gen_method_index -
gen_sub_directories -
generate_html -
index_to_links -
load_html_template -
main_url -
write_style_sheet