traject_umich_format 0.1.2 → 0.1.3

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 6d411084705b48267f928fb3b54469048cebacc8
4
- data.tar.gz: c795fbc6fd5b11e7a7a27dd295df10fb7cf7e13b
3
+ metadata.gz: b652f947db6ed90de3a4b46c4671bc1981a0f304
4
+ data.tar.gz: ea65ea424d8b7c5d2c9fbed68b88cd34e2be2290
5
5
  SHA512:
6
- metadata.gz: 5e093846baa19ebbc61532e41a049d774ce08432bac0ca510a17c1133ab425716f870a4bf4b4f5e40a8b0f81875b085439b1638ed3b3272beb87e86cd63e3333
7
- data.tar.gz: ea0abc902497b4c46c9f403ce865752b3333eadf7712ca0b59aab0205c8cba3e659805c18750a4431e0e2d2488b9306598f8015b5b6f7bcc0188635f65054bd8
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 :codes, :bib_format, :record
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
 
@@ -1,5 +1,5 @@
1
1
  module Traject
2
2
  class UMichFormat
3
- VERSION = "0.1.2"
3
+ VERSION = "0.1.3"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: traject_umich_format
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.2
4
+ version: 0.1.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Bill Dueber