citeproc-rb gem

I’ve registered and been approved for a citeproc-rb project on RubyForge.
This is to host releases of the Ruby gem (the packaging standard for Ruby).
Once citeproc-rb matures a little it should be possible to do:

gem install citeproc-rb

I’m hoping to have a very early version over the next week or so - I’ll
announce any releases through this list.

Regards,

Liam.

Excellent!

Bruce

Bruce D’Arcus wrote:> On Mon, Jun 30, 2008 at 6:19 PM, Liam Magee <@Liam_Magee> wrote:

I’ve registered and been approved for a citeproc-rb project on RubyForge.
This is to host releases of the Ruby gem (the packaging standard for Ruby).
Once citeproc-rb matures a little it should be possible to do:

gem install citeproc-rb

I’m hoping to have a very early version over the next week or so - I’ll
announce any releases through this list.

Excellent!

Agreed. Many thanks!
–SET

I’ve released a gem of citeproc-rb via RubyForge - not sure when or if it’ll
turn up in the gem lists.

This is at best an early alpha release - it supports the core Zotero styles
with the test data Bruce sent through. What is missing are a substantive set
of test cases, and I think some refactoring of the input/output handling.
I’m hoping to dedicate some time over the next few weeks to work on the test
cases more systematically.

Regards,

Liam.

I’ve released a gem of citeproc-rb via RubyForge - not sure when or if it’ll
turn up in the gem lists.

Works for me!

Now what? The README doesn’t seem to apply to the gem install.

This is at best an early alpha release - it supports the core Zotero styles
with the test data Bruce sent through. What is missing are a substantive set
of test cases, and I think some refactoring of the input/output handling.
I’m hoping to dedicate some time over the next few weeks to work on the test
cases more systematically.

Sounds good.

Bruce

You should hopefully be able to run the example, e.g:

ruby examples/citeproc_driver.rb --input test/fixtures/csl_test_data.json
–content-type json --csl data/styles/ama.csl

Or used as a library, something like:

require ‘citeproc’

csl = Citeproc::CslParser.new([file or URL])
locale = Citeproc::CslParser.new([file or URL])
input_filter = CSL::CslInputFilter.new
input_filter.parse({some JSON citations})
processor = Citeproc::CslProcessor.new
formatter = Citeproc::XhtmlFormatter.new
nodes = processor.process_bibliography(input_filter, csl.style,
locale.style)
results = formatter.format(nodes)
puts results

But yes, more documentation and some simplification of the API is needed
too…

Regards,

Liam.2008/7/4 Bruce D’Arcus <@Bruce_D_Arcus1>:

I’m not familiar with ruby and its package management, and I tried to
install citeproc-rb using gem. When I run the examples as suggested in
the README I get the same error I get when I try it from the svn repo:

./examples/…/lib/citeproc/csl_parser.rb:25: undefined method gem' for main:Object (NoMethodError) from ./examples/../lib/citeproc.rb:18:inrequire’
from ./examples/…/lib/citeproc.rb:18
from examples/citeproc_driver.rb:19:in `require’
from examples/citeproc_driver.rb:19

this is the output of gem query --local:

*** LOCAL GEMS ***

builder (2.0.0)
Builders for MarkUp.

citeproc-rb (0.0.1)
Citeproc-rb is a Ruby port of the .

sources (0.0.1)
This package provides download sources for remote gem installation

Could you please give me a hint on what I’m doing wrong? Unfortunately
I have no time to start digging into ruby right now.

TIA.

Andrea

It seems gems isn’t loaded, but the csl_parser.rb file then requires
the builder gem. I believe. If you add this it should work (it does
for me):

require ‘rubygems’

Bruce

Note: I just checked in this change. Hope that’s OK Liam.

Bruce

Ah, ok, I missed that, thanks.

Regards,

Liam.2008/7/5 Bruce D’Arcus <@Bruce_D_Arcus1>: