relaton-omg 1.10.0 → 1.10.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 05ffe60d5d13aabbeaf36188da133a0bc1ef235aa47d79935cd787783cdcf3e5
4
- data.tar.gz: 314cb574d9366c2e224d4701d6a84b601c8c07222c6fd8eb68b1050dc451daf7
3
+ metadata.gz: 25e974b4ee6e3252b54de2b60046e8f6a663da8243e7faf4bf7a3534a5df2000
4
+ data.tar.gz: 7dd39b0a40d2b466182f3cbbb330f71fa52d1b7a3b35e27a7dd1211bffc88d03
5
5
  SHA512:
6
- metadata.gz: 5b333cb4e949774c26b29e39bbcfd78c1999f20113037180e5d57b70b1d6fc196a4ac40d84428246eae429e221551ebcaf6fd88a4bcd0ffa42941e4517387912
7
- data.tar.gz: 220a8897c4d5720ee9324eb4bc1dd7f22d100f6d3d9236cd573e6086bce8fe1a36bad5c47fdf0a2dbf563045b595cb23301a91c2c0dee04735dac78dd4a78214
6
+ metadata.gz: 7257fc7500c4c82d086a961e42c51cbb73b718c138bd70902d70f7bbb74ad84242414b4f81149a0573c444f3da8c5fc343ebdbb324ac48b3060b8a405a8c2cd6
7
+ data.tar.gz: 89e56ff2c08ffe8e4fcca291ff9ab0fa527992aeb16229c137d7686a412e6678b3e0e27dbec506c03fa60c016e11bdd891088663d9bf63ba5a671944d610a0e8
data/grammars/biblio.rng CHANGED
@@ -209,9 +209,6 @@
209
209
  <zeroOrMore>
210
210
  <ref name="contact"/>
211
211
  </zeroOrMore>
212
- <zeroOrMore>
213
- <ref name="uri"/>
214
- </zeroOrMore>
215
212
  </element>
216
213
  </define>
217
214
  <define name="fullname">
@@ -828,6 +825,11 @@
828
825
  <optional>
829
826
  <attribute name="scope"/>
830
827
  </optional>
828
+ <optional>
829
+ <attribute name="primary">
830
+ <data type="boolean"/>
831
+ </attribute>
832
+ </optional>
831
833
  <text/>
832
834
  </element>
833
835
  </define>
@@ -12,7 +12,7 @@ module RelatonOmg
12
12
  # @return [RelatonOmg::OmgBibliographicItem]
13
13
  def from_hash(hash)
14
14
  bib_hash = RelatonOmg::HashConverter.hash_to_bib(hash)
15
- new **bib_hash
15
+ new(**bib_hash)
16
16
  end
17
17
 
18
18
  # @param file [String] path to XML file
@@ -12,7 +12,7 @@ module RelatonOmg
12
12
  url = URL_PATTERN + acronym
13
13
  url += "/" + version if version
14
14
  doc = Nokogiri::HTML OpenURI.open_uri(URI(url))
15
- OmgBibliographicItem.new **item(doc, acronym)
15
+ OmgBibliographicItem.new(**item(doc, acronym))
16
16
  rescue OpenURI::HTTPError, URI::InvalidURIError => e
17
17
  if e.is_a?(URI::InvalidURIError) || e.io.status[0] == "404"
18
18
  warn %{[relaton-omg] no document found for "#{ref}" reference.}
@@ -24,7 +24,7 @@ module RelatonOmg
24
24
 
25
25
  private
26
26
 
27
- def item(doc, acronym)
27
+ def item(doc, acronym) # rubocop:disable Metrics/MethodLength
28
28
  {
29
29
  id: fetch_id(doc, acronym),
30
30
  fetched: Date.today.to_s,
@@ -37,7 +37,7 @@ module RelatonOmg
37
37
  link: fetch_link(doc),
38
38
  relation: fetch_relation(doc),
39
39
  keyword: fetch_keyword(doc),
40
- license: fetch_license(doc)
40
+ license: fetch_license(doc),
41
41
  }
42
42
  end
43
43
 
@@ -56,7 +56,7 @@ module RelatonOmg
56
56
  if (ver = version(doc))
57
57
  id << ver
58
58
  end
59
- [RelatonBib::DocumentIdentifier.new(id: id.join(" "), type: "OMG")]
59
+ [RelatonBib::DocumentIdentifier.new(id: id.join(" "), type: "OMG", primary: true)]
60
60
  end
61
61
 
62
62
  def fetch_abstract(doc)
@@ -95,13 +95,13 @@ module RelatonOmg
95
95
  links
96
96
  end
97
97
 
98
- def fetch_relation(doc)
98
+ def fetch_relation(doc) # rubocop:disable Metrics/MethodLength
99
99
  current_version = version(doc)
100
100
  v = doc.xpath('//h2[.="History"]/following-sibling::section/div/table/tbody/tr')
101
101
  v.reduce([]) do |mem, row|
102
102
  ver = row.at("td").text
103
103
  unless ver == current_version
104
- acronym = row.at('td[3]/a')[:href].split("/")[4]
104
+ acronym = row.at("td[3]/a")[:href].split("/")[4]
105
105
  fref = RelatonBib::FormattedRef.new content: "OMG #{acronym} #{ver}"
106
106
  bibitem = OmgBibliographicItem.new formattedref: fref
107
107
  mem << { type: "obsoletes", bibitem: bibitem }
@@ -1,3 +1,3 @@
1
1
  module RelatonOmg
2
- VERSION = "1.10.0".freeze
2
+ VERSION = "1.10.1".freeze
3
3
  end
@@ -17,7 +17,7 @@ module RelatonOmg
17
17
  # @param item_hash [Hash]
18
18
  # @return [RelatonOmg::OmgBibliographicItem]
19
19
  def bib_item(item_hash)
20
- OmgBibliographicItem.new **item_hash
20
+ OmgBibliographicItem.new(**item_hash)
21
21
  end
22
22
  end
23
23
  end
data/relaton_omg.gemspec CHANGED
@@ -34,5 +34,5 @@ Gem::Specification.new do |spec|
34
34
  spec.add_development_dependency "vcr"
35
35
  spec.add_development_dependency "webmock"
36
36
 
37
- spec.add_dependency "relaton-bib", "~> 1.10.0"
37
+ spec.add_dependency "relaton-bib", "~> 1.10.1"
38
38
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: relaton-omg
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.10.0
4
+ version: 1.10.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: 2022-01-30 00:00:00.000000000 Z
11
+ date: 2022-02-08 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: byebug
@@ -114,14 +114,14 @@ dependencies:
114
114
  requirements:
115
115
  - - "~>"
116
116
  - !ruby/object:Gem::Version
117
- version: 1.10.0
117
+ version: 1.10.1
118
118
  type: :runtime
119
119
  prerelease: false
120
120
  version_requirements: !ruby/object:Gem::Requirement
121
121
  requirements:
122
122
  - - "~>"
123
123
  - !ruby/object:Gem::Version
124
- version: 1.10.0
124
+ version: 1.10.1
125
125
  description: 'RelatonOmg: retrieve OMG Standards for bibliographic using the IsoBibliographicItem
126
126
  model'
127
127
  email: