gared 0.1.1 → 0.1.2

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.
Files changed (3) hide show
  1. checksums.yaml +4 -4
  2. data/lib/gared/primo.rb +14 -2
  3. metadata +1 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 41a7b906291f32cc4d85e79d25bb44092910d07ad543aab25d849c7875fc1425
4
- data.tar.gz: 792a9a4f8106376cf215a44a25229c6ba4b482b6b8f611090a299003633ddc55
3
+ metadata.gz: 8f355eef9dbb29f321690a0ad9aaaca1513474f13cf9916245d0196a31f40336
4
+ data.tar.gz: 3ea6acb4fb92f7c1d632602982877b2bee3151212bb05616d2768bde177df873
5
5
  SHA512:
6
- metadata.gz: 2e75f5d59cbc541f0f116bc48674d2feb6fa3dbc61c7fb7af9d64238b4411842c52bfee1230204bef9e4573047064eae12a25673062aa279168a296c58fe458b
7
- data.tar.gz: abd954a9aae79af1c8a494eac8d3b79ec4297cecf60237b455b16d8047bb60d69bc6ad8fe0ef51996e650984fc9760ea077ae34298cb100e9f462c13d062cfc7
6
+ metadata.gz: fcc7399021ca90d91d876441a1f5e4fcc6c99e737eb25fe144297661108f09dba83dab3eb65481931a0ccf739ae65f4d2cc99173fff186886ffdeb1e9c5f2b44
7
+ data.tar.gz: bd9d379ce171fbbb9004c0336467777d91b72c31f4d05bf7761c99f36cb1334fb1b1f350df9293ff529535593da67d646d3a87666ccb660e74cf439611b12c7b
data/lib/gared/primo.rb CHANGED
@@ -47,7 +47,12 @@ module Gared
47
47
  p.author_line = deets['creator'].join('; ')
48
48
  p.author_line += deets['contributor'].join('; ') if deets['contributor']
49
49
  p.language = deets['language'].join('; ')
50
- p.notes = deets['format'].join('; ')+r['pnx']['search']['subject'].join('; ') # "#{deets['format']}\n#{deets['subject']}"
50
+ p.notes = deets['format'].join('; ')
51
+ if r['pnx']['display'] && r['pnx']['display']['subject']
52
+ p.notes += r['pnx']['display']['subject'].join('; ')
53
+ elsif r['pnx']['search'] && r['pnx']['search']['subject']
54
+ p.notes += r['pnx']['search']['subject'].join('; ')
55
+ end
51
56
  p.publisher_line = deets['publisher'].join('; ')
52
57
  p.pub_year = deets['creationdate'].join('; ')
53
58
  p.source_id = r['pnx']['control']['sourcerecordid'].join('; ')
@@ -69,10 +74,17 @@ module Gared
69
74
  h.source_name = 'Primo:'+@options[:vid]
70
75
 
71
76
  begin
72
- h.location = r['pnx']['search']['callnumber'].join('; ')
77
+ h.location = r['pnx']['search']['callnumber'].join('; ') # Haifa University style
73
78
  rescue Exception # We're skipping things without a callnumber, as they are not resources within the library itself.
74
79
  puts $!
75
80
  end
81
+ if h.location.nil?
82
+ begin
83
+ h.location = r['delivery']['bestlocation']['callNumber'] # Tel Aviv University style
84
+ rescue Exception
85
+ puts $!
86
+ end
87
+ end
76
88
  p.add_holding(h)
77
89
  ret << p
78
90
  rescue Exception
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: gared
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
  - Asaf Bartov