cocina-models 0.114.0 → 0.116.0

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
  SHA256:
3
- metadata.gz: 2b8514cca9a06bbf3e7c36d84a1f27d093e16a263e8ac1cb92289b6640d28bec
4
- data.tar.gz: '09f25bf203314c534eba5e21a16b163f56b21ac2e858cf9a5a25f309086efa12'
3
+ metadata.gz: cfe265fcb4aa056742a278f0f49cdaec73de7cab666ef011217c98918441d2d7
4
+ data.tar.gz: 407191578301b2dabb6db984f3e039a76a3a81e6d8bc305df705526154bcd5ca
5
5
  SHA512:
6
- metadata.gz: 2dce9b0cc4eb70cc6a2ddbc2dda88e5249b9ac58a0ec96523ec9c3e23ebe82108d87eb1e36b70e8e44a0d8c0abf75682c6f284dbda26e4cefe469b4acf5bf715
7
- data.tar.gz: 795ba280b81c888fd005cc5af39d671b942f3d5b718b61b44e902581d476958654f28485aec4f8d18de4d725a6b9338c84c8a0acc4a7c315b04e5cd2ec22c9a8
6
+ metadata.gz: 3517ded3340511228c488a66a19885bce82c20dfbddcea85ab43dcceb8a92b17accb2124bb87381f671bbbaa3955089d6e8e47f499677b77021acf33108fc2a6
7
+ data.tar.gz: 28598c41ae1c8ffef3e698c462983e05438ef6bc0f8f1f7ed27da03c5f09a8c10a99896e51568793f8578f553ee5907052737144769226097384dc2439fb14da
data/.rubocop.yml CHANGED
@@ -540,7 +540,6 @@ Style/RedundantArrayFlatten: # new in 1.76
540
540
  Enabled: true
541
541
  Style/ArrayIntersectWithSingleElement: # new in 1.81
542
542
  Enabled: true
543
-
544
543
  Style/EmptyClassDefinition: # new in 1.83
545
544
  Enabled: true
546
545
  Style/ModuleMemberExistenceCheck: # new in 1.82
@@ -552,4 +551,30 @@ Style/ReverseFind: # new in 1.83
552
551
  RSpec/LeakyLocalVariable: # new in 3.8
553
552
  Enabled: true
554
553
  RSpec/Output: # new in 3.9
555
- Enabled: true
554
+ Enabled: true
555
+ Lint/DataDefineOverride: # new in 1.85
556
+ Enabled: true
557
+ Lint/UnreachablePatternBranch: # new in 1.85
558
+ Enabled: true
559
+ Style/FileOpen: # new in 1.85
560
+ Enabled: true
561
+ Style/MapJoin: # new in 1.85
562
+ Enabled: true
563
+ Style/OneClassPerFile: # new in 1.85
564
+ Enabled: true
565
+ Style/PartitionInsteadOfDoubleSelect: # new in 1.85
566
+ Enabled: true
567
+ Style/PredicateWithKind: # new in 1.85
568
+ Enabled: true
569
+ Style/ReduceToHash: # new in 1.85
570
+ Enabled: true
571
+ Style/RedundantMinMaxBy: # new in 1.85
572
+ Enabled: true
573
+ Style/RedundantStructKeywordInit: # new in 1.85
574
+ Enabled: true
575
+ Style/SelectByKind: # new in 1.85
576
+ Enabled: true
577
+ Style/SelectByRange: # new in 1.85
578
+ Enabled: true
579
+ Style/TallyMethod: # new in 1.85
580
+ Enabled: true
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- cocina-models (0.114.0)
4
+ cocina-models (0.116.0)
5
5
  activesupport
6
6
  deprecation
7
7
  dry-struct (~> 1.0)
@@ -86,7 +86,7 @@ GEM
86
86
  prism (>= 1.3.0)
87
87
  rdoc (>= 4.0.0)
88
88
  reline (>= 0.4.2)
89
- json (2.19.1)
89
+ json (2.19.2)
90
90
  json-schema (6.2.0)
91
91
  addressable (~> 2.8)
