forked from ruby-marc/ruby-marc
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathREADME
More file actions
65 lines (43 loc) · 1.41 KB
/
README
File metadata and controls
65 lines (43 loc) · 1.41 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
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 <ksclarke@gmail.com>
Bill Dueber <bill@dueber.com>
William Groppe <will.groppe@gmail.com>
Ross Singer <rossfsinger@gmail.com>
Ed Summers <ehs@pobox.com>
Please send bugs, requests and comments to Code4Lib Mailing list (https://listserv.nd.edu/cgi-bin/wa?A0=CODE4LIB).