module AsciidoctorBibtex::PathUtils

Public Class Methods

find_bibfile(dir) click to toggle source

Locate a bibtex file to read in given dir

# File lib/asciidoctor-bibtex/path_utils.rb, line 10
def self.find_bibfile(dir)
  candidates = Dir.glob("#{dir}/*.bib")
  if candidates.empty?
    return ''
  else
    return candidates.first
  end
rescue StandardError # catch all errors, and return empty string
  ''
end