Method: BibTeX.parse

Defined in:
lib/bibtex/utilities.rb

.parse(string, options = {}, &block) ⇒ Object

Parses the given string and returns a corresponding Bibliography object. Delegates to BibTeX.open if the string is a filename or URI.



30
31
32
33
34
35
36
37
38
# File 'lib/bibtex/utilities.rb', line 30

def parse(string, options = {}, &block)
  if string.length < 260 && File.exist?(string)
    Bibliography.open(string, options, &block)
  elsif string =~ %r{\A[a-z]+://}i
    Bibliography.open(string, options)
  else
    Bibliography.parse(string, options)
  end
end