A few Ruby MARC announcements

11 views
Skip to first unread message

Ross Singer

unread,
Sep 23, 2009, 10:51:32 PM9/23/09
to Code for Libraries, umlaut-...@rubyforge.org, blacklight-...@googlegroups.com, lf-ge...@lists.oregonstate.edu
Hi everybody,

Apologies for the crossposting.

I wanted to let people know that Ruby MARC 0.3.0 was just released as
a gem. This version addresses the biggest complaint about Ruby MARC,
which was the fact that it could only parse MARCXML with REXML, Ruby's
native XML parser (which, if you've used it, you hate it).

Now you can use Nokogiri (http://nokogiri.rubyforge.org/) or, if
you're using JRuby, jrexml instead of REXML, if you want.

This release *shouldn't* break anything.

The rubyforge project is here:
http://rubyforge.org/projects/marc
The rdocs are here:
http://marc.rubyforge.org/
The source is here:
http://marc.rubyforge.org/svn/

To install:
sudo gem install marc

While I'm making MARC and Ruby related announcements, I'd like to
point out a project I released a couple of weeks ago that sits on top
of Ruby MARC, called enhanced-marc. It's basically a domain specific
language for working with the MARC fixed fields and providing a set of
objects and methods to more easily parse what the record is
describing.

For example:

require 'enhanced_marc'

reader = MARC::Reader.new('marc.dat')

records = []

reader.each do | record |
records << record
end

>> records[0].class
=> MARC::BookRecord

>> records[0].is_conference?
=> false

>> records[0].is_manuscript?
=> false

# Send a boolean true if you want human readable forms, rather than
MARC codes.
>> records[0].literary_form(true)
=> "Non-fiction"

>> records[0].nature_of_contents(true)
=> ["Bibliography", "Catalog"]

>> records[1].class
=> MARC::SoundRecord

>> records[1].composition_form(true)
=> "Jazz"

>> records[2].class
=> MARC::MapRecord

>> records[2].projection(true)
=> ["Cylindrical", "Mercator"]

>> records[2].relief(true)
=> ["Color"]

The enhanced-marc project is here:
http://github.com/rsinger/enhanced-marc

To install it:
gem sources -a http://gems.github.com
sudo gem install rsinger-enhanced_marc

Let me know if you have any problems or suggestions with either of these.

Thanks!
-Ross.

Bess Sadler

unread,
Sep 24, 2009, 10:00:51 AM9/24/09
to blacklight-...@googlegroups.com
Ross, you are what open source is all about. Thank you so much! I
can't wait to play with these.

Bess

> --~--~---------~--~----~------------~-------~--~----~
> You received this message because you are subscribed to the Google
> Groups "Blacklight Development" group.
> To post to this group, send email to blacklight-...@googlegroups.com
> To unsubscribe from this group, send email to blacklight-develo...@googlegroups.com
> For more options, visit this group at http://groups.google.com/group/blacklight-development?hl=en
> -~----------~----~----~----~------~----~------~--~---
>

Reply all
Reply to author
Forward
0 new messages