Re: Ruby in libraries

From: Ed Summers <ehs_at_nyob>
Date: Fri, 2 Dec 2005 09:05:28 -0600
To: CODE4LIB_at_listserv.nd.edu
On 12/2/05, Bas Peters <mail_at_bpeters.com> wrote:
>but I was just wondering how difficult it would
> be to create a MARC parser in Ruby. Is there any interest in such a
> library for Ruby?

I actually created a MARC parser in Ruby [1] a month or so ago which
is available on RubyForge [2]. I'm definitely open to ways of
improving it, or developers who want to help develop it.

Since it's available on rubyforge, if you have gem installed you can.

    gem install marc

Once installed you can do stuff like:

    require 'marc'
    reader = MARC::Reader.new('batch.dat')
    for record in reader
        puts record['245']
    end

The rdoc [3] is also available which hopefully shows common usage. One
thing that I haven't implemented yet is MARC-8 -> UTF-8 conversion for
going to XML...but that's in the works. I really like your marc4j
package by the way.

//Ed

[1] http://www.textualize.com/ruby_marc
[2] http://rubyforge.org/projects/marc/
[3] http://www.textualize.com/rdoc/ruby-marc/
Received on Fri Dec 02 2005 - 10:09:12 EST