2008-01-07 01:56:46 -05:00
|
|
|
require 'optparse'
|
2003-12-16 00:44:25 -05:00
|
|
|
|
2010-04-01 03:45:16 -04:00
|
|
|
require 'rdoc/ri/paths'
|
2003-12-01 02:12:49 -05:00
|
|
|
|
2010-04-01 03:45:16 -04:00
|
|
|
##
|
|
|
|
# RDoc::Options handles the parsing and storage of options
|
2003-12-01 02:12:49 -05:00
|
|
|
|
2010-04-01 03:45:16 -04:00
|
|
|
class RDoc::Options
|
2003-12-01 02:12:49 -05:00
|
|
|
|
2008-01-07 01:56:46 -05:00
|
|
|
##
|
|
|
|
# Character-set
|
2003-12-01 02:12:49 -05:00
|
|
|
|
2008-01-07 01:56:46 -05:00
|
|
|
attr_reader :charset
|
2003-12-01 02:12:49 -05:00
|
|
|
|
2008-01-07 01:56:46 -05:00
|
|
|
##
|
|
|
|
# Files matching this pattern will be excluded
|
2003-12-01 02:12:49 -05:00
|
|
|
|
2008-01-07 01:56:46 -05:00
|
|
|
attr_accessor :exclude
|
2003-12-01 02:12:49 -05:00
|
|
|
|
2008-01-07 01:56:46 -05:00
|
|
|
##
|
|
|
|
# The list of files to be processed
|
|
|
|
|
2008-02-09 22:59:08 -05:00
|
|
|
attr_accessor :files
|
2008-01-07 01:56:46 -05:00
|
|
|
|
|
|
|
##
|
|
|
|
# Scan newer sources than the flag file if true.
|
|
|
|
|
|
|
|
attr_reader :force_update
|
|
|
|
|
|
|
|
##
|
|
|
|
# Description of the output generator (set with the <tt>-fmt</tt> option)
|
2003-12-01 02:12:49 -05:00
|
|
|
|
2008-01-07 01:56:46 -05:00
|
|
|
attr_accessor :generator
|
|
|
|
|
2008-07-17 20:46:16 -04:00
|
|
|
##
|
|
|
|
# Formatter to mark up text with
|
|
|
|
|
|
|
|
attr_accessor :formatter
|
2009-03-05 22:56:38 -05:00
|
|
|
|
2008-01-07 01:56:46 -05:00
|
|
|
##
|
|
|
|
# Name of the file, class or module to display in the initial index page (if
|
|
|
|
# not specified the first file we encounter is used)
|
|
|
|
|
|
|
|
attr_accessor :main_page
|
|
|
|
|
|
|
|
##
|
|
|
|
# The name of the output directory
|
|
|
|
|
|
|
|
attr_accessor :op_dir
|
|
|
|
|
|
|
|
##
|
2010-04-01 03:45:16 -04:00
|
|
|
# Is RDoc in pipe mode?
|
2008-01-07 01:56:46 -05:00
|
|
|
|
2010-04-01 03:45:16 -04:00
|
|
|
attr_accessor :pipe
|
2008-01-07 01:56:46 -05:00
|
|
|
|
|
|
|
##
|
|
|
|
# Array of directories to search for files to satisfy an :include:
|
|
|
|
|
|
|
|
attr_reader :rdoc_include
|
|
|
|
|
|
|
|
##
|
2010-04-01 03:45:16 -04:00
|
|
|
# Include private and protected methods in the output?
|
2008-01-07 01:56:46 -05:00
|
|
|
|
|
|
|
attr_accessor :show_all
|
|
|
|
|
|
|
|
##
|
|
|
|
# Include the '#' at the front of hyperlinked instance method names
|
|
|
|
|
|
|
|
attr_reader :show_hash
|
|
|
|
|
|
|
|
##
|
|
|
|
# The number of columns in a tab
|
2003-12-01 02:12:49 -05:00
|
|
|
|
|
|
|
attr_reader :tab_width
|
|
|
|
|
2008-01-07 01:56:46 -05:00
|
|
|
##
|
2010-04-01 03:45:16 -04:00
|
|
|
# Template to be used when generating output
|
2003-12-01 02:12:49 -05:00
|
|
|
|
2008-01-07 01:56:46 -05:00
|
|
|
attr_reader :template
|
2003-12-01 02:12:49 -05:00
|
|
|
|
2008-01-07 01:56:46 -05:00
|
|
|
##
|
|
|
|
# Documentation title
|
2003-12-01 02:12:49 -05:00
|
|
|
|
2008-01-07 01:56:46 -05:00
|
|
|
attr_reader :title
|
|
|
|
|
2008-07-21 14:35:14 -04:00
|
|
|
##
|
|
|
|
# Verbosity, zero means quiet
|
|
|
|
|
|
|
|
attr_accessor :verbosity
|
|
|
|
|
2008-01-07 01:56:46 -05:00
|
|
|
##
|
2003-12-01 02:12:49 -05:00
|
|
|
# URL of web cvs frontend
|
2008-01-07 01:56:46 -05:00
|
|
|
|
2003-12-01 02:12:49 -05:00
|
|
|
attr_reader :webcvs
|
|
|
|
|
2010-04-01 03:45:16 -04:00
|
|
|
def initialize # :nodoc:
|
|
|
|
require 'rdoc/rdoc'
|
|
|
|
@op_dir = nil
|
2008-01-07 01:56:46 -05:00
|
|
|
@show_all = false
|
|
|
|
@main_page = nil
|
|
|
|
@exclude = []
|
2010-04-01 03:45:16 -04:00
|
|
|
@generators = RDoc::RDoc::GENERATORS
|
|
|
|
@generator = RDoc::Generator::Darkfish
|
|
|
|
@generator_name = nil
|
2008-01-07 01:56:46 -05:00
|
|
|
@rdoc_include = []
|
|
|
|
@title = nil
|
|
|
|
@template = nil
|
|
|
|
@show_hash = false
|
|
|
|
@tab_width = 8
|
2010-04-01 03:45:16 -04:00
|
|
|
@force_update = true
|
2008-07-21 14:35:14 -04:00
|
|
|
@verbosity = 1
|
2010-04-01 03:45:16 -04:00
|
|
|
@pipe = false
|
2008-01-07 01:56:46 -05:00
|
|
|
|
|
|
|
@webcvs = nil
|
|
|
|
|
2008-09-24 22:43:03 -04:00
|
|
|
@charset = 'utf-8'
|
2008-01-07 01:56:46 -05:00
|
|
|
end
|
2003-12-01 02:12:49 -05:00
|
|
|
|
2008-01-07 01:56:46 -05:00
|
|
|
##
|
|
|
|
# Parse command line options.
|
|
|
|
|
|
|
|
def parse(argv)
|
2010-04-01 03:45:16 -04:00
|
|
|
ignore_invalid = true
|
2008-01-07 01:56:46 -05:00
|
|
|
|
2008-04-04 17:16:19 -04:00
|
|
|
opts = OptionParser.new do |opt|
|
2008-01-07 01:56:46 -05:00
|
|
|
opt.program_name = File.basename $0
|
|
|
|
opt.version = RDoc::VERSION
|
2008-09-24 22:43:03 -04:00
|
|
|
opt.release = nil
|
2008-01-07 01:56:46 -05:00
|
|
|
opt.summary_indent = ' ' * 4
|
|
|
|
opt.banner = <<-EOF
|
|
|
|
Usage: #{opt.program_name} [options] [names...]
|
|
|
|
|
|
|
|
Files are parsed, and the information they contain collected, before any
|
|
|
|
output is produced. This allows cross references between all files to be
|
|
|
|
resolved. If a name is a directory, it is traversed. If no names are
|
|
|
|
specified, all Ruby files in the current directory (and subdirectories) are
|
|
|
|
processed.
|
|
|
|
|
|
|
|
How RDoc generates output depends on the output formatter being used, and on
|
|
|
|
the options you give.
|
|
|
|
|
2010-04-01 03:45:16 -04:00
|
|
|
- Darkfish creates frameless HTML output by Michael Granger.
|
|
|
|
- ri creates ri data files
|
2008-01-07 01:56:46 -05:00
|
|
|
|
2010-04-01 03:45:16 -04:00
|
|
|
RDoc understands the following file formats:
|
2008-01-07 01:56:46 -05:00
|
|
|
|
|
|
|
EOF
|
|
|
|
|
2010-04-01 03:45:16 -04:00
|
|
|
parsers = Hash.new { |h,parser| h[parser] = [] }
|
2008-01-07 01:56:46 -05:00
|
|
|
|
2010-04-01 03:45:16 -04:00
|
|
|
RDoc::Parser.parsers.each do |regexp, parser|
|
|
|
|
parsers[parser.name.sub('RDoc::Parser::', '')] << regexp.source
|
|
|
|
end
|
|
|
|
|
|
|
|
parsers.sort.each do |parser, regexp|
|
|
|
|
opt.banner << " - #{parser}: #{regexp.join ', '}\n"
|
2008-01-07 01:56:46 -05:00
|
|
|
end
|
|
|
|
|
2010-04-01 03:45:16 -04:00
|
|
|
opt.separator nil
|
|
|
|
opt.separator "Parsing Options:"
|
2008-01-07 01:56:46 -05:00
|
|
|
opt.separator nil
|
2006-09-17 10:46:13 -04:00
|
|
|
|
2008-01-07 01:56:46 -05:00
|
|
|
opt.on("--all", "-a",
|
|
|
|
"Include all methods (not just public) in",
|
|
|
|
"the output.") do |value|
|
|
|
|
@show_all = value
|
2003-12-01 02:12:49 -05:00
|
|
|
end
|
|
|
|
|
2008-01-07 01:56:46 -05:00
|
|
|
opt.separator nil
|
2003-12-01 02:12:49 -05:00
|
|
|
|
2008-01-07 01:56:46 -05:00
|
|
|
opt.on("--exclude=PATTERN", "-x", Regexp,
|
|
|
|
"Do not process files or directories",
|
2008-09-24 22:43:03 -04:00
|
|
|
"matching PATTERN.") do |value|
|
2008-01-07 01:56:46 -05:00
|
|
|
@exclude << value
|
|
|
|
end
|
|
|
|
|
|
|
|
opt.separator nil
|
|
|
|
|
|
|
|
opt.on("--extension=NEW=OLD", "-E",
|
|
|
|
"Treat files ending with .new as if they",
|
|
|
|
"ended with .old. Using '-E cgi=rb' will",
|
|
|
|
"cause xxx.cgi to be parsed as a Ruby file.") do |value|
|
|
|
|
new, old = value.split(/=/, 2)
|
|
|
|
|
|
|
|
unless new and old then
|
|
|
|
raise OptionParser::InvalidArgument, "Invalid parameter to '-E'"
|
2003-12-01 02:12:49 -05:00
|
|
|
end
|
2008-01-07 01:56:46 -05:00
|
|
|
|
2010-04-01 03:45:16 -04:00
|
|
|
unless RDoc::Parser.alias_extension old, new then
|
2008-01-07 01:56:46 -05:00
|
|
|
raise OptionParser::InvalidArgument, "Unknown extension .#{old} to -E"
|
2003-12-01 02:12:49 -05:00
|
|
|
end
|
|
|
|
end
|
|
|
|
|
2008-01-07 01:56:46 -05:00
|
|
|
opt.separator nil
|
2003-12-01 02:12:49 -05:00
|
|
|
|
2010-04-03 02:09:37 -04:00
|
|
|
opt.on("--[no-]force-update", "-U",
|
2008-01-07 01:56:46 -05:00
|
|
|
"Forces rdoc to scan all sources even if",
|
|
|
|
"newer than the flag file.") do |value|
|
|
|
|
@force_update = value
|
|
|
|
end
|
2003-12-01 02:12:49 -05:00
|
|
|
|
2008-01-07 01:56:46 -05:00
|
|
|
opt.separator nil
|
2003-12-01 02:12:49 -05:00
|
|
|
|
2010-04-01 03:45:16 -04:00
|
|
|
opt.on("--pipe",
|
|
|
|
"Convert RDoc on stdin to HTML") do
|
|
|
|
@pipe = true
|
2008-01-07 01:56:46 -05:00
|
|
|
end
|
2003-12-01 02:12:49 -05:00
|
|
|
|
2008-01-07 01:56:46 -05:00
|
|
|
opt.separator nil
|
2010-04-01 03:45:16 -04:00
|
|
|
opt.separator "Generator Options:"
|
2008-01-07 01:56:46 -05:00
|
|
|
opt.separator nil
|
2003-12-01 02:12:49 -05:00
|
|
|
|
2010-04-01 03:45:16 -04:00
|
|
|
opt.on("--charset=CHARSET", "-c",
|
|
|
|
"Specifies the output HTML character-set.") do |value|
|
|
|
|
@charset = value
|
2008-01-07 01:56:46 -05:00
|
|
|
end
|
2003-12-01 02:12:49 -05:00
|
|
|
|
2008-01-07 01:56:46 -05:00
|
|
|
opt.separator nil
|
2003-12-01 02:12:49 -05:00
|
|
|
|
2010-04-01 03:45:16 -04:00
|
|
|
generator_text = @generators.keys.map { |name| " #{name}" }.sort
|
|
|
|
|
|
|
|
opt.on("--fmt=FORMAT", "--format=FORMAT", "-f", @generators.keys,
|
|
|
|
"Set the output formatter. One of:", *generator_text) do |value|
|
|
|
|
@generator_name = value.downcase
|
|
|
|
setup_generator
|
2008-01-07 01:56:46 -05:00
|
|
|
end
|
2003-12-01 02:12:49 -05:00
|
|
|
|
2008-01-07 01:56:46 -05:00
|
|
|
opt.separator nil
|
2003-12-01 02:12:49 -05:00
|
|
|
|
2010-04-01 03:45:16 -04:00
|
|
|
opt.on("--include=DIRECTORIES", "-i", Array,
|
|
|
|
"Set (or add to) the list of directories to",
|
|
|
|
"be searched when satisfying :include:",
|
|
|
|
"requests. Can be used more than once.") do |value|
|
|
|
|
@rdoc_include.concat value.map { |dir| dir.strip }
|
2008-01-07 01:56:46 -05:00
|
|
|
end
|
2003-12-01 02:12:49 -05:00
|
|
|
|
2008-01-07 01:56:46 -05:00
|
|
|
opt.separator nil
|
2003-12-01 02:12:49 -05:00
|
|
|
|
2008-01-07 01:56:46 -05:00
|
|
|
opt.on("--main=NAME", "-m",
|
|
|
|
"NAME will be the initial page displayed.") do |value|
|
|
|
|
@main_page = value
|
|
|
|
end
|
2003-12-01 02:12:49 -05:00
|
|
|
|
2008-01-07 01:56:46 -05:00
|
|
|
opt.separator nil
|
2003-12-01 02:12:49 -05:00
|
|
|
|
2010-04-01 03:45:16 -04:00
|
|
|
opt.on("--output=DIR", "--op", "-o",
|
|
|
|
"Set the output directory.") do |value|
|
|
|
|
@op_dir = value
|
2008-01-07 01:56:46 -05:00
|
|
|
end
|
2006-09-17 10:46:13 -04:00
|
|
|
|
2008-01-07 01:56:46 -05:00
|
|
|
opt.separator nil
|
2003-12-01 02:12:49 -05:00
|
|
|
|
2010-04-01 03:45:16 -04:00
|
|
|
opt.on("--show-hash", "-H",
|
|
|
|
"A name of the form #name in a comment is a",
|
|
|
|
"possible hyperlink to an instance method",
|
|
|
|
"name. When displayed, the '#' is removed",
|
|
|
|
"unless this option is specified.") do |value|
|
|
|
|
@show_hash = value
|
2003-12-01 02:12:49 -05:00
|
|
|
end
|
|
|
|
|
2008-01-07 01:56:46 -05:00
|
|
|
opt.separator nil
|
2003-12-01 02:12:49 -05:00
|
|
|
|
2010-04-01 03:45:16 -04:00
|
|
|
opt.on("--tab-width=WIDTH", "-w", OptionParser::DecimalInteger,
|
|
|
|
"Set the width of tab characters.") do |value|
|
|
|
|
@tab_width = value
|
2008-01-07 01:56:46 -05:00
|
|
|
end
|
2003-12-01 02:12:49 -05:00
|
|
|
|
2008-01-07 01:56:46 -05:00
|
|
|
opt.separator nil
|
|
|
|
|
2010-04-01 03:45:16 -04:00
|
|
|
opt.on("--template=NAME", "-T",
|
|
|
|
"Set the template used when generating",
|
|
|
|
"output.") do |value|
|
|
|
|
@template = value
|
2008-01-07 01:56:46 -05:00
|
|
|
end
|
|
|
|
|
|
|
|
opt.separator nil
|
|
|
|
|
2010-04-01 03:45:16 -04:00
|
|
|
opt.on("--title=TITLE", "-t",
|
|
|
|
"Set TITLE as the title for HTML output.") do |value|
|
|
|
|
@title = value
|
2008-01-07 01:56:46 -05:00
|
|
|
end
|
|
|
|
|
|
|
|
opt.separator nil
|
|
|
|
|
2010-04-01 03:45:16 -04:00
|
|
|
opt.on("--webcvs=URL", "-W",
|
|
|
|
"Specify a URL for linking to a web frontend",
|
|
|
|
"to CVS. If the URL contains a '\%s', the",
|
|
|
|
"name of the current file will be",
|
|
|
|
"substituted; if the URL doesn't contain a",
|
|
|
|
"'\%s', the filename will be appended to it.") do |value|
|
|
|
|
@webcvs = value
|
2008-07-21 14:35:14 -04:00
|
|
|
end
|
|
|
|
|
2010-04-01 03:45:16 -04:00
|
|
|
opt.separator nil
|
2004-04-04 00:03:00 -05:00
|
|
|
|
2010-04-01 03:45:16 -04:00
|
|
|
opt.on("-d", "--diagram", "Prevents -d from tripping --debug")
|
2008-07-21 14:35:14 -04:00
|
|
|
|
2010-04-01 03:45:16 -04:00
|
|
|
opt.separator nil
|
|
|
|
opt.separator "ri Generator Options:"
|
2008-01-07 01:56:46 -05:00
|
|
|
opt.separator nil
|
|
|
|
|
|
|
|
opt.on("--ri", "-r",
|
|
|
|
"Generate output for use by `ri`. The files",
|
|
|
|
"are stored in the '.rdoc' directory under",
|
|
|
|
"your home directory unless overridden by a",
|
|
|
|
"subsequent --op parameter, so no special",
|
|
|
|
"privileges are needed.") do |value|
|
|
|
|
@generator_name = "ri"
|
2010-04-01 03:45:16 -04:00
|
|
|
@op_dir ||= RDoc::RI::Paths::HOMEDIR
|
2008-01-07 01:56:46 -05:00
|
|
|
setup_generator
|
|
|
|
end
|
|
|
|
|
|
|
|
opt.separator nil
|
|
|
|
|
|
|
|
opt.on("--ri-site", "-R",
|
|
|
|
"Generate output for use by `ri`. The files",
|
|
|
|
"are stored in a site-wide directory,",
|
|
|
|
"making them accessible to others, so",
|
|
|
|
"special privileges are needed.") do |value|
|
|
|
|
@generator_name = "ri"
|
2008-01-08 05:18:41 -05:00
|
|
|
@op_dir = RDoc::RI::Paths::SITEDIR
|
2008-01-07 01:56:46 -05:00
|
|
|
setup_generator
|
|
|
|
end
|
|
|
|
|
|
|
|
opt.separator nil
|
2010-04-01 03:45:16 -04:00
|
|
|
opt.separator "Generic Options:"
|
2008-01-07 01:56:46 -05:00
|
|
|
opt.separator nil
|
2003-12-01 02:12:49 -05:00
|
|
|
|
2010-04-01 03:45:16 -04:00
|
|
|
opt.on("-D", "--[no-]debug",
|
|
|
|
"Displays lots on internal stuff.") do |value|
|
|
|
|
$DEBUG_RDOC = value
|
2008-01-07 01:56:46 -05:00
|
|
|
end
|
|
|
|
|
2010-04-01 03:45:16 -04:00
|
|
|
opt.on("--[no-]ignore-invalid",
|
|
|
|
"Ignore invalid options and continue.") do |value|
|
|
|
|
ignore_invalid = value
|
2008-01-07 01:56:46 -05:00
|
|
|
end
|
|
|
|
|
2010-04-01 03:45:16 -04:00
|
|
|
opt.on("--quiet", "-q",
|
|
|
|
"Don't show progress as we parse.") do |value|
|
|
|
|
@verbosity = 0
|
2008-01-07 01:56:46 -05:00
|
|
|
end
|
|
|
|
|
2010-04-01 03:45:16 -04:00
|
|
|
opt.on("--verbose", "-v",
|
|
|
|
"Display extra progress as we parse.") do |value|
|
|
|
|
@verbosity = 2
|
2003-12-01 02:12:49 -05:00
|
|
|
end
|
|
|
|
|
2008-01-07 01:56:46 -05:00
|
|
|
opt.separator nil
|
2003-12-01 02:12:49 -05:00
|
|
|
end
|
|
|
|
|
2008-07-17 20:46:16 -04:00
|
|
|
argv.insert(0, *ENV['RDOCOPT'].split) if ENV['RDOCOPT']
|
2010-04-20 23:10:03 -04:00
|
|
|
ignored = []
|
2008-07-17 20:46:16 -04:00
|
|
|
|
2010-04-01 03:45:16 -04:00
|
|
|
begin
|
|
|
|
opts.parse! argv
|
|
|
|
rescue OptionParser::InvalidArgument, OptionParser::InvalidOption => e
|
2010-04-20 23:10:03 -04:00
|
|
|
if ignore_invalid then
|
|
|
|
ignored << e.args.join(' ')
|
|
|
|
retry
|
2010-04-01 03:45:16 -04:00
|
|
|
else
|
|
|
|
$stderr.puts opts
|
|
|
|
$stderr.puts
|
|
|
|
$stderr.puts e
|
|
|
|
exit 1
|
|
|
|
end
|
|
|
|
end
|
2008-01-07 01:56:46 -05:00
|
|
|
|
2010-04-26 23:45:22 -04:00
|
|
|
if @pipe and not argv.empty? then
|
|
|
|
@pipe = false
|
|
|
|
ignored << '-p (with files)'
|
|
|
|
end
|
|
|
|
|
2010-04-22 22:32:20 -04:00
|
|
|
unless ignored.empty? or quiet then
|
2010-04-20 23:10:03 -04:00
|
|
|
$stderr.puts "invalid options: #{ignored.join ', '}"
|
|
|
|
$stderr.puts '(invalid options are ignored)'
|
|
|
|
end
|
|
|
|
|
2010-04-01 03:45:16 -04:00
|
|
|
@op_dir ||= 'doc'
|
2008-01-07 01:56:46 -05:00
|
|
|
@files = argv.dup
|
2003-12-01 02:12:49 -05:00
|
|
|
|
2008-01-07 01:56:46 -05:00
|
|
|
@rdoc_include << "." if @rdoc_include.empty?
|
|
|
|
|
|
|
|
if @exclude.empty? then
|
|
|
|
@exclude = nil
|
|
|
|
else
|
|
|
|
@exclude = Regexp.new(@exclude.join("|"))
|
|
|
|
end
|
|
|
|
|
|
|
|
check_files
|
|
|
|
|
|
|
|
# If no template was specified, use the default template for the output
|
|
|
|
# formatter
|
|
|
|
|
|
|
|
@template ||= @generator_name
|
2003-12-01 02:12:49 -05:00
|
|
|
end
|
2008-01-07 01:56:46 -05:00
|
|
|
|
|
|
|
##
|
|
|
|
# Set the title, but only if not already set. This means that a title set
|
|
|
|
# from the command line trumps one set in a source file
|
2003-12-01 02:12:49 -05:00
|
|
|
|
|
|
|
def title=(string)
|
|
|
|
@title ||= string
|
|
|
|
end
|
|
|
|
|
2008-07-21 14:35:14 -04:00
|
|
|
##
|
|
|
|
# Don't display progress as we process the files
|
|
|
|
|
|
|
|
def quiet
|
|
|
|
@verbosity.zero?
|
|
|
|
end
|
|
|
|
|
|
|
|
def quiet=(bool)
|
|
|
|
@verbosity = bool ? 0 : 1
|
|
|
|
end
|
|
|
|
|
2003-12-01 02:12:49 -05:00
|
|
|
private
|
|
|
|
|
2008-01-07 01:56:46 -05:00
|
|
|
##
|
2003-12-16 00:44:25 -05:00
|
|
|
# Set up an output generator for the format in @generator_name
|
2008-01-07 01:56:46 -05:00
|
|
|
|
|
|
|
def setup_generator
|
|
|
|
@generator = @generators[@generator_name]
|
|
|
|
|
|
|
|
unless @generator then
|
|
|
|
raise OptionParser::InvalidArgument, "Invalid output formatter"
|
2003-12-16 00:44:25 -05:00
|
|
|
end
|
2003-12-01 02:12:49 -05:00
|
|
|
end
|
2008-01-07 01:56:46 -05:00
|
|
|
|
|
|
|
##
|
2003-12-01 02:12:49 -05:00
|
|
|
# Check that the files on the command line exist
|
2008-01-07 01:56:46 -05:00
|
|
|
|
2003-12-01 02:12:49 -05:00
|
|
|
def check_files
|
|
|
|
@files.each do |f|
|
2010-04-01 03:45:16 -04:00
|
|
|
stat = File.stat f rescue next
|
2008-07-18 17:10:47 -04:00
|
|
|
raise RDoc::Error, "file '#{f}' not readable" unless stat.readable?
|
2003-12-01 02:12:49 -05:00
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
end
|
2008-01-07 01:56:46 -05:00
|
|
|
|