traject_umich_format 0.1.2 → 0.1.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/ChangeLog.md +5 -0
- data/lib/traject/umich_format/bib_types.rb +34 -21
- data/lib/traject/umich_format/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b652f947db6ed90de3a4b46c4671bc1981a0f304
|
4
|
+
data.tar.gz: ea65ea424d8b7c5d2c9fbed68b88cd34e2be2290
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 64606c11bc932cdfa19fba7eaf02f57b2b115bdab69e4810599020e207a4fee00f0e1902d05c9abbc25e42b7f2673e11ba35bb87f8afccddb1e97f48838ec05a
|
7
|
+
data.tar.gz: 8b33bd361e47ac93613ca0e2878fa0566e3c22ac5c0b2fcb458036baa06867371a18ff8932b787c9c5ada5a4d57f5c5c9680a925f0abeadb20052adf5d9e83f0
|
data/ChangeLog.md
CHANGED
@@ -1,3 +1,8 @@
|
|
1
|
+
### 0.1.3 / 2013-10-22
|
2
|
+
|
3
|
+
* Call #uniq! before exiting from each indiviual type checker to allow easier calling of just the ones you want.
|
4
|
+
* Refact type#codes into its own method instead of doing all the work on initialization
|
5
|
+
|
1
6
|
### 0.1.2 / 2013-10-22
|
2
7
|
|
3
8
|
* Fix types logic so tests against different characters in the 007 or 006 must come from the
|
@@ -9,7 +9,7 @@ require 'traject/umich_format/xv6xx'
|
|
9
9
|
|
10
10
|
class Traject::UMichFormat::BibTypes
|
11
11
|
|
12
|
-
attr_reader :
|
12
|
+
attr_reader :bib_format, :record
|
13
13
|
|
14
14
|
def initialize(bib_format, record)
|
15
15
|
@bib_format = bib_format
|
@@ -19,27 +19,33 @@ class Traject::UMichFormat::BibTypes
|
|
19
19
|
|
20
20
|
# Need these a lot -- the sub x and v from any 6XX field
|
21
21
|
@xv6XX = Traject::UMichFormat::XV6XX.new(@record)
|
22
|
-
|
23
|
-
@codes = []
|
24
|
-
@codes.concat self.video_types
|
25
|
-
@codes.concat self.audio_types
|
26
|
-
@codes.concat self.microform_types
|
27
|
-
@codes.concat self.musical_score_types
|
28
|
-
@codes.concat self.map_types
|
29
|
-
@codes.concat self.serial_types
|
30
|
-
@codes.concat self.mixed_types
|
31
|
-
@codes.concat self.software_types
|
32
|
-
@codes.concat self.statistics_types
|
33
|
-
@codes.concat self.conference_types
|
34
|
-
@codes.concat self.biography_types
|
35
|
-
@codes.concat self.reference_types
|
36
|
-
@codes.concat self.pp_types
|
37
|
-
@codes.concat self.videogame_types
|
38
|
-
|
39
|
-
@codes.uniq!
|
40
|
-
@codes.compact!
|
41
|
-
|
42
22
|
end
|
23
|
+
|
24
|
+
|
25
|
+
def codes
|
26
|
+
codes = []
|
27
|
+
codes.concat self.video_types
|
28
|
+
codes.concat self.audio_types
|
29
|
+
codes.concat self.microform_types
|
30
|
+
codes.concat self.musical_score_types
|
31
|
+
codes.concat self.map_types
|
32
|
+
codes.concat self.serial_types
|
33
|
+
codes.concat self.mixed_types
|
34
|
+
codes.concat self.software_types
|
35
|
+
codes.concat self.statistics_types
|
36
|
+
codes.concat self.conference_types
|
37
|
+
codes.concat self.biography_types
|
38
|
+
codes.concat self.reference_types
|
39
|
+
codes.concat self.pp_types
|
40
|
+
codes.concat self.videogame_types
|
41
|
+
|
42
|
+
codes.uniq!
|
43
|
+
codes.compact!
|
44
|
+
|
45
|
+
codes
|
46
|
+
end
|
47
|
+
|
48
|
+
|
43
49
|
|
44
50
|
# Provide memoized values for on-the-fly created MarcExtractor
|
45
51
|
# objects
|
@@ -100,6 +106,7 @@ class Traject::UMichFormat::BibTypes
|
|
100
106
|
types << 'VL' if self['007[0]'].include?('m')
|
101
107
|
types << 'VL' if (self.bib_format == 'VM') && self['008[33]'].include?('m')
|
102
108
|
|
109
|
+
types.uniq!
|
103
110
|
return types
|
104
111
|
end
|
105
112
|
|
@@ -192,6 +199,7 @@ class Traject::UMichFormat::BibTypes
|
|
192
199
|
# RU
|
193
200
|
types << 'RU' if %w[i j].include?(ldr6) && (bib_format == 'MU')
|
194
201
|
|
202
|
+
types.uniq!
|
195
203
|
return types
|
196
204
|
end
|
197
205
|
|
@@ -287,6 +295,8 @@ class Traject::UMichFormat::BibTypes
|
|
287
295
|
types << 'SX' if %w[b s].include?(record.leader[7])
|
288
296
|
types.concat journal_types
|
289
297
|
types.concat newspaper_types
|
298
|
+
types.uniq!
|
299
|
+
return types
|
290
300
|
end
|
291
301
|
|
292
302
|
|
@@ -313,6 +323,7 @@ class Traject::UMichFormat::BibTypes
|
|
313
323
|
types << 'AJ'
|
314
324
|
end
|
315
325
|
|
326
|
+
types.uniq!
|
316
327
|
return types
|
317
328
|
end
|
318
329
|
|
@@ -353,6 +364,7 @@ class Traject::UMichFormat::BibTypes
|
|
353
364
|
types << 'CS'
|
354
365
|
end
|
355
366
|
end
|
367
|
+
types.uniq!
|
356
368
|
return types
|
357
369
|
end
|
358
370
|
|
@@ -463,6 +475,7 @@ class Traject::UMichFormat::BibTypes
|
|
463
475
|
types << 'DI' if @xv6XX.match? /dictionaries/i
|
464
476
|
types << 'DR' if @xv6XX.match? /directories/i
|
465
477
|
|
478
|
+
types.uniq!
|
466
479
|
return types
|
467
480
|
end
|
468
481
|
|