lib/yard/parser/source_parser.rb in yard-0.8.2.1 vs lib/yard/parser/source_parser.rb in yard-0.8.3
- old
+ new
@@ -98,11 +98,11 @@
else Regexp.new(path.to_s, Regexp::IGNORECASE)
end
end
files = [paths].flatten.
map {|p| File.directory?(p) ? "#{p}/**/*.{rb,c}" : p }.
- map {|p| p.include?("*") ? Dir[p] : p }.flatten.
+ map {|p| p.include?("*") ? Dir[p].sort_by {|f| f.length } : p }.flatten.
reject {|p| !File.file?(p) || excluded.any? {|re| p =~ re } }
log.enter_level(level) do
parse_in_order(*files.uniq)
end
@@ -358,10 +358,9 @@
#
# @param [Array<String>] files a list of files to queue for parsing
# @return [void]
def parse_in_order(*files)
global_state = OpenStruct.new
- files = files.sort_by {|x| x.length if x }
before_parse_list_callbacks.each do |cb|
return if cb.call(files, global_state) == false
end