Method: YARD::Templates::Template::ClassMethods#find_nth_file
- Defined in:
- lib/yard/templates/template.rb
#find_nth_file(basename, index = 1) ⇒ String
Searches for the nth file (where n = index
) identified by basename in the template’s path and any mixed in template paths.
109 110 111 112 113 114 115 116 117 118 119 120 |
# File 'lib/yard/templates/template.rb', line 109 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 |