marc 1.1.0 → 1.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Changes +3 -0
- data/lib/marc/version.rb +1 -1
- data/lib/marc/xmlwriter.rb +3 -2
- data/test/tc_xml.rb +7 -2
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 53c1e338a00e1dbd7c09ed14edc916edd1211abe0edbabcf757b8b00a5aa209c
|
4
|
+
data.tar.gz: 80b4c48c2fc95887216194d264583302bacae6c606616a087c888668ba2bfb68
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b6dd17fa76ff33ef0da68946d29ec2079c495423559c47391cabf80b59393f0d481ef6b1467b839465d3225c1a52aec2d4945994986e8e956eccfc2ea73ada5b
|
7
|
+
data.tar.gz: a745e41aa2cbe87c70f9a2cbfe0de0dd12f47c167f867127353d86ff771ada14327dbce1ec461fcb81cacb3cf3f60f821cdb4c0087213f37a0ef42dc7ade78e8
|
data/Changes
CHANGED
data/lib/marc/version.rb
CHANGED
data/lib/marc/xmlwriter.rb
CHANGED
@@ -60,7 +60,8 @@ module MARC
|
|
60
60
|
# and returns a REXML::Document for the XML serialization.
|
61
61
|
|
62
62
|
def self.encode(record, opts={})
|
63
|
-
singleChar = Regexp.new('[\
|
63
|
+
singleChar = Regexp.new('[\da-z ]{1}')
|
64
|
+
subfieldChar = Regexp.new('[\dA-Za-z!"#$%&\'()*+,-./:;<=>?{}_^`~\[\]\\\]{1}')
|
64
65
|
ctrlFieldTag = Regexp.new('00[1-9A-Za-z]{1}')
|
65
66
|
|
66
67
|
# Right now, this writer handles input from the strict and
|
@@ -122,7 +123,7 @@ module MARC
|
|
122
123
|
|
123
124
|
# If marc is leniently parsed, we may have some dirty data; using
|
124
125
|
# the blank subfield code should help us locate these later to fix
|
125
|
-
if (subfield.code.match(
|
126
|
+
if (subfield.code.match(subfieldChar) == nil)
|
126
127
|
subfield.code = ' '
|
127
128
|
end
|
128
129
|
|
data/test/tc_xml.rb
CHANGED
@@ -140,11 +140,16 @@ class XMLTest < Test::Unit::TestCase
|
|
140
140
|
record1 = MARC::Record.new
|
141
141
|
record1.leader = '00925njm 22002777a 4500'
|
142
142
|
record1.append MARC::ControlField.new('007', 'sdubumennmplu')
|
143
|
-
record1.append MARC::DataField.new('245', '0', '4',
|
143
|
+
record1.append MARC::DataField.new('245', '0', '4',
|
144
144
|
['a', 'The Great Ray Charles'], ['h', '[sound recording].'])
|
145
|
+
record1.append MARC::DataField.new('998', ' ', ' ',
|
146
|
+
['^', 'Valid local subfield'])
|
147
|
+
|
148
|
+
# MARC::XMLWriter mutates records
|
149
|
+
dup_record = MARC::Record.new_from_hash(record1.to_hash)
|
145
150
|
|
146
151
|
writer = MARC::XMLWriter.new('test/test.xml', :stylesheet => 'style.xsl')
|
147
|
-
writer.write(
|
152
|
+
writer.write(dup_record)
|
148
153
|
writer.close
|
149
154
|
|
150
155
|
xml = File.read('test/test.xml')
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: marc
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.1.
|
4
|
+
version: 1.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Kevin Clarke
|
@@ -13,7 +13,7 @@ authors:
|
|
13
13
|
autorequire: marc
|
14
14
|
bindir: bin
|
15
15
|
cert_chain: []
|
16
|
-
date: 2021-06-
|
16
|
+
date: 2021-06-07 00:00:00.000000000 Z
|
17
17
|
dependencies:
|
18
18
|
- !ruby/object:Gem::Dependency
|
19
19
|
name: scrub_rb
|