92
92
  bigdecimal (>= 3.1, < 5)
@@ -162,7 +162,7 @@ GEM
162
162
  rubocop-ast (>= 1.49.0, < 2.0)
163
163
  ruby-progressbar (~> 1.7)
164
164
  unicode-display_width (>= 2.4.0, < 4.0)
165
- rubocop-ast (1.49.0)
165
+ rubocop-ast (1.49.1)
166
166
  parser (>= 3.3.7.2)
167
167
  prism (~> 1.7)
168
168
  rubocop-rake (0.7.1)
@@ -219,7 +219,7 @@ CHECKSUMS
219
219
  attr_extras (7.1.0) sha256=d96fc9a9dd5d85ba2d37762440a816f840093959ae26bb90da994c2d9f1fc827
220
220
  base64 (0.3.0) sha256=27337aeabad6ffae05c265c450490628ef3ebd4b67be58257393227588f5a97b
221
221
  bigdecimal (4.0.1) sha256=8b07d3d065a9f921c80ceaea7c9d4ae596697295b584c296fe599dd0ad01c4a7
222
- cocina-models (0.114.0)
222
+ cocina-models (0.116.0)
223
223
  concurrent-ruby (1.3.6) sha256=6b56837e1e7e5292f9864f34b69c5a2cbc75c0cf5338f1ce9903d10fa762d5ab
224
224
  connection_pool (3.0.2) sha256=33fff5ba71a12d2aa26cb72b1db8bba2a1a01823559fb01d29eb74c286e62e0a
225
225
  date (3.5.1) sha256=750d06384d7b9c15d562c76291407d89e368dda4d4fff957eb94962d325a0dc0
@@ -241,7 +241,7 @@ CHECKSUMS
241
241
  ice_nine (0.11.2) sha256=5d506a7d2723d5592dc121b9928e4931742730131f22a1a37649df1c1e2e63db
242
242
  io-console (0.8.2) sha256=d6e3ae7a7cc7574f4b8893b4fca2162e57a825b223a177b7afa236c5ef9814cc
243
243
  irb (1.17.0) sha256=168c4ddb93d8a361a045c41d92b2952c7a118fa73f23fe14e55609eb7a863aae
244
- json (2.19.1) sha256=dd94fdc59e48bff85913829a32350b3148156bc4fd2a95a2568a78b11344082d
244
+ json (2.19.2) sha256=e7e1bd318b2c37c4ceee2444841c86539bc462e81f40d134cf97826cb14e83cf
245
245
  json-schema (6.2.0) sha256=e8bff46ed845a22c1ab2bd0d7eccf831c01fe23bb3920caa4c74db4306813666
246
246
  json_schemer (2.5.0) sha256=2f01fb4cce721a4e08dd068fc2030cffd0702a7f333f1ea2be6e8991f00ae396
247
247
  jsonpath (1.1.5) sha256=29f70467193a2dc93ab864ec3d3326d54267961acc623f487340eb9c34931dbe
@@ -275,7 +275,7 @@ CHECKSUMS
275
275
  rspec-support (3.13.7) sha256=0640e5570872aafefd79867901deeeeb40b0c9875a36b983d85f54fb7381c47c
276
276
  rspec_junit_formatter (0.6.0) sha256=40dde674e6ae4e6cc0ff560da25497677e34fefd2338cc467a8972f602b62b15
277
277
  rubocop (1.85.1) sha256=3dbcf9e961baa4c376eeeb2a03913dca5e3987033b04d38fa538aa1e7406cc77
278
- rubocop-ast (1.49.0) sha256=49c3676d3123a0923d333e20c6c2dbaaae2d2287b475273fddee0c61da9f71fd
278
+ rubocop-ast (1.49.1) sha256=4412f3ee70f6fe4546cc489548e0f6fcf76cafcfa80fa03af67098ffed755035
279
279
  rubocop-rake (0.7.1) sha256=3797f2b6810c3e9df7376c26d5f44f3475eda59eb1adc38e6f62ecf027cbae4d
280
280
  rubocop-rspec (3.9.0) sha256=8fa70a3619408237d789aeecfb9beef40576acc855173e60939d63332fdb55e2
