relaton-iso 1.10.0 → 1.11.1
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/Gemfile +0 -3
- data/lib/relaton_iso/iso_bibliography.rb +10 -5
- data/lib/relaton_iso/scrapper.rb +1 -1
- data/lib/relaton_iso/version.rb +1 -1
- data/relaton_iso.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: 57aaa988aba37afa1e4cc8eced55b20d46eda761cad5fc8a68ac33c3793afb82
|
4
|
+
data.tar.gz: 0ff660f7a7ffb558659c9d8577f075cfea9e225c2d9a7bf44d209745b0d7fc76
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8ef87dc1073df8b8653989494fda55f54cdcd780aaaa9d16e0af6e0ec6778021d73a2e81b23b18b751e95b2c607f6c27a49af50d8df1bbb95c7d9b7df76e3977
|
7
|
+
data.tar.gz: 154c64258dfc69a6ae01822593e0e9759648cc2f773c126f4474cd0aad8483a16e208613ccd582e94f4ea38c4c996cee089c5d5b844782f93ae2ec33be17151c
|
data/Gemfile
CHANGED
@@ -31,8 +31,7 @@ module RelatonIso
|
|
31
31
|
def get(ref, year = nil, opts = {}) # rubocop:disable Metrics/CyclomaticComplexity,Metrics/MethodLength,Metrics/PerceivedComplexity,Metrics/AbcSize
|
32
32
|
code = ref.gsub(/\u2013/, "-")
|
33
33
|
# %r{\s(?<num>\d+)(?:-(?<part>[\d-]+))?(?::(?<year1>\d{4}))?} =~ code
|
34
|
-
|
35
|
-
year ||= year1
|
34
|
+
year ||= publish_year ref
|
36
35
|
code.sub! " (all parts)", ""
|
37
36
|
opts[:all_parts] ||= $~ && opts[:all_parts].nil?
|
38
37
|
# opts[:keep_year] ||= opts[:keep_year].nil?
|
@@ -41,7 +40,7 @@ module RelatonIso
|
|
41
40
|
# return RelatonIec::IecBibliography.get(code, year, opts)
|
42
41
|
# end
|
43
42
|
|
44
|
-
ret =
|
43
|
+
ret = isobib_get(code, year, opts)
|
45
44
|
return nil if ret.nil?
|
46
45
|
|
47
46
|
if (year && opts[:keep_year].nil?) || opts[:keep_year] || opts[:all_parts]
|
@@ -166,7 +165,8 @@ module RelatonIso
|
|
166
165
|
def isobib_results_filter(result, year, opts)
|
167
166
|
missed_years = []
|
168
167
|
hits = result.reduce!([]) do |hts, h|
|
169
|
-
|
168
|
+
iyear = publish_year h.hit[:title]
|
169
|
+
if !year || iyear == year
|
170
170
|
hts << h
|
171
171
|
else
|
172
172
|
missed_years << iyear
|
@@ -183,10 +183,15 @@ module RelatonIso
|
|
183
183
|
end
|
184
184
|
# rubocop:enable Metrics/AbcSize, Metrics/CyclomaticComplexity, Metrics/MethodLength, Metrics/PerceivedComplexity
|
185
185
|
|
186
|
+
def publish_year(ref)
|
187
|
+
%r{:(?<year>\d{4})(?!.*:\d{4})} =~ ref
|
188
|
+
year
|
189
|
+
end
|
190
|
+
|
186
191
|
# @param code [String]
|
187
192
|
# @param year [String, NilClass]
|
188
193
|
# @param opts [Hash]
|
189
|
-
def
|
194
|
+
def isobib_get(code, year, opts)
|
190
195
|
# return iev(code) if /^IEC 60050-/.match code
|
191
196
|
result = isobib_search_filter(code, opts) || return
|
192
197
|
ret = isobib_results_filter(result, year, opts)
|
data/lib/relaton_iso/scrapper.rb
CHANGED
@@ -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
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.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-
|
11
|
+
date: 2022-05-03 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:
|