relaton-omg 1.10.1 → 1.11.2

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: 25e974b4ee6e3252b54de2b60046e8f6a663da8243e7faf4bf7a3534a5df2000
4
- data.tar.gz: 7dd39b0a40d2b466182f3cbbb330f71fa52d1b7a3b35e27a7dd1211bffc88d03
3
+ metadata.gz: a9123661919e1997f9de01973768d2917658fffd128101550d4610a09bb4a2ba
4
+ data.tar.gz: b6c37ef10b2369fe8cf404ea3b1235deda5ffe4425fa4727f156745318b96e48
5
5
  SHA512:
6
- metadata.gz: 7257fc7500c4c82d086a961e42c51cbb73b718c138bd70902d70f7bbb74ad84242414b4f81149a0573c444f3da8c5fc343ebdbb324ac48b3060b8a405a8c2cd6
7
- data.tar.gz: 89e56ff2c08ffe8e4fcca291ff9ab0fa527992aeb16229c137d7686a412e6678b3e0e27dbec506c03fa60c016e11bdd891088663d9bf63ba5a671944d610a0e8
6
+ metadata.gz: 349b1a17c8d0edeffea739781d4a883836e83e7cd8f166d27a2778d1b2f2d8dc25cba78e6ecd0e44845ebe9633d454396d2584897d8b62536dbde67994881d71
7
+ data.tar.gz: a4598a213af30fa78df50993170ae40e15427197d86e54fd61b5a0741b517ea8a7e05f11f73a1c436e1657b2bee998b01885226f32821f81f72e2d1f9a872d81
data/grammars/biblio.rng CHANGED
@@ -677,6 +677,9 @@
677
677
  <zeroOrMore>
678
678
  <ref name="extent"/>
679
679
  </zeroOrMore>
680
+ <optional>
681
+ <ref name="bibliographic_size"/>
682
+ </optional>
680
683
  <zeroOrMore>
681
684
  <ref name="accesslocation"/>
682
685
  </zeroOrMore>
@@ -922,9 +925,29 @@
922
925
  <text/>
923
926
  </element>
924
927
  </define>
928
+ <define name="sizevalue">
929
+ <element name="value">
930
+ <attribute name="type"/>
931
+ <text/>
932
+ </element>
933
+ </define>
934
+ <define name="bibliographic_size">
935
+ <element name="size">
936
+ <oneOrMore>
937
+ <ref name="sizevalue"/>
938
+ </oneOrMore>
939
+ </element>
940
+ </define>
925
941
  <define name="extent">
926
942
  <element name="extent">
927
- <ref name="BibItemLocality"/>
943
+ <choice>
944
+ <zeroOrMore>
945
+ <ref name="locality"/>
946
+ </zeroOrMore>
947
+ <zeroOrMore>
948
+ <ref name="localityStack"/>
949
+ </zeroOrMore>
950
+ </choice>
928
951
  </element>
929
952
  </define>
930
953
  <define name="series">
@@ -2,18 +2,18 @@ require "nokogiri"
2
2
 
3
3
  module RelatonOmg
4
4
  module Scrapper
5
- URL_PATTERN = "https://www.omg.org/spec/"
5
+ URL_PATTERN = "https://www.omg.org/spec/".freeze
6
6
 
7
7
  class << self
8
- def scrape_page(ref)
8
+ def scrape_page(ref) # rubocop:disable Metrics/AbcSize, Metrics/MethodLength
9
9
  %r{OMG (?<acronym>[^\s]+)\s?(?<version>.*)} =~ ref
10
10
  return unless acronym
11
11
 
12
12
  url = URL_PATTERN + acronym
13
- url += "/" + version if version
14
- doc = Nokogiri::HTML OpenURI.open_uri(URI(url))
13
+ url += "/#{version}" if version
14
+ doc = Nokogiri::HTML OpenURI.open_uri(url, open_timeout: 10)
15
15
  OmgBibliographicItem.new(**item(doc, acronym))
16
- rescue OpenURI::HTTPError, URI::InvalidURIError => e
16
+ rescue OpenURI::HTTPError, URI::InvalidURIError, Net::OpenTimeout => 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.}
19
19
  return
@@ -116,7 +116,7 @@ module RelatonOmg
116
116
 
117
117
  def fetch_license(doc)
118
118
  doc.xpath(
119
- '//dt/span/a[contains(., "IPR Mode")]/../../following-sibling::dd/span'
119
+ '//dt/span/a[contains(., "IPR Mode")]/../../following-sibling::dd/span',
120
120
  ).map { |l| l.text.match(/[\w\s-]+/).to_s.strip }
121
121
  end
122
122
  end
@@ -1,3 +1,3 @@
1
1
  module RelatonOmg
2
- VERSION = "1.10.1".freeze
2
+ VERSION = "1.11.2".freeze
3
3
  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.1"
37
+ spec.add_dependency "relaton-bib", "~> 1.11.0"
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.1
4
+ version: 1.11.2
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-02-08 00:00:00.000000000 Z
11
+ date: 2022-04-14 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.1
117
+ version: 1.11.0
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.1
124
+ version: 1.11.0
125
125
  description: 'RelatonOmg: retrieve OMG Standards for bibliographic using the IsoBibliographicItem
126
126
  model'
127
127
  email: