traject_umich_format 0.4.0 → 0.4.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/ChangeLog.md +4 -0
- data/lib/traject/umich_format/bib_types.rb +17 -0
- data/lib/traject/umich_format/version.rb +1 -1
- data/spec/audio_spec.rb +9 -0
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 843ea7355ea638cd27d97a0f6e7866d9fc3316e7
|
4
|
+
data.tar.gz: aec0c15b33f03b857eba20f7ee4a8a8d702dc1c4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1a5fe3dd67c9e3b981000142f8809d1328445c61f6dd86d1f6aafb96000fed7b3073a1ce254dd080c95d980dc9c637a2cee36323186d465ff62bef480e39686b
|
7
|
+
data.tar.gz: 6e00c3e3fb950fd2ab6ac36f892f28b54106e27400cdec825d5d7d83670c753c4542d67da2845c160f0d97aa3fa4aa042e1aedd76c436b791f3ffc23e1204e7a
|
data/ChangeLog.md
CHANGED
@@ -163,6 +163,14 @@ class Traject::UMichFormat::BibTypes
|
|
163
163
|
end
|
164
164
|
end
|
165
165
|
|
166
|
+
# RC: 007/00 is 's' and 007/01 is 'd' and 007/06 is 'g'
|
167
|
+
@record.fields('007').map{|f| f.value}.each do |f|
|
168
|
+
if (f[0] == 's') && (f[1] == 'd') && (f[6] == 'g')
|
169
|
+
types << 'RC'
|
170
|
+
break
|
171
|
+
end
|
172
|
+
end
|
173
|
+
|
166
174
|
f8524.each do |f|
|
167
175
|
if (f['b'].upcase == 'MUSIC') && (f['j'] =~ /\ACD/i)
|
168
176
|
types << 'RC'
|
@@ -354,6 +362,7 @@ class Traject::UMichFormat::BibTypes
|
|
354
362
|
# TYP CR CDROM 852## j MATCH cdrom*
|
355
363
|
# TYP CR CDROM 852## j MATCH cd-rom*
|
356
364
|
# TYP CS Software 852## j MATCH software*
|
365
|
+
# CR: 007/00 is 'c' and 007/01 is 'o' and 007/04 is 'g'
|
357
366
|
|
358
367
|
def software_types
|
359
368
|
types = []
|
@@ -365,6 +374,14 @@ class Traject::UMichFormat::BibTypes
|
|
365
374
|
types << 'CS'
|
366
375
|
end
|
367
376
|
end
|
377
|
+
|
378
|
+
# CR: 007/00 is 'c' and 007/01 is 'o' and 007/04 is 'g'
|
379
|
+
@record.fields('007').map{|f| f.value}.each do |f|
|
380
|
+
if (f[0] == 'c') && (f[1] == 'o') && (f[4] == 'g')
|
381
|
+
types << 'CR'
|
382
|
+
end
|
383
|
+
end
|
384
|
+
|
368
385
|
types.uniq!
|
369
386
|
return types
|
370
387
|
end
|
data/spec/audio_spec.rb
CHANGED
@@ -52,6 +52,15 @@ describe 'audio' do
|
|
52
52
|
assert @umf.types.include?("RL"), "types include 'RL'"
|
53
53
|
end
|
54
54
|
|
55
|
+
it "identifies an audio CD from the 007 field" do
|
56
|
+
@record = MARC::Reader.new(support_file_path 'audio_cd_007.mrc').first
|
57
|
+
@umf = Traject::UMichFormat.new(@record)
|
58
|
+
|
59
|
+
puts 'types from audio_cd_007.mrc file: ' + @umf.types.join(',')
|
60
|
+
#assert_equal 'MU', @umf.bib_format
|
61
|
+
assert @umf.types.include?("RC"), "types include 'RC'"
|
62
|
+
end
|
63
|
+
|
55
64
|
end
|
56
65
|
|
57
66
|
describe "macros" do
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: traject_umich_format
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.4.
|
4
|
+
version: 0.4.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Bill Dueber
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-
|
11
|
+
date: 2017-12-01 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -107,7 +107,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
107
107
|
version: '0'
|
108
108
|
requirements: []
|
109
109
|
rubyforge_project:
|
110
|
-
rubygems_version: 2.6.
|
110
|
+
rubygems_version: 2.6.13
|
111
111
|
signing_key:
|
112
112
|
specification_version: 4
|
113
113
|
summary: Extract the format and type from a MARC record, the UMich way
|