def find_matching_path_for_extensions(path, basename, extensions)
      matches = []
      entries(path).each do |entry|
        next unless File.basename(entry).start_with?(basename)
        extname, value = match_path_extname(entry, extensions)
        if basename == entry.chomp(extname)
          filename = File.join(path, entry)
          if file?(filename)
            matches << [filename, value]
          end
        end
      end
      matches
    end
def find_matching_path_for_extensions(path, basename, extensions)
      matches = []
      entries(path).each do |entry|
        next unless File.basename(entry).start_with?(basename)
        extname, value = match_path_extname(entry, extensions)
        if basename == entry.chomp(extname)
          filename = File.join(path, entry)
          if file?(filename)
            matches << [filename, value]
          end
        end
      end
      matches
    end
Internal: Match paths in a directory against available extensions.

 path       - String directory
 basename   - String basename of target file
 extensions - Hash of String extnames to values

 Examples

     exts = { ".js" => "application/javascript" }
     find_matching_path_for_extensions("app/assets", "application", exts)
     # => ["app/assets/application.js", "application/javascript"]

 Returns an Array of [String path, Object value] matches.