relaton-iso 1.7.5 → 1.8.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/relaton_iso/hit_collection.rb +4 -4
- data/lib/relaton_iso/iso_bibliography.rb +6 -6
- data/lib/relaton_iso/version.rb +1 -1
- data/relaton_iso.gemspec +2 -2
- metadata +4 -18
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 61646e164a8a384cb744e3e50dafdea336f74cbf7418b59d1b5a30e8aabeea62
|
4
|
+
data.tar.gz: f3c861c4fd11e792f9bd7d7edd0e83d95a5972c6e1590825ce0562360cc5f0d6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 073cf929ab4f17e00651c03443b4bc0d21526994ebd5532a5914f841066f4ec6522d58344ddabf09e69f409243c59c6c721db2a3c1c38c9784b6211cd48d9982
|
7
|
+
data.tar.gz: 2e710926a48e59aba377f89cea8589f4dbb0abe0ddd53a906d9463faf7adf70681f8ef8d8b68f30d8398c9db4b9859a898b243ec53f5f2010dd7bd5a8e99b086
|
@@ -41,7 +41,7 @@ module RelatonIso
|
|
41
41
|
#
|
42
42
|
# @return [Array<RelatonIso::Hit]
|
43
43
|
#
|
44
|
-
def fetch_github
|
44
|
+
def fetch_github # rubocop:disable Metrics/AbcSize
|
45
45
|
ref = text.gsub(/[\s\/]/, "_").upcase
|
46
46
|
url = "https://raw.githubusercontent.com/relaton/relaton-data-iso/main/data/#{ref}.yaml"
|
47
47
|
resp = Net::HTTP.get_response URI(url)
|
@@ -60,8 +60,8 @@ module RelatonIso
|
|
60
60
|
#
|
61
61
|
# @return [Array<RelatonIso::Hit>]
|
62
62
|
#
|
63
|
-
def fetch_iso
|
64
|
-
%r{\s(?<num>\d+)(
|
63
|
+
def fetch_iso # rubocop:disable Metrics/AbcSize,Metrics/MethodLength
|
64
|
+
%r{\s(?<num>\d+)(?:-(?<part>[\d-]+))?} =~ text
|
65
65
|
http = Net::HTTP.new "www.iso.org", 443
|
66
66
|
http.use_ssl = true
|
67
67
|
search = ["status=ENT_ACTIVE,ENT_PROGRESS,ENT_INACTIVE,ENT_DELETED"]
|
@@ -70,7 +70,7 @@ module RelatonIso
|
|
70
70
|
q = search.join "&"
|
71
71
|
resp = http.get("/cms/render/live/en/sites/isoorg.advancedSearch.do?#{q}",
|
72
72
|
"Accept" => "application/json, text/plain, */*")
|
73
|
-
return if resp.body.empty?
|
73
|
+
return [] if resp.body.empty?
|
74
74
|
|
75
75
|
json = JSON.parse resp.body
|
76
76
|
json["standards"].map { |h| Hit.new h, self }.sort! do |a, b|
|
@@ -3,7 +3,7 @@
|
|
3
3
|
# require 'relaton_iso/iso_bibliographic_item'
|
4
4
|
require "relaton_iso/scrapper"
|
5
5
|
require "relaton_iso/hit_collection"
|
6
|
-
require "relaton_iec"
|
6
|
+
# require "relaton_iec"
|
7
7
|
|
8
8
|
module RelatonIso
|
9
9
|
# Class methods for search ISO standards.
|
@@ -120,7 +120,7 @@ module RelatonIso
|
|
120
120
|
# @param code [String]
|
121
121
|
# @param opts [Hash]
|
122
122
|
# @return [RelatonIso::HitCollection]
|
123
|
-
def search_code(result, code,
|
123
|
+
def search_code(result, code, _opts) # rubocop:disable Metrics/AbcSize,Metrics/CyclomaticComplexity
|
124
124
|
code1, part1, corr1, coryear1 = ref_components code
|
125
125
|
result.select do |i|
|
126
126
|
code2, part2, corr2, coryear2 = ref_components i.hit["docRef"]
|
@@ -131,12 +131,12 @@ module RelatonIso
|
|
131
131
|
|
132
132
|
def ref_components(ref)
|
133
133
|
%r{
|
134
|
-
^(?<code>ISO(?:\s
|
135
|
-
(?:-(?<part>[
|
134
|
+
^(?<code>ISO(?:\s|/)[^-/:()]+)
|
135
|
+
(?:-(?<part>[^:/]+))?
|
136
136
|
(?::\d{4})?
|
137
|
-
(
|
137
|
+
(?:/(?<corr>\w+(?:\s\w+)?\s\d+)(?:(?<coryear>\d{4}))?)?
|
138
138
|
}x =~ ref
|
139
|
-
[code, part, corr, coryear]
|
139
|
+
[code&.strip, part, corr, coryear]
|
140
140
|
end
|
141
141
|
|
142
142
|
# rubocop:disable Metrics/AbcSize, Metrics/CyclomaticComplexity, Metrics/MethodLength, Metrics/PerceivedComplexity
|
data/lib/relaton_iso/version.rb
CHANGED
data/relaton_iso.gemspec
CHANGED
@@ -37,6 +37,6 @@ Gem::Specification.new do |spec|
|
|
37
37
|
spec.add_development_dependency "vcr"
|
38
38
|
spec.add_development_dependency "webmock"
|
39
39
|
|
40
|
-
spec.add_dependency "relaton-iec", "~> 1.
|
41
|
-
spec.add_dependency "relaton-iso-bib", "~> 1.
|
40
|
+
# spec.add_dependency "relaton-iec", "~> 1.8.0"
|
41
|
+
spec.add_dependency "relaton-iso-bib", "~> 1.8.0"
|
42
42
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: relaton-iso
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.8.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ribose Inc.
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-05-
|
11
|
+
date: 2021-05-17 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: byebug
|
@@ -122,34 +122,20 @@ dependencies:
|
|
122
122
|
- - ">="
|
123
123
|
- !ruby/object:Gem::Version
|
124
124
|
version: '0'
|
125
|
-
- !ruby/object:Gem::Dependency
|
126
|
-
name: relaton-iec
|
127
|
-
requirement: !ruby/object:Gem::Requirement
|
128
|
-
requirements:
|
129
|
-
- - "~>"
|
130
|
-
- !ruby/object:Gem::Version
|
131
|
-
version: 1.7.0
|
132
|
-
type: :runtime
|
133
|
-
prerelease: false
|
134
|
-
version_requirements: !ruby/object:Gem::Requirement
|
135
|
-
requirements:
|
136
|
-
- - "~>"
|
137
|
-
- !ruby/object:Gem::Version
|
138
|
-
version: 1.7.0
|
139
125
|
- !ruby/object:Gem::Dependency
|
140
126
|
name: relaton-iso-bib
|
141
127
|
requirement: !ruby/object:Gem::Requirement
|
142
128
|
requirements:
|
143
129
|
- - "~>"
|
144
130
|
- !ruby/object:Gem::Version
|
145
|
-
version: 1.
|
131
|
+
version: 1.8.0
|
146
132
|
type: :runtime
|
147
133
|
prerelease: false
|
148
134
|
version_requirements: !ruby/object:Gem::Requirement
|
149
135
|
requirements:
|
150
136
|
- - "~>"
|
151
137
|
- !ruby/object:Gem::Version
|
152
|
-
version: 1.
|
138
|
+
version: 1.8.0
|
153
139
|
description: 'RelatonIso: retrieve ISO Standards for bibliographic use using the IsoBibliographicItem
|
154
140
|
model'
|
155
141
|
email:
|