relaton-ogc 1.13.0 → 1.14.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.
@@ -31,7 +31,9 @@ module RelatonOgc
31
31
  end
32
32
  @array = case resp.status
33
33
  when 200
34
- bib = OgcBibliographicItem.from_hash YAML.safe_load(resp.body)
34
+ hash = YAML.safe_load(resp.body)
35
+ hash["fetched"] = Date.today.to_s
36
+ bib = OgcBibliographicItem.from_hash hash
35
37
  [Hit.new(bib, self)]
36
38
  else []
37
39
  end
@@ -25,6 +25,15 @@ module RelatonOgc
25
25
  super
26
26
  end
27
27
 
28
+ #
29
+ # Fetches flavof schema version
30
+ #
31
+ # @return [String] schema version
32
+ #
33
+ def ext_schema
34
+ @ext_schema ||= schema_versions["relaton-model-ogc"]
35
+ end
36
+
28
37
  # @param hash [Hash]
29
38
  # @return [RelatonOgc::OgcBibliographicItem]
30
39
  def self.from_hash(hash)
@@ -45,14 +54,15 @@ module RelatonOgc
45
54
  # @option opts [Symbol, NilClass] :date_format (:short), :full
46
55
  # @option opts [String, Symbol] :lang language
47
56
  # @return [String] XML
48
- def to_xml(**opts)
57
+ def to_xml(**opts) # rubocop:disable Metrics/AbcSize
49
58
  super(**opts) do |b|
50
- b.ext do
59
+ ext = b.ext do
51
60
  b.doctype doctype if doctype
52
61
  b.subdoctype subdoctype if subdoctype
53
62
  editorialgroup&.to_xml b
54
63
  ics.each { |i| i.to_xml b }
55
64
  end
65
+ ext["schema-version"] = ext_schema unless opts[:embedded]
56
66
  end
57
67
  end
58
68
 
@@ -68,11 +68,11 @@ module RelatonOgc
68
68
  # @param missed_years [Array<Strig>]
69
69
  def fetch_ref_err(code, year, missed_years)
70
70
  id = year ? "#{code} year #{year}" : code
71
- warn "[relaton-ogc] WARNING: no match found online for #{id}. "\
72
- "The code must be exactly like it is on the standards website."
71
+ warn "[relaton-ogc] WARNING: no match found online for #{id}. " \
72
+ "The code must be exactly like it is on the standards website."
73
73
  unless missed_years.empty?
74
- warn "[relaton-ogc] (There was no match for #{year}, though there were matches "\
75
- "found for #{missed_years.join(', ')}.)"
74
+ warn "[relaton-ogc] (There was no match for #{year}, though there " \
75
+ "were matches found for #{missed_years.join(', ')}.)"
76
76
  end
77
77
  nil
78
78
  end
@@ -37,7 +37,6 @@ module RelatonOgc
37
37
  def parse_page(hit) # rubocop:disable Metrics/AbcSize,Metrics/MethodLength
38
38
  type = fetch_type(hit["type"])
39
39
  OgcBibliographicItem.new(
40
- fetched: Date.today.to_s,
41
40
  type: "standard",
42
41
  title: fetch_title(hit["title"]),
43
42
  docid: fetch_docid(hit["identifier"]),
@@ -1,3 +1,3 @@
1
1
  module RelatonOgc
2
- VERSION = "1.13.0".freeze
2
+ VERSION = "1.14.1".freeze
3
3
  end
data/relaton_ogc.gemspec CHANGED
@@ -35,5 +35,5 @@ Gem::Specification.new do |spec|
35
35
  spec.add_development_dependency "webmock"
36
36
 
37
37
  spec.add_dependency "faraday", "~> 1.0"
38
- spec.add_dependency "relaton-iso-bib", "~> 1.13.0"
38
+ spec.add_dependency "relaton-iso-bib", "~> 1.14.0"
39
39
  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.13.0
4
+ version: 1.14.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ribose Inc.
8
- autorequire:
8
+ autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2022-08-21 00:00:00.000000000 Z
11
+ date: 2022-12-06 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: equivalent-xml
@@ -142,14 +142,14 @@ dependencies:
142
142
  requirements:
143
143
  - - "~>"
144
144
  - !ruby/object:Gem::Version
145
- version: 1.13.0
145
+ version: 1.14.0
146
146
  type: :runtime
147
147
  prerelease: false
148
148
  version_requirements: !ruby/object:Gem::Requirement
149
149
  requirements:
150
150
  - - "~>"
151
151
  - !ruby/object:Gem::Version
152
- version: 1.13.0
152
+ version: 1.14.0
153
153
  description: 'RelatonOgc: retrieve OGC Standards for bibliographic use using the OgcBibliographicItem
154
154
  model'
155
155
  email:
@@ -159,6 +159,7 @@ extensions: []
159
159
  extra_rdoc_files: []
160
160
  files:
161
161
  - ".github/workflows/rake.yml"
162
+ - ".github/workflows/release.yml"
162
163
  - ".gitignore"
163
164
  - ".rspec"
164
165
  - ".rubocop.yml"
@@ -170,10 +171,10 @@ files:
170
171
  - bin/rspec
171
172
  - bin/setup
172
173
  - grammars/basicdoc.rng
174
+ - grammars/biblio-standoc.rng
173
175
  - grammars/biblio.rng
174
- - grammars/isodoc.rng
175
- - grammars/ogc.rng
176
- - grammars/reqt.rng
176
+ - grammars/relaton-ogc-compile.rng
177
+ - grammars/relaton-ogc.rng
177
178
  - lib/relaton_ogc.rb
178
179
  - lib/relaton_ogc/data_fetcher.rb
179
180
  - lib/relaton_ogc/editorial_group.rb
@@ -191,7 +192,7 @@ homepage: https://github.com/relaton/relaton-ogc
191
192
  licenses:
192
193
  - BSD-2-Clause
193
194
  metadata: {}
194
- post_install_message:
195
+ post_install_message:
195
196
  rdoc_options: []
196
197
  require_paths:
197
198
  - lib
@@ -206,8 +207,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
206
207
  - !ruby/object:Gem::Version
207
208
  version: '0'
208
209
  requirements: []
209
- rubygems_version: 3.2.3
210
- signing_key:
210
+ rubygems_version: 3.1.6
211
+ signing_key:
211
212
  specification_version: 4
212
213
  summary: 'RelatonOgc: retrieve OGC Standards for bibliographic use using the OgcBibliographicItem
213
214
  model'