berkeley_library-location 2.0.0 → 3.0.0

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
  SHA256:
3
- metadata.gz: af0453d4f60ad7276b64c48937b36cc76d250eb2a41ff23914f30d7c35edbf85
4
- data.tar.gz: 2cb9fb72635d239f6b6726f4278b555913b9f209dddb43dbeb03072b495de3d1
3
+ metadata.gz: 27ec12d4fe5561d87ad2b96cdcedb68d935aa2b36d0df9ed28dd25570af071b4
4
+ data.tar.gz: 1e0fefbfafda0938e0dd8cb714a5a0d0da4ea96e8476a922f7ff55aba91bd550
5
5
  SHA512:
6
- metadata.gz: 5a9dc82778e93207bc4f23e328b1699f4cb58abed4b7deda70cb8ec713b4c47a95d36be19fdab962b591df78c15182af841d111ef941a6d8ab2436b6587109fe
7
- data.tar.gz: f6f78720f85d04530e656940d5dcaa1056cfd086de7ca280253d4a3d6aeca22a98236ad6ba2dc6666c4b3b6e765bd1e0cf3842dc69104e7b30eaa50685a69e9e
6
+ metadata.gz: 8cdfc0b0f370d282d4a86e791a15bfc5de856e821d360840a058b6bfd6385816fcb032a48dd9dd5a182a04767e2013990295ddb79841c41902f270e28b5208cd
7
+ data.tar.gz: 18c2c7c1d25beed576a4bcef69863e9cb1b8beed29e33c5e1180c38cba0e374189bf65811c5e93daf47cb7fd74f4fcb60716fbb34c121a7762b799d2943aa289
data/CHANGES.md CHANGED
@@ -1,3 +1,11 @@
1
+ # 3.0.0 (2023-10-10)
2
+
3
+ - Support duplicate OCLC numbers
4
+
5
+ # 2.0.0 (2023-06-06)
6
+
7
+ - Rename from "holdings" to "location"
8
+
1
9
  # 2.0.0 (2023-06-06)
2
10
 
3
11
  - Rename from "holdings" to "location"
@@ -2,12 +2,12 @@ module BerkeleyLibrary
2
2
  module Location
3
3
  module ModuleInfo
4
4
  NAME = 'berkeley_library-location'.freeze
5
- AUTHOR = 'David Moles'.freeze
6
- AUTHOR_EMAIL = 'dmoles@berkeley.edu'.freeze
5
+ AUTHOR = 'UC Berkeley Library IT'.freeze
6
+ AUTHOR_EMAIL = 'libdevelopers@lists.berkeley.edu'.freeze
7
7
  SUMMARY = 'Locaton-related utilities for the UC Berkeley Library'.freeze
8
8
  DESCRIPTION = 'A collection of location-related utilities for the UC Berkeley Library'.freeze
9
9
  LICENSE = 'MIT'.freeze
10
- VERSION = '2.0.0'.freeze
10
+ VERSION = '3.0.0'.freeze
11
11
  HOMEPAGE = 'https://github.com/BerkeleyLibrary/location'.freeze
12
12
  end
13
13
  end
@@ -30,9 +30,11 @@ module BerkeleyLibrary
30
30
  end
31
31
 
32
32
  def <<(result)
33
- r_index = row_index_for(result.oclc_number)
34
- write_wc_cols(r_index, result) if rlf || uc
35
- write_ht_cols(r_index, result) if hathi_trust
33
+ r_indices = row_indices_for(result.oclc_number)
34
+ r_indices.each do |idx|
35
+ write_wc_cols(idx, result) if rlf || uc
36
+ write_ht_cols(idx, result) if hathi_trust
37
+ end
36
38
  end
37
39
 
38
40
  private
@@ -57,8 +59,8 @@ module BerkeleyLibrary
57
59
  ht_col_index if hathi_trust
58
60
  end
59
61
 
60
- def row_index_for(oclc_number)
61
- row_index = row_index_by_oclc_number[oclc_number]
62
+ def row_indices_for(oclc_number)
63
+ row_index = row_indices_by_oclc_number[oclc_number]
62
64
  return row_index if row_index
63
65
 
64
66
  raise ArgumentError, "Unknown OCLC number: #{oclc_number}"
@@ -121,18 +123,15 @@ module BerkeleyLibrary
121
123
  @ht_err_col_index ||= ss.ensure_column!(COL_HATHI_TRUST_ERROR)
122
124
  end
123
125
 
124
- def row_index_by_oclc_number
126
+ def row_indices_by_oclc_number
125
127
  # Start at 1 to skip header row
126
- @row_index_by_oclc_number ||= (1...ss.row_count).each_with_object({}) do |r_index, r_indices|
128
+ @row_indices_by_oclc_number ||= (1...ss.row_count).each_with_object({}) do |r_index, r_indices|
127
129
  oclc_number_raw = ss.value_at(r_index, oclc_col_index)
128
130
  next unless oclc_number_raw
129
131
 
130
132
  oclc_number = oclc_number_raw.to_s
131
- if r_indices.key?(oclc_number)
132
- logger.warn("Skipping duplicate OCLC number #{oclc_number} in row #{r_index}")
133
- else
134
- r_indices[oclc_number] = r_index
135
- end
133
+ r_indices[oclc_number] ||= []
134
+ r_indices[oclc_number] << r_index
136
135
  end
137
136
  end
138
137
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: berkeley_library-location
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.0
4
+ version: 3.0.0
5
5
  platform: ruby
6
6
  authors:
7
- - David Moles
8
- autorequire:
7
+ - UC Berkeley Library IT
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-06-07 00:00:00.000000000 Z
11
+ date: 2023-10-19 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: berkeley_library-logging
@@ -255,7 +255,7 @@ dependencies:
255
255
  - !ruby/object:Gem::Version
256
256
  version: '3.12'
257
257
  description: A collection of location-related utilities for the UC Berkeley Library
258
- email: dmoles@berkeley.edu
258
+ email: libdevelopers@lists.berkeley.edu
259
259
  executables: []
260
260
  extensions: []
261
261
  extra_rdoc_files: []
@@ -291,7 +291,7 @@ metadata:
291
291
  source_code_uri: https://github.com/BerkeleyLibrary/location
292
292
  changelog_uri: https://github.com/BerkeleyLibrary/location/CHANGELOG.md
293
293
  rubygems_mfa_required: 'true'
294
- post_install_message:
294
+ post_install_message:
295
295
  rdoc_options: []
296
296
  require_paths:
297
297
  - lib
@@ -306,8 +306,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
306
306
  - !ruby/object:Gem::Version
307
307
  version: '0'
308
308
  requirements: []
309
- rubygems_version: 3.3.25
310
- signing_key:
309
+ rubygems_version: 3.4.10
310
+ signing_key:
311
311
  specification_version: 4
312
312
  summary: Locaton-related utilities for the UC Berkeley Library
313
313
  test_files: []