traject_umich_format 0.4.0 → 0.4.1

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: ce0ed23c157bbc3e4f0c9e4c94c97a076ce29d5a
4
- data.tar.gz: 8d6b2c24efb05a09eb947c97b654f06c37178788
3
+ metadata.gz: 843ea7355ea638cd27d97a0f6e7866d9fc3316e7
4
+ data.tar.gz: aec0c15b33f03b857eba20f7ee4a8a8d702dc1c4
5
5
  SHA512:
6
- metadata.gz: bfc932b3fef6beb05d976257d897a5e260c1326fef529f830af2b7a57e6688ec8d4ee5bae0e5fc96256c737c95f4b0784e057b6de5747e8d301feebd0d9dae82
7
- data.tar.gz: e27bddc6f23778001bd6aae543e93f9247bae63d2ea40992d721991f472c9bf398a8eb9ebeb672dcef5ace444c693acd288b33803760b33020c057a351b46d81
6
+ metadata.gz: 1a5fe3dd67c9e3b981000142f8809d1328445c61f6dd86d1f6aafb96000fed7b3073a1ce254dd080c95d980dc9c637a2cee36323186d465ff62bef480e39686b
7
+ data.tar.gz: 6e00c3e3fb950fd2ab6ac36f892f28b54106e27400cdec825d5d7d83670c753c4542d67da2845c160f0d97aa3fa4aa042e1aedd76c436b791f3ffc23e1204e7a
data/ChangeLog.md CHANGED
@@ -1,3 +1,7 @@
1
+ ### 0.4.0 / 2017-12-01
2
+
3
+ * Improve recognition of audio and CD formats
4
+
1
5
  ### 0.3.0 / 2017-04-13
2
6
 
3
7
  * Call `uniq` on the list of formats before it's returned, since _serial_ can sometimes come
@@ -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
@@ -1,5 +1,5 @@
1
1
  module Traject
2
2
  class UMichFormat
3
- VERSION = "0.4.0"
3
+ VERSION = "0.4.1"
4
4
  end
5
5
  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.0
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-04-13 00:00:00.000000000 Z
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.8
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