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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 5bdab8ba35f329c71ab5d5727467507fbc7f3f39d2ae590049fe011de62afd07
4
- data.tar.gz: ad7cc4e71c4658dfdcd895829a1326d92931b9a22ab84a79f7efce0603a96594
3
+ metadata.gz: fefb5094555823591ad1e2193663adf0fe54bf836cd84e5888264a6c177ece91
4
+ data.tar.gz: 3303ea852975eebcf39cd70ed5893018c47ad359e0191ecbc90bcfcbdef73f16
5
5
  SHA512:
6
- metadata.gz: 85840d46dc0218f3bb865ad897998b1b16448ea28243138ee3bdeeed3d1fcc923512a3d1cce2788683135f72dddab8d625eeee79ffdf9118f2b2c3f60749f03e
7
- data.tar.gz: c652e13e1597a3b09790fc7c662228561593329136d5abbb2dc175feb128650454ecd84b615c28e9f04d7d9dd4ab864ad1b0f5b31cd02b713c00f58d43435a07
6
+ metadata.gz: 4ac918dba0c0fb4d20a3c6f58b66d7435b830c91022761911688ae8bbc474446cda4f04b67ffc2a864df415dccc6eef02a56e69495d37ce00686a6075e73188f
7
+ data.tar.gz: a512281190f1fa8fafa0a937de563a689c9117427b0e7a3e238924d3250945d98fe0a9cb52ed15b746eb931a79c675a8745de0e9c0a217ae267b6824db78bad2
@@ -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 += "/" + 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
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
@@ -1,3 +1,3 @@
1
1
  module RelatonOmg
2
- VERSION = "1.11.0".freeze
2
+ VERSION = "1.11.1".freeze
3
3
  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.11.0
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-10 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