cocina_display 1.4.3 → 1.5.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: f91655b5e875b9fe1be7449bc1ba5cca1034e8b811a38444510dffc08e05cfbe
4
- data.tar.gz: 58b7286e58890a2bbc769fcc7de8a18aebc1f44108123b4cfb3cec4069e2cc3d
3
+ metadata.gz: 9f613a3974d14946081f09d45797c2be75475c2b37fedf4ebe51a9c7eef2de10
4
+ data.tar.gz: 6dc64d8348e652ac4bea87a904519029ed580cc498c6e584d2a196a079293141
5
5
  SHA512:
6
- metadata.gz: dc64eef19cc55375a71eaa27aacbd84c068155b5d36d2a019515f4a8a74ffe22aae82375e5f2ae2dc5cad2a4201b718cc1cc2e5796e1278c95ab1bd6149177f2
7
- data.tar.gz: e64de6a2785f71535b4854dd9eff74da93085d3c658bfd039586c027ba1e88b2beff0310e28d7a9bd68a6766bb9b4bfb202ad21a4512c1d21b3869f802ba9ba8
6
+ metadata.gz: 56874880d8a3fff624afb2306aeffab7792b59f678901a5f8632bd77beca3eeaab388053ddcc3790d6f1c5dfe687ee6588cd83eafe5cc143893eb8d551ed617f
7
+ data.tar.gz: d39907bb6d250a06ab01b5127fc98223ac6225e2e346ea9eaadaa91874ff20b807e2ded45453e5ed10cfb9515eba4b3da11ab5fb8ee7b42718ac670ab4cde95f
@@ -18,16 +18,14 @@ module CocinaDisplay
18
18
  include CocinaDisplay::Concerns::RelatedResources
19
19
 
20
20
  # Fetch a public Cocina document from PURL and create a CocinaRecord.
21
- # @note This is intended to be used in development or testing only.
22
21
  # @param druid [String] The bare DRUID of the object to fetch.
23
22
  # @param purl_url [String] The base url for the purl service.
24
23
  # @param deep_compact [Boolean] If true, compact the JSON to remove blank values.
25
24
  # @return [CocinaDisplay::CocinaRecord]
26
- # :nocov:
27
25
  def self.fetch(druid, deep_compact: true, purl_url: "https://purl.stanford.edu")
28
- from_json(Net::HTTP.get(URI("#{purl_url}/#{druid}.json")), deep_compact: deep_compact)
26
+ response = Net::HTTP.get_response(URI("#{purl_url}/#{druid}.json"))
27
+ from_json(response.body, deep_compact: deep_compact) if response.is_a?(Net::HTTPSuccess)
29
28
  end
30
- # :nocov:
31
29
 
32
30
  # Create a CocinaRecord from a JSON string.
33
31
  # @param cocina_json [String]
@@ -80,11 +80,11 @@ module CocinaDisplay
80
80
  end
81
81
  end
82
82
 
83
- # DisplayData for Contributors, one per role.
83
+ # DisplayData for Contributors, one per role (excluding publisher).
84
84
  # Contributors with no role are grouped under a default heading.
85
85
  # @return [Array<DisplayData>]
86
86
  def contributor_display_data
87
- contributors_by_role.map do |role, contributors|
87
+ contributors_by_role.except("publisher").map do |role, contributors|
88
88
  label = I18n.t(role, scope: "cocina_display.contributor.role",
89
89
  default: role&.capitalize || I18n.t("default", scope: "cocina_display.contributor.role"))
90
90
  DisplayData.new(label: label, objects: contributors)
@@ -53,6 +53,7 @@ module CocinaDisplay
53
53
 
54
54
  (link["refresh"] == refresh) ? hrid : nil
55
55
  end
56
+ alias_method :catkey, :folio_hrid
56
57
 
57
58
  # The FOLIO HRID if defined, otherwise the bare DRUID.
58
59
  # @note This doesn't imply the object is available in Searchworks at this ID.
@@ -2,5 +2,5 @@
2
2
 
3
3
  # :nodoc:
4
4
  module CocinaDisplay
5
- VERSION = "1.4.3" # :nodoc:
5
+ VERSION = "1.5.0" # :nodoc:
6
6
  end
metadata CHANGED
@@ -1,14 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cocina_display
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.4.3
4
+ version: 1.5.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Nick Budak
8
- autorequire:
9
8
  bindir: exe
10
9
  cert_chain: []
11
- date: 2025-10-31 00:00:00.000000000 Z
10
+ date: 2025-12-05 00:00:00.000000000 Z
12
11
  dependencies:
13
12
  - !ruby/object:Gem::Dependency
14
13
  name: janeway-jsonpath
@@ -212,7 +211,6 @@ dependencies:
212
211
  - - "~>"
213
212
  - !ruby/object:Gem::Version
214
213
  version: '3.1'
215
- description:
216
214
  email:
217
215
  - budak@stanford.edu
218
216
  executables: []
@@ -284,7 +282,6 @@ licenses:
284
282
  metadata:
285
283
  homepage_uri: https://sul-dlss.github.io/cocina_display/
286
284
  source_code_uri: https://github.com/sul-dlss/cocina_display
287
- post_install_message:
288
285
  rdoc_options: []
289
286
  require_paths:
290
287
  - lib
@@ -299,8 +296,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
299
296
  - !ruby/object:Gem::Version
300
297
  version: '0'
301
298
  requirements: []
302
- rubygems_version: 3.5.16
303
- signing_key:
299
+ rubygems_version: 3.6.2
304
300
  specification_version: 4
305
301
  summary: Helpers for rendering Cocina metadata
306
302
  test_files: []