281
281
  ruby-progressbar (1.13.0) sha256=80fc9c47a9b640d6834e0dc7b3c94c9df37f08cb072b7761e4a71e22cff29b33
@@ -295,4 +295,4 @@ CHECKSUMS
295
295
  zeitwerk (2.7.5) sha256=d8da92128c09ea6ec62c949011b00ed4a20242b255293dd66bf41545398f73dd
296
296
 
297
297
  BUNDLED WITH
298
- 4.0.7
298
+ 4.0.8
data/README.md CHANGED
@@ -55,7 +55,7 @@ Beyond what is necessary to test the generator, the Cocina model classes are not
55
55
 
56
56
  ## Testing validation changes
57
57
 
58
- If there is a possibility that a model, mapping, or validation change will conflict with some existing objects then `bin/validate-data` should be used for testing. This operates on a sample of objects from the repository and reports any validation errors. You may get the sample by running the script [bin/export-cocina-head-versions](https://github.com/sul-dlss/dor-services-app/pull/5854) and downloading the data file to your computer.
58
+ If there is a possibility that a model, mapping, or validation change will conflict with some existing objects then `bin/validate-data` should be used for testing. This operates on a sample of objects from the repository and reports any validation errors. You may get the sample by running the script [bin/export-cocina-head-versions](https://github.com/sul-dlss/dor-services-app?tab=readme-ov-file#export-data) and downloading the data file to your computer. Running a full validation takes about 2 hours.
59
59
 
60
60
 
61
61
  Alternatively, you can use [validate-cocina](https://github.com/sul-dlss/dor-services-app/blob/main/bin/validate-cocina) for testing. This must be run on the `sdr-infra` VM since it requires deploying a branch of cocina-models. It is slower than using `bin/validate-data`, but all of the data is completely up to date.
data/bin/validate-data CHANGED
@@ -103,7 +103,7 @@ def worker_process(reader) # rubocop:disable Metrics/MethodLength
103
103
  rescue JSON::ParserError => e
104
104
  errors << { line: line_num, error: "JSON Parse Error: #{e.message}" }
105
105
  rescue Cocina::Models::ValidationError => e
106
- errors << { line: line_num, error: "Validation Error: #{e.message}" }
106
+ errors << { line: line_num, error: "Validation Error: #{json['externalIdentifier']} - #{e.message}" }
107
107
  rescue Cocina::Models::UnknownTypeError => e
108
108
  errors << { line: line_num, error: "Unknown Type Error: #{e.message}" }
109
109
  rescue StandardError => e
@@ -125,6 +125,11 @@ def spawn_workers(num_processes) # rubocop:disable Metrics/MethodLength
125
125
 
126
126
  pid = fork do
127
127
  # Child process
128
+
129
+ # Close all writer pipes inherited from the parent for OTHER workers.
130
+ workers.each { |w| w[:writer].close }
131
+
132
+ # Now, close the handles for this specific worker that the child doesn't need.
128
133
  work_writer.close
129
134
  result_reader.close
130
135
 
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Cocina
4
4
  module Models
5
- VERSION = '0.114.0'
5
+ VERSION = '0.116.0'
6
6
  end
7
7
  end
data/lib/cocina/models.rb CHANGED
@@ -43,7 +43,7 @@ loader.ignore("#{__dir__}/rspec.rb")
43
43
  loader.ignore("#{__dir__}/rspec")
44
44
  loader.setup
45
45
 
46
- module Cocina
46
+ module Cocina # rubocop:disable Style/OneClassPerFile
47
47
  # Provides Ruby objects for the repository and serializing them to/from JSON.
48
48
  module Models
49
49
  class Error < StandardError; end
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cocina-models
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.114.0
4
+ version: 0.116.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Justin Coyne
8
8
  bindir: exe
9
9
  cert_chain: []
10
- date: 2026-03-13 00:00:00.000000000 Z
10
+ date: 2026-03-20 00:00:00.000000000 Z
11
11
  dependencies:
12
12
  - !ruby/object:Gem::Dependency
13
13
  name: activesupport