mirror of
https://github.com/ruby/ruby.git
synced 2025-08-23 13:04:13 +02:00
Sync RDoc 6.14.0
This commit is contained in:
parent
ca1ea95784
commit
03eb777c69
185 changed files with 2008 additions and 1655 deletions
|
@ -69,7 +69,7 @@ class RDoc::RDoc
|
|||
##
|
||||
# The current documentation store
|
||||
|
||||
attr_reader :store
|
||||
attr_accessor :store
|
||||
|
||||
##
|
||||
# Add +klass+ that can generate output after parsing
|
||||
|
@ -89,7 +89,7 @@ class RDoc::RDoc
|
|||
##
|
||||
# Sets the active RDoc::RDoc instance
|
||||
|
||||
def self.current= rdoc
|
||||
def self.current=(rdoc)
|
||||
@current = rdoc
|
||||
end
|
||||
|
||||
|
@ -118,7 +118,7 @@ class RDoc::RDoc
|
|||
# Gathers a set of parseable files from the files and directories listed in
|
||||
# +files+.
|
||||
|
||||
def gather_files files
|
||||
def gather_files(files)
|
||||
files = [@options.root.to_s] if files.empty?
|
||||
|
||||
file_list = normalized_file_list files, true, @options.exclude
|
||||
|
@ -208,15 +208,6 @@ option)
|
|||
last
|
||||
end
|
||||
|
||||
##
|
||||
# Sets the current documentation tree to +store+ and sets the store's rdoc
|
||||
# driver to this instance.
|
||||
|
||||
def store= store
|
||||
@store = store
|
||||
@store.rdoc = self
|
||||
end
|
||||
|
||||
##
|
||||
# Update the flag file in an output directory.
|
||||
|
||||
|
@ -246,7 +237,7 @@ option)
|
|||
# representing candidates for documentation. It may also contain comments
|
||||
# (starting with '#')
|
||||
|
||||
def parse_dot_doc_file in_dir, filename
|
||||
def parse_dot_doc_file(in_dir, filename)
|
||||
# read and strip comments
|
||||
patterns = File.read(filename).gsub(/#.*/, '')
|
||||
|
||||
|
@ -320,7 +311,7 @@ option)
|
|||
# files. However we may well contain subdirectories which must be tested
|
||||
# for .document files.
|
||||
|
||||
def list_files_in_directory dir
|
||||
def list_files_in_directory(dir)
|
||||
files = Dir.glob File.join(dir, "*")
|
||||
|
||||
normalized_file_list files, false, @options.exclude
|
||||
|
@ -329,7 +320,7 @@ option)
|
|||
##
|
||||
# Parses +filename+ and returns an RDoc::TopLevel
|
||||
|
||||
def parse_file filename
|
||||
def parse_file(filename)
|
||||
encoding = @options.encoding
|
||||
filename = filename.encode encoding
|
||||
|
||||
|
@ -400,7 +391,7 @@ The internal error was:
|
|||
##
|
||||
# Parse each file on the command line, recursively entering directories.
|
||||
|
||||
def parse_files files
|
||||
def parse_files(files)
|
||||
file_list = gather_files files
|
||||
@stats = RDoc::Stats.new @store, file_list.length, @options.verbosity
|
||||
|
||||
|
@ -427,7 +418,7 @@ The internal error was:
|
|||
# Removes file extensions known to be unparseable from +files+ and TAGS
|
||||
# files for emacs and vim.
|
||||
|
||||
def remove_unparseable files
|
||||
def remove_unparseable(files)
|
||||
files.reject do |file, *|
|
||||
file =~ /\.(?:class|eps|erb|scpt\.txt|svg|ttf|yml)$/i or
|
||||
(file =~ /tags$/i and
|
||||
|
@ -449,9 +440,7 @@ The internal error was:
|
|||
# By default, output will be stored in a directory called "doc" below the
|
||||
# current directory, so make sure you're somewhere writable before invoking.
|
||||
|
||||
def document options
|
||||
self.store = RDoc::Store.new
|
||||
|
||||
def document(options)
|
||||
if RDoc::Options === options then
|
||||
@options = options
|
||||
else
|
||||
|
@ -460,6 +449,8 @@ The internal error was:
|
|||
end
|
||||
@options.finish
|
||||
|
||||
@store = RDoc::Store.new(@options)
|
||||
|
||||
if @options.pipe then
|
||||
handle_pipe
|
||||
exit
|
||||
|
@ -469,12 +460,6 @@ The internal error was:
|
|||
@last_modified = setup_output_dir @options.op_dir, @options.force_update
|
||||
end
|
||||
|
||||
@store.encoding = @options.encoding
|
||||
@store.dry_run = @options.dry_run
|
||||
@store.main = @options.main_page
|
||||
@store.title = @options.title
|
||||
@store.path = @options.op_dir
|
||||
|
||||
@start_time = Time.now
|
||||
|
||||
@store.load_cache
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue