traject_umich_format 0.1.1 → 0.1.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 2098b674ce8c54bef03577f03f3e743954d451fd
4
- data.tar.gz: e65bc13f89da6b829fd646d212e52c480f1ef6b2
3
+ metadata.gz: 6d411084705b48267f928fb3b54469048cebacc8
4
+ data.tar.gz: c795fbc6fd5b11e7a7a27dd295df10fb7cf7e13b
5
5
  SHA512:
6
- metadata.gz: a3ad30b3a10e55909ade4235adb09b3de8438ec4ce74bb7bfae7f9f68a214e9a944a92b6a3310a9a12f1c7107eab193ad4ab5eecbe6da1facc5b3d9461e15e1f
7
- data.tar.gz: c4f6cff6555d07ae0cc0cf8073e57dbe73fdb9af98d526e0aa190ba152baf322879e9a0f7adac725d1a1ea43cd2f6252459580e94a40f67bc14f8fd5bd058238
6
+ metadata.gz: 5e093846baa19ebbc61532e41a049d774ce08432bac0ca510a17c1133ab425716f870a4bf4b4f5e40a8b0f81875b085439b1638ed3b3272beb87e86cd63e3333
7
+ data.tar.gz: ea0abc902497b4c46c9f403ce865752b3333eadf7712ca0b59aab0205c8cba3e659805c18750a4431e0e2d2488b9306598f8015b5b6f7bcc0188635f65054bd8
data/ChangeLog.md CHANGED
@@ -1,3 +1,9 @@
1
+ ### 0.1.2 / 2013-10-22
2
+
3
+ * Fix types logic so tests against different characters in the 007 or 006 must come from the
4
+ same field (e.g., not 006[1]='s' in one 006, and 006[2]='t' in another 006). Affects VD, VH,
5
+ CF, and RC types.
6
+
1
7
  ### 0.1.1 / 2013-10-14
2
8
 
3
9
  * Fixed README to have correct load path (traject/umich_format, not traject_umich_format)
@@ -84,22 +84,18 @@ class Traject::UMichFormat::BibTypes
84
84
  types << 'VB' if self['007[0-5]'].grep(/v...s/i).size > 0
85
85
  types << 'VB' if self['852j'].grep(/\A(?:bd-rom|video-b)/i).size > 0
86
86
 
87
+ @record.fields('007').map{|f| f.value}.each do |f|
88
+ if (f[0] == 'v') || self['008[33]'].include?('v')
89
+ types << 'VD' if f[4] == 'v'
90
+ types << 'VH' if f[4] == 'b'
91
+ end
92
+ end
87
93
 
88
- types << 'VD' if self['007[4]'].include?('v') &&
89
- (
90
- self['007[0]'].include?('v') ||
91
- self['008[33]'].include?('v')
92
- )
93
94
 
94
95
  types << 'VD' if self['538a'].grep(/\Advd/i).size > 0
95
96
 
96
97
  types << 'VH' if self['538a'].grep(/\AVHS/i).size > 0
97
98
 
98
- types << 'VH' if self['007[4]'].include?('b') &&
99
- (
100
- self['007[0]'].include?('v') ||
101
- self['008[33]'].include?('v')
102
- )
103
99
 
104
100
  types << 'VL' if self['007[0]'].include?('m')
105
101
  types << 'VL' if (self.bib_format == 'VM') && self['008[33]'].include?('m')
@@ -151,10 +147,14 @@ class Traject::UMichFormat::BibTypes
151
147
  f8524 = record.fields('852').select{|f| f.indicator1 == '4'}
152
148
 
153
149
  # RC
154
- types << 'RC' if %w[i j].include?(ldr6) &&
155
- (bib_format == 'MU') &&
156
- self['007[1]'].include?('d') &&
157
- self['007[12]'].include?('e')
150
+ if %w[i j].include?(ldr6) && (bib_format == 'MU')
151
+ @record.fields('007').map{|f| f.value}.each do |f|
152
+ if f[1] == 'd' && f[12] == 'e'
153
+ types << 'RC'
154
+ break
155
+ end
156
+ end
157
+ end
158
158
 
159
159
  f8524.each do |f|
160
160
  if (f['b'].upcase == 'MUSIC') && (f['j'] =~ /\ACD/i)
@@ -214,7 +214,6 @@ class Traject::UMichFormat::BibTypes
214
214
  # TYP WM Microform FMT F00-02 EQUAL VM
215
215
  # 008 F29-01 EQUAL [a,b,c]
216
216
 
217
-
218
217
  def microform_types
219
218
  return [] unless record['008']
220
219
  types = ['WM']
@@ -377,10 +376,10 @@ class Traject::UMichFormat::BibTypes
377
376
 
378
377
  return ['XC'] if (record['008'] && (record['008'].value[29] == '1')) || record.fields(['111', '711', '811']).size > 0
379
378
 
380
- if (bib_format == 'CF') &&
381
- ((self['006[0]'] & %w[a s]).size > 0) &&
382
- self['006[12]'].include?('1')
383
- return ['XC']
379
+ if (bib_format == 'CF')
380
+ @record.fields('006').map{|f| f.value}.each do |f|
381
+ return ['XC'] if %w[a s].include?(f[0]) && (f[12] == '1')
382
+ end
384
383
  end
385
384
 
386
385
  if (bib_format == 'MU') &&
@@ -1,5 +1,5 @@
1
1
  module Traject
2
2
  class UMichFormat
3
- VERSION = "0.1.1"
3
+ VERSION = "0.1.2"
4
4
  end
5
5
  end
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.1.1
4
+ version: 0.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Bill Dueber
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2013-10-14 00:00:00.000000000 Z
11
+ date: 2013-10-22 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler