inukshuk/bibtex-ruby — Issue #30: BibTex::Entry.to_citeproc unable to be processed by citeproc-ruby
Author: amattsmith
Created: 2011-10-14 13:38:55+00:00
State: open

I'm trying to use the bibtex-ruby and citeproc-ruby libraries together and I am running into an issue. I wasn't sure if this should be filed under bibtex-ruby or citeproc-ruby. The citeproc format generated from bibtex-ruby is unable to be processed by citeproc-ruby. I've tried different ways, but get this error:

"undefined method `map' for Sam and Thomas Ruby:CiteProc::Name"

I'm creating a new BibTex::Entry from a hash similar to the example in the readme and then trying to process it to generate a citation. It doesn't seem to like the :author format. See below for irb session:

Loading development environment (Rails 3.1.0)
ruby-1.9.2-p290 :001 > require 'bibtex' => true
ruby-1.9.2-p290 :002 > require 'citeproc'
=> true
ruby-1.9.2-p290 :003 > bib = BibTeX::Entry.new({:type => :book, :key => :rails, :author => 'Ruby, Sam and Thomas, Dave, and Hansson, David Heinemeier', :title => 'Agile Web Development with Rails', :year => '2009'})
=> #
ruby-1.9.2-p290 :004 > bib.to_citeproc => {"id"=>"rails", "type"=>"book", "author"=>"Ruby, Sam and Thomas, Dave, and Hansson, David Heinemeier", "title"=>"Agile Web Development with Rails", "issued"=>{"date-parts"=>[[2009]]}}
ruby-1.9.2-p290 :005 > CiteProc.process(bib.to_citeproc, :style => :mla, :mode => :citation)ERROR CiteProc : failed to process item {"id"=>rails, "type"=>book, "author"=>Sam and Thomas Ruby, "title"=>Agile Web Development with Rails, "issued"=>{"date-parts"=>[[2009]], "literal"=>nil}}: undefined method `map' for Sam and Thomas Ruby:CiteProc::Name
=> [""]

Any ideas?

Thanks,

Matt