Class: BibtexImport

Inherits:
Object
  • Object
show all
Defined in:
lib/bibtex_import.rb

Overview

BibtexImport - a library to handle tasks related to importing a BibTeX bibliography. It depends on both the bibtex-ruby gem and Source::Bibtex

Instance Method Summary collapse

Instance Method Details

#bibtex_biblio_2_tw(input_bibliography) ⇒ Array<Source::Bibtex>

Note:

Not yet implemented!

Move the BibTeX bibliography into TaxonWorks records



22
23
24
25
# File 'lib/bibtex_import.rb', line 22

def bibtex_biblio_2_tw(input_bibliography)
  # input BibTeX-ruby bibliography (hash)
  # output TaxonWorks source records (hash?, array?)
end

#bibtex_read(input_file) ⇒ BibTeX::Bibliography

Note:

Current version opens a fixed file (“spec/files/Taenionema.bib”) for testing purposes. eventually input_file name will be passed in.

Open a BibTeX file & read in a bibliography



10
11
12
13
14
15
16
# File 'lib/bibtex_import.rb', line 10

def bibtex_read (input_file)

#TODO get input filename from parameter input_file
  input_file = Rails.root + 'spec/files/Taenionema.bib' # will eventually get this from the user
  BibTeX.open(input_file)
# this returns BibTex-ruby bibliography hash
end

#create_tw_source_from_bibtex(bibtex_entry) ⇒ Source::Bibtex

Note:

Note yet implemented

Create a Source::Bibtex object from a BibTeX::Entry object



40
41
42
# File 'lib/bibtex_import.rb', line 40

def create_tw_source_from_bibtex(bibtex_entry)
  #return Source::Bibtex
end

#save_bibtex_entry_as_tw(bibtex_entry, tw_entry) ⇒ Boolean

Note:

Not yet implemented

Save a BibTeX::Entry object as a Source::Bibtex record



32
33
34
# File 'lib/bibtex_import.rb', line 32

def save_bibtex_entry_as_tw(bibtex_entry, tw_entry)
  # Save a TaxonWorks record
end