relaton-omg 1.11.0 → 1.11.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/relaton_omg/scrapper.rb +5 -5
- data/lib/relaton_omg/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: fefb5094555823591ad1e2193663adf0fe54bf836cd84e5888264a6c177ece91
|
4
|
+
data.tar.gz: 3303ea852975eebcf39cd70ed5893018c47ad359e0191ecbc90bcfcbdef73f16
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4ac918dba0c0fb4d20a3c6f58b66d7435b830c91022761911688ae8bbc474446cda4f04b67ffc2a864df415dccc6eef02a56e69495d37ce00686a6075e73188f
|
7
|
+
data.tar.gz: a512281190f1fa8fafa0a937de563a689c9117427b0e7a3e238924d3250945d98fe0a9cb52ed15b746eb931a79c675a8745de0e9c0a217ae267b6824db78bad2
|
data/lib/relaton_omg/scrapper.rb
CHANGED
@@ -2,16 +2,16 @@ 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
16
|
rescue OpenURI::HTTPError, URI::InvalidURIError => e
|
17
17
|
if e.is_a?(URI::InvalidURIError) || e.io.status[0] == "404"
|
@@ -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
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.11.
|
4
|
+
version: 1.11.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-04-
|
11
|
+
date: 2022-04-14 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: byebug
|