relaton-oasis 1.13.0 → 1.14.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.
@@ -22,6 +22,19 @@ module RelatonOasis
22
22
  super
23
23
  end
24
24
 
25
+ #
26
+ # Fetsh flavor schema version.
27
+ #
28
+ # @return [String] flavor schema version
29
+ #
30
+ def ext_schema
31
+ @ext_schema ||= schema_versions["relaton-model-oasis"]
32
+ end
33
+
34
+ # def ext_schema
35
+ # @ext_schema ||= schema_versions["relaton-model-oasis"]
36
+ # end
37
+
25
38
  # @param hash [Hash]
26
39
  # @return [RelatonBipm::BipmBibliographicItem]
27
40
  def self.from_hash(hash)
@@ -42,11 +55,12 @@ module RelatonOasis
42
55
  def to_xml(**opts)
43
56
  super(**opts) do |b|
44
57
  if opts[:bibdata] && technology_area.any?
45
- b.ext do
58
+ ext = b.ext do
46
59
  b.doctype doctype if doctype
47
60
  editorialgroup&.to_xml b
48
61
  technology_area.each { |ta| b.send :"technology-area", ta }
49
62
  end
63
+ ext["schema-version"] = ext_schema unless opts[:embedded]
50
64
  end
51
65
  end
52
66
  end
@@ -54,9 +68,10 @@ module RelatonOasis
54
68
  #
55
69
  # Render bibliographic item as Hash.
56
70
  #
71
+ # @param embedded [Boolean] true if embedded in another document
57
72
  # @return [Hash] bibliographic item as Hash
58
73
  #
59
- def to_hash
74
+ def to_hash(embedded: false)
60
75
  hash = super
61
76
  hash["technology_area"] = technology_area if technology_area.any?
62
77
  hash
@@ -15,6 +15,7 @@ module RelatonOasis
15
15
  return unless resp.code == "200"
16
16
 
17
17
  hash = YAML.safe_load resp.body
18
+ hash["fetched"] = Date.today.to_s
18
19
  OasisBibliographicItem.from_hash hash
19
20
  rescue Mechanize::ResponseCodeError => e
20
21
  return if e.response_code == "404"
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module RelatonOasis
4
- VERSION = "1.13.0"
4
+ VERSION = "1.14.0"
5
5
  end
data/lib/relaton_oasis.rb CHANGED
@@ -1,6 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  require "mechanize"
4
+ require "jing"
4
5
  require "relaton_bib"
5
6
  require_relative "relaton_oasis/version"
6
7
  require_relative "relaton_oasis/oasis_bibliographic_item"
@@ -41,7 +41,7 @@ Gem::Specification.new do |spec|
41
41
  spec.add_development_dependency "webmock"
42
42
 
43
43
  spec.add_dependency "mechanize"
44
- spec.add_dependency "relaton-bib", "~> 1.13.0"
44
+ spec.add_dependency "relaton-bib", "~> 1.14.0"
45
45
 
46
46
  # For more information and examples about making a new gem, checkout our
47
47
  # guide at: https://bundler.io/guides/creating_gem.html
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: relaton-oasis
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.13.0
4
+ version: 1.14.0
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-05 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: 'RelatonOasis: retrieve OASIS Standards for bibliographic use using the
154
154
  BibliographicItem 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,9 +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/reqt.rng
176
+ - grammars/relaton-oasis-compile.rng
177
+ - grammars/relaton-oasis.rng
176
178
  - lib/relaton_oasis.rb
177
179
  - lib/relaton_oasis/data_fetcher.rb
178
180
  - lib/relaton_oasis/data_parser.rb
@@ -191,7 +193,7 @@ licenses:
191
193
  metadata:
192
194
  homepage_uri: https://github.com/metanorma/relaton-oasis
193
195
  source_code_uri: https://github.com/metanorma/relaton-oasis
194
- post_install_message:
196
+ post_install_message:
195
197
  rdoc_options: []
196
198
  require_paths:
197
199
  - lib
@@ -206,8 +208,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
206
208
  - !ruby/object:Gem::Version
207
209
  version: '0'
208
210
  requirements: []
209
- rubygems_version: 3.2.3
210
- signing_key:
211
+ rubygems_version: 3.1.6
212
+ signing_key:
211
213
  specification_version: 4
212
214
  summary: 'RelatonOasis: retrieve OASIS Standards for bibliographic use using the BibliographicItem
213
215
  model'