relaton-ogc 1.20.0 → 1.20.1

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: 2fb5518408325a02364ea1938708089804f1b61493a3dfa01c99239314ce4bf4
4
- data.tar.gz: 660f8779f7209f80bf8498bc2022259aaf40b9a6bf998267814b0300b14328db
3
+ metadata.gz: 2c5ff2e52f74939f5dd715e54318cc0f7beab1880965868c23b5e43514b62fd4
4
+ data.tar.gz: 5a190d493b779ae6d0e7fc1ff2e8529ed210901b5006d90db9470f6d26e87626
5
5
  SHA512:
6
- metadata.gz: 58c9d21aa2ce4fc50dc626225d24cc495fc20078497a360a218bfc1f1133be4a2b2bd24238c09dc046aef15a20b3ab41438b20a7a93d40311b7ecda74e3a22a6
7
- data.tar.gz: 452073a916ffae4eec0efcd3074641547ea7a80199194a1d453830985c22a129364ede8812e84e48664d3ee989064eea3b962baa26f0fb53c0fc01694ee00d79
6
+ metadata.gz: '069d2ea46db6d46a067f7949078b7bc1b670f1ab7de046e3ef862c3f17ba60a004a0d60f18266d05ca635f5a34954e415bfa1206e44d7a900d9720279e819580'
7
+ data.tar.gz: 74726f295ce90b5590f1fb79173d79aa4ff245fb60e39b61e1582bc2aaf50984e95ea58edcd0424dc09fcb5da7e84272a3c77256094b34778067eadce5077513
@@ -76,11 +76,23 @@ module RelatonOgc
76
76
  # @return [Array>RelatonBib::TypedUri>]
77
77
  def fetch_link(hit)
78
78
  link = []
79
- link << RelatonBib::TypedUri.new(type: "src", content: hit["URI"]) if hit["URI"]
80
- return link unless hit["URL"]
81
-
82
- type = hit["URL"].end_with?("pdf") ? "pdf" : "obp"
83
- link << RelatonBib::TypedUri.new(type: type, content: hit["URL"])
79
+ uri = hit["URI"].to_s.strip
80
+ link << RelatonBib::TypedUri.new(type: "src", content: uri) unless uri.empty?
81
+ return link unless hit["URL"] && !hit["URL"].strip.empty?
82
+
83
+ if ext = hit["URL"].match(/(?<=\.)(?<ext>pdf|html|doc)$/)
84
+ type = ext[:ext]
85
+ else
86
+ case hit["URL"]
87
+ when /portal\.(ogc|opengeospatial)\.org/, /usgif\.org/
88
+ type = "pdf"
89
+ when /www\.(w3|geopackage)\.org/, /docs\.ogc\.org/
90
+ type = "html"
91
+ else
92
+ type = "html"
93
+ end
94
+ end
95
+ link << RelatonBib::TypedUri.new(type: type, content: hit["URL"].strip)
84
96
  end
85
97
 
86
98
  def fetch_doctype(type)
@@ -1,3 +1,3 @@
1
1
  module RelatonOgc
2
- VERSION = "1.20.0".freeze
2
+ VERSION = "1.20.1".freeze
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: relaton-ogc
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.20.0
4
+ version: 1.20.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ribose Inc.
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2024-12-13 00:00:00.000000000 Z
11
+ date: 2025-03-20 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: faraday
@@ -112,7 +112,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
112
112
  - !ruby/object:Gem::Version
113
113
  version: '0'
114
114
  requirements: []
115
- rubygems_version: 3.3.27
115
+ rubygems_version: 3.5.22
116
116
  signing_key:
117
117
  specification_version: 4
118
118
  summary: 'RelatonOgc: retrieve OGC Standards for bibliographic use using the OgcBibliographicItem