relaton-iso 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/Gemfile +0 -3
- data/lib/relaton_iso/iso_bibliography.rb +10 -5
- data/lib/relaton_iso/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: 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/version.rb
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.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-
|
11
|
+
date: 2022-05-03 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: byebug
|