Skip to content
/ ruby-marc Public
forked from ruby-marc/ruby-marc

A Ruby library to parse, create and manage MARC records

License

Notifications You must be signed in to change notification settings

psla/ruby-marc

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

marc is a ruby library for reading and writing MAchine Readable Cataloging
(MARC). More information about MARC can be found at <http://www.loc.gov/marc>.

USAGE 

  require 'marc'

  # reading records from a batch file
  reader = MARC::Reader.new('marc.dat')
  for record in reader
    # print out field 245 subfield a
    puts record['245']['a']
  end

  # creating a record 
  record = MARC::Record.new()
  record.append(MARC::DataField.new('100', '0',  ' ', ['a', 'John Doe']))

  # writing a record
  writer = MARC::Writer.new('marc.dat')
  writer.write(record)
  writer.close()

  # writing a record as XML
  writer = MARC::XMLWriter.new('marc.xml')
  writer.write(record)
  writer.close()
  
  # encoding a record
  MARC::Writer.encode(record) # or record.to_marc

INSTALLATION

If you are looking at this file you may want to be able to install the code. 
First you'll need to test:

  rake test

then build the gem:

  rake package

and install the versioned gem:

  gem install pkg/marc-x.x.x.gem 

INSTALLATION USING BUNDLER
  
add to your Gemfile:

  gem 'marc', :git => 'https://github.com/ruby-marc/ruby-marc.git'

and run
 
  bundle

AUTHORS

Kevin Clarke <[email protected]>
Bill Dueber <[email protected]>
William Groppe <[email protected]>
Ross Singer <[email protected]>
Ed Summers <[email protected]>

Please send bugs, requests and comments to Code4Lib Mailing list (https://listserv.nd.edu/cgi-bin/wa?A0=CODE4LIB). 

About

A Ruby library to parse, create and manage MARC records

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Ruby 100.0%