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.



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

def parse(string, options = {}, &block)
  if File.exists?(string) || string =~ /^[a-z]+:\/\//i
    Bibliography.open(string, options, &block)
  else
    Bibliography.parse(string, options)
  end
end