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 +4 -4
- data/grammars/biblio.rng +24 -1
- data/lib/relaton_omg/scrapper.rb +6 -6
- data/lib/relaton_omg/version.rb +1 -1
- data/relaton_omg.gemspec +1 -1
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a9123661919e1997f9de01973768d2917658fffd128101550d4610a09bb4a2ba
|
4
|
+
data.tar.gz: b6c37ef10b2369fe8cf404ea3b1235deda5ffe4425fa4727f156745318b96e48
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
-
<
|
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">
|
data/lib/relaton_omg/scrapper.rb
CHANGED
@@ -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 += "
|
14
|
-
doc = Nokogiri::HTML OpenURI.open_uri(
|
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
|
data/lib/relaton_omg/version.rb
CHANGED
data/relaton_omg.gemspec
CHANGED
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.
|
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-
|
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.
|
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.
|
124
|
+
version: 1.11.0
|
125
125
|
description: 'RelatonOmg: retrieve OMG Standards for bibliographic using the IsoBibliographicItem
|
126
126
|
model'
|
127
127
|
email:
|