cocina_display 1.8.1 → 1.8.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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 9b7ec735c0ad257e8313d365e8900790b9acc115f98607a61a3b4eb293a2cb9a
4
- data.tar.gz: a9761a59329eb8095c055063ef63b5b9e9c99d1d754cc8af3b20d95f59ec1fa7
3
+ metadata.gz: eb0bba4d19bc1aa9c9e50e75595491b54fb0fe615947305cd46d7a31c176c12c
4
+ data.tar.gz: 813afddbd4c11d0ac2fe76ec4f8167b27478b448924fae48dc5c59e4350c0035
5
5
  SHA512:
6
- metadata.gz: 1e522347186bddba536dd3139b6ce540a06724879d300caa296f96dbd29c866bc087756e3b95beb4b8b20541141b41ae60b1b892dcf49b30ffe8f26e3de67102
7
- data.tar.gz: e87f404d0eaa5aaf3e7fbac2ff2effdfef1a644fa7ae02b4f29f9207804249eabcd25f9c992892a839a634750817d76c78e9e8f388a79a3e855f8cb5b782e23d
6
+ metadata.gz: 68fc4be5a58b31b54798ecfdde47395bd3984ac2950d80ed8b089beae7a800947a729daca42627411fe4d32218b6b96dbf3899bea6584c5de649454e147ed345
7
+ data.tar.gz: 7bdc1bfe6c7050175cdd7b1ffa44640f636f2868238b2702bb9298b4ac0d6422867b8d1eb04a845f91d228770897cc3072b04abf112cdb8c592a6aefa3f555b5
@@ -30,11 +30,11 @@ module CocinaDisplay
30
30
  coordinate_objects.map(&:as_envelope).compact.uniq
31
31
  end
32
32
 
33
- # All valid coordinate data formatted for indexing into a Solr LatLon field.
33
+ # All valid coordinate data formatted for indexing into a Solr RPT field.
34
34
  # @note Bounding boxes are automatically converted to their center point.
35
35
  # @see https://solr.apache.org/guide/solr/latest/query-guide/spatial-search.html#indexing-points
36
36
  # @return [Array<String>]
37
- # @example ["34.0522,-118.2437"]
37
+ # @example ["-118.2437 34.0522"]
38
38
  def coordinates_as_point
39
39
  coordinate_objects.map(&:as_point).uniq
40
40
  end
@@ -407,6 +407,8 @@ module CocinaDisplay
407
407
  return nil if date.nil?
408
408
 
409
409
  case date_range
410
+ when EDTF::Unknown
411
+ nil
410
412
  when EDTF::Epoch, EDTF::Interval, EDTF::Season
411
413
  date_range.min
412
414
  when EDTF::Set
@@ -427,6 +429,8 @@ module CocinaDisplay
427
429
  return nil if date.nil?
428
430
 
429
431
  case date_range
432
+ when EDTF::Unknown
433
+ nil
430
434
  when EDTF::Epoch, EDTF::Interval, EDTF::Season
431
435
  date_range.max
432
436
  when EDTF::Set
@@ -130,12 +130,12 @@ module CocinaDisplay
130
130
  nil
131
131
  end
132
132
 
133
- # Format as a comma-separated latitude,longitude pair.
133
+ # Format as a space-separated x y (longitude latitude) pair.
134
134
  # @note Limits decimals to 6 places.
135
- # @example "34.0522,-118.2437"
135
+ # @example "-118.2437 34.0522"
136
136
  # @return [String]
137
137
  def as_point
138
- "%.6f,%.6f" % [point.lat, point.lng]
138
+ "%.6f %.6f" % [point.lng, point.lat]
139
139
  end
140
140
  end
141
141
 
@@ -205,15 +205,15 @@ module CocinaDisplay
205
205
  ]
206
206
  end
207
207
 
208
- # The box center point as a comma-separated latitude,longitude pair.
208
+ # The box center point as a space-separated x y (longitude latitude) pair.
209
209
  # @note Limits decimals to 6 places.
210
- # @example "34.0522,-118.2437"
210
+ # @example "-118.2437 34.0522"
211
211
  # @return [String]
212
212
  def as_point
213
213
  azimuth = min_point.azimuth(max_point)
214
214
  distance = min_point.distance(max_point)
215
215
  center = min_point.endpoint(distance / 2, azimuth)
216
- "%.6f,%.6f" % [center.lat, center.lng]
216
+ "%.6f %.6f" % [center.lng, center.lat]
217
217
  end
218
218
  end
219
219
 
@@ -2,5 +2,5 @@
2
2
 
3
3
  # :nodoc:
4
4
  module CocinaDisplay
5
- VERSION = "1.8.1" # :nodoc:
5
+ VERSION = "1.8.2" # :nodoc:
6
6
  end
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cocina_display
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.8.1
4
+ version: 1.8.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Nick Budak
8
8
  bindir: exe
9
9
  cert_chain: []
10
- date: 2026-02-13 00:00:00.000000000 Z
10
+ date: 1980-01-02 00:00:00.000000000 Z
11
11
  dependencies:
12
12
  - !ruby/object:Gem::Dependency
13
13
  name: janeway-jsonpath
@@ -298,7 +298,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
298
298
  - !ruby/object:Gem::Version
299
299
  version: '0'
300
300
  requirements: []
301
- rubygems_version: 3.6.2
301
+ rubygems_version: 3.6.9
302
302
  specification_version: 4
303
303
  summary: Helpers for rendering Cocina metadata
304
304
  test_files: []