lib/yard/templates/template.rb
# Searches for the nth file (where n = +index+) identified
# by basename in the template's path and any mixed in template paths.
#
# @param [String] basename the filename to search for
# @param [Fixnum] index the nth existing file to return
# @return [String] the full path of the nth file on disk with
#   filename +basename+ in one of the template paths
Searches for the nth file (where n = +index+) identified
by basename in the template's path and any mixed in template paths.
Searches for the nth file ( where n = + index + ) identified by basename in the template ' s path and any mixed in template paths .
def find_nth_file(basename, index = 1)
          n = 1
          full_paths.each do |path|
            file = File.join(path, basename)
            if File.file?(file)
              return file if index == n
              n += 1
            end
          end
          nil
        end
def find_nth_file ( basename , index = 1 ) n = 1 full_paths . each do | path | file = File . join ( path , basename ) if File . file? ( file ) return file if index == n n += 1 end end nil end
Searches for the nth file (where n = +index+) identified
by basename in the template's path and any mixed in template paths.
Searches for the nth file ( where n = + index + ) identified by basename in the template ' s path and any mixed in template paths .
the full path of the nth file on disk with filename +basename+ in one of the template paths
the full path of the nth file on disk with filename + basename + in one of the template paths
String
basename
index
index the nth existing file to return
index the nth existing file to return