Module: BibTeX

Defined in:
lib/bibtex.rb,
lib/bibtex/entry.rb,
lib/bibtex/error.rb,
lib/bibtex/lexer.rb,
lib/bibtex/parser.rb,
lib/bibtex/version.rb,
lib/bibtex/elements.rb,
lib/bibtex/utilities.rb,
lib/bibtex/extensions.rb,
lib/bibtex/bibliography.rb

Overview

– BibTeX-Ruby Copyright © 2010 Sylvester Keil <sylvester.keil.or.at>

This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program. If not, see <www.gnu.org/licenses/>. ++

Defined Under Namespace

Modules: Extensions, Version Classes: Bibliography, Comment, Element, Entry, Error, Lexer, MetaComment, Parser, Preamble, String

Constant Summary collapse

Log =

An instance of the Ruby core class Logger. Used for logging by BibTeX-Ruby.

Logger.new(STDERR)

Class Method Summary collapse

Class Method Details

.logObject



47
# File 'lib/bibtex.rb', line 47

def self.log; BibTeX::Log end

.open(file, options = {}) ⇒ Object

Opens a BibTeX file and returns a corresponding Bibliography object.



23
24
25
# File 'lib/bibtex/utilities.rb', line 23

def open(file, options={})
  Bibliography.open(file, options)
end

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

Parses the given string and returns a corresponding Bibliography object.



28
29
30
# File 'lib/bibtex/utilities.rb', line 28

def parse(string, options={})
  BibTeX::Parser.new(options).parse(string)
end

.valid?(file) ⇒ Boolean

Returns true if the given file is a valid BibTeX bibliography.

Returns:

  • (Boolean)


33
34
35
# File 'lib/bibtex/utilities.rb', line 33

def valid?(file)
  Bibliography.open(file).valid?
end