relaton-iso 1.9.1 → 1.11.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.rubocop.yml +2 -0
- data/lib/relaton_iso/iso_bibliography.rb +6 -4
- data/lib/relaton_iso/processor.rb +1 -1
- data/lib/relaton_iso/scrapper.rb +2 -2
- data/lib/relaton_iso/version.rb +1 -1
- data/relaton_iso.gemspec +2 -2
- metadata +5 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f7fa7c91589b331ac4748d70c790b814bd294b73c8c35c12a1e7a6a2fa54ca38
|
4
|
+
data.tar.gz: 64ea8882a8c4ec26278f4bea0b8af25879b7ead65cc156117dadbeab8b606400
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1c8716c7c2ddb6fb8644b528cbddccf2c900897326b1f3897946247886e21c25452f71783cc696ba44cba7a2247b11577085c71f780c91fb060f4d72748c1af4
|
7
|
+
data.tar.gz: 1a91a1433ddf1312edb01e15348207573ed30f5d022b376757b2fda69ad8ae4be62090e726a8baede35e1ff3cdf95dcf5146bd863c6758e5dea4ccc047309dd8
|
data/.rubocop.yml
CHANGED
@@ -23,8 +23,10 @@ module RelatonIso
|
|
23
23
|
# @param ref [String] the ISO standard Code to look up (e..g "ISO 9000")
|
24
24
|
# @param year [String, NilClass] the year the standard was published
|
25
25
|
# @param opts [Hash] options; restricted to :all_parts if all-parts
|
26
|
-
#
|
27
|
-
#
|
26
|
+
# @option opts [Boolean] :all_parts if all-parts reference is required
|
27
|
+
# @option opts [Boolean] :keep_year if undated reference should return
|
28
|
+
# actual reference with year
|
29
|
+
#
|
28
30
|
# @return [String] Relaton XML serialisation of reference
|
29
31
|
def get(ref, year = nil, opts = {}) # rubocop:disable Metrics/CyclomaticComplexity,Metrics/MethodLength,Metrics/PerceivedComplexity,Metrics/AbcSize
|
30
32
|
code = ref.gsub(/\u2013/, "-")
|
@@ -42,7 +44,7 @@ module RelatonIso
|
|
42
44
|
ret = isobib_get1(code, year, opts)
|
43
45
|
return nil if ret.nil?
|
44
46
|
|
45
|
-
if year && opts[:keep_year].nil? || opts[:keep_year] || opts[:all_parts]
|
47
|
+
if (year && opts[:keep_year].nil?) || opts[:keep_year] || opts[:all_parts]
|
46
48
|
ret
|
47
49
|
else
|
48
50
|
ret.to_most_recent_reference
|
@@ -143,7 +145,7 @@ module RelatonIso
|
|
143
145
|
# @param code [String]
|
144
146
|
# @param opts [Hash]
|
145
147
|
# @return [RelatonIso::HitCollection]
|
146
|
-
def search_code(result, code, opts) # rubocop:disable Metrics/AbcSize,Metrics/CyclomaticComplexity,PerceivedComplexity
|
148
|
+
def search_code(result, code, opts) # rubocop:disable Metrics/AbcSize,Metrics/CyclomaticComplexity,Metrics/PerceivedComplexity
|
147
149
|
code1, part1, _, corr1, coryear1 = ref_components code
|
148
150
|
result.select do |i|
|
149
151
|
code2, part2, _, corr2, coryear2 = ref_components i.hit[:title]
|
@@ -29,7 +29,7 @@ module RelatonIso
|
|
29
29
|
# @return [RelatonIsoBib::IsoBibliographicItem]
|
30
30
|
def hash_to_bib(hash)
|
31
31
|
item_hash = ::RelatonIsoBib::HashConverter.hash_to_bib(hash)
|
32
|
-
::RelatonIsoBib::IsoBibliographicItem.new
|
32
|
+
::RelatonIsoBib::IsoBibliographicItem.new(**item_hash)
|
33
33
|
end
|
34
34
|
|
35
35
|
# Returns hash of XML grammar
|
data/lib/relaton_iso/scrapper.rb
CHANGED
@@ -152,7 +152,7 @@ module RelatonIso
|
|
152
152
|
url = DOMAIN + path
|
153
153
|
uri = URI url
|
154
154
|
resp = Net::HTTP.get_response(uri) # .encode("UTF-8")
|
155
|
-
when "404"
|
155
|
+
when "404", "302"
|
156
156
|
raise RelatonBib::RequestError, "#{url} not found."
|
157
157
|
end
|
158
158
|
n = 0
|
@@ -176,7 +176,7 @@ module RelatonIso
|
|
176
176
|
def fetch_docid(doc, edition, langs)
|
177
177
|
pubid = item_ref doc
|
178
178
|
[
|
179
|
-
RelatonBib::DocumentIdentifier.new(id: pubid, type: "ISO"),
|
179
|
+
RelatonBib::DocumentIdentifier.new(id: pubid, type: "ISO", primary: true),
|
180
180
|
RelatonBib::DocumentIdentifier.new(
|
181
181
|
id: fetch_urn(doc, pubid, edition, langs), type: "URN",
|
182
182
|
),
|
data/lib/relaton_iso/version.rb
CHANGED
data/relaton_iso.gemspec
CHANGED
@@ -24,7 +24,7 @@ Gem::Specification.new do |spec|
|
|
24
24
|
spec.bindir = "exe"
|
25
25
|
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
26
26
|
spec.require_paths = ["lib"]
|
27
|
-
spec.required_ruby_version = Gem::Requirement.new(">= 2.
|
27
|
+
spec.required_ruby_version = Gem::Requirement.new(">= 2.5.0")
|
28
28
|
|
29
29
|
spec.add_development_dependency "byebug"
|
30
30
|
# spec.add_development_dependency "debase"
|
@@ -42,5 +42,5 @@ Gem::Specification.new do |spec|
|
|
42
42
|
|
43
43
|
# spec.add_dependency "relaton-iec", "~> 1.8.0"
|
44
44
|
spec.add_dependency "algolia"
|
45
|
-
spec.add_dependency "relaton-iso-bib", "~> 1.
|
45
|
+
spec.add_dependency "relaton-iso-bib", "~> 1.11.0"
|
46
46
|
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.11.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:
|
11
|
+
date: 2022-04-10 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: byebug
|
@@ -184,14 +184,14 @@ dependencies:
|
|
184
184
|
requirements:
|
185
185
|
- - "~>"
|
186
186
|
- !ruby/object:Gem::Version
|
187
|
-
version: 1.
|
187
|
+
version: 1.11.0
|
188
188
|
type: :runtime
|
189
189
|
prerelease: false
|
190
190
|
version_requirements: !ruby/object:Gem::Requirement
|
191
191
|
requirements:
|
192
192
|
- - "~>"
|
193
193
|
- !ruby/object:Gem::Version
|
194
|
-
version: 1.
|
194
|
+
version: 1.11.0
|
195
195
|
description: 'RelatonIso: retrieve ISO Standards for bibliographic use using the IsoBibliographicItem
|
196
196
|
model'
|
197
197
|
email:
|
@@ -250,7 +250,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
250
250
|
requirements:
|
251
251
|
- - ">="
|
252
252
|
- !ruby/object:Gem::Version
|
253
|
-
version: 2.
|
253
|
+
version: 2.5.0
|
254
254
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
255
255
|
requirements:
|
256
256
|
- - ">="
|