Created
April 25, 2011 07:01
-
-
Save burtlo/940246 to your computer and use it in GitHub Desktop.
yardoc issue 300 workaround
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Parses commandline arguments | |
# @param [Array<String>] args the list of arguments | |
# @return [Boolean] whether or not arguments are valid | |
# @since 0.5.6 | |
def parse_arguments(*args) | |
options[:markup] = nil # reset markup | |
# Hack: parse out --no-yardopts, --no-document before parsing files | |
['document', 'yardopts'].each do |file| | |
without, with = args.index("--no-#{file}") || -2, args.index("--#{file}") || -1 | |
send("use_#{file}_file=", false) if without > with | |
end | |
# Parse files and then command line arguments | |
optparse(*support_rdoc_document_file!) if use_document_file | |
optparse(*yardopts) if use_yardopts_file | |
optparse(*args) | |
# Last minute modifications | |
self.files = ['lib/**/*.rb', 'ext/**/*.c'] if self.files.empty? | |
self.files.delete_if {|x| x =~ /\A\s*\Z/ } # remove empty ones | |
options[:readme] ||= Dir.glob('README*').first | |
if options[:onefile] | |
options[:files] << options[:readme] if options[:readme] | |
options[:readme] = Dir.glob(files.first).first | |
end | |
Tags::Library.visible_tags -= hidden_tags | |
add_visibility_verifier | |
verified_markup_result = verify_markup_options | |
if generate && !verified_markup_result | |
false | |
else | |
true | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Line 30 will store the result of the
verify_markup_options
and then use that in the comparison below, instead of failing fast when thegenerate
option returns false (when the -n option is used).