relaton-iso 0.11.0 → 0.12.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/lib/relaton_iso/hit_collection.rb +3 -3
- data/lib/relaton_iso/iso_bibliography.rb +10 -7
- data/lib/relaton_iso/version.rb +1 -1
- data/relaton_iso.gemspec +2 -2
- metadata +6 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2334ffda7e49dc483b780f97c78e6e8100fdfbf25f7939cd7f2c4a453c5703c6
|
4
|
+
data.tar.gz: 0c12c9fd413d9f5e6d45b2ea8ac0eaa475b8c3fb9e16dd7e7e2efb7a4b4a7889
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 63da30578ae34e3ead33586a4e1ad2c8e5821202b5f1de2e201f6f9f80a69288bef0cf148d665a6f5afb3e29cbce26bcff7ab26ccd79a25bf882f278d70b3391
|
7
|
+
data.tar.gz: a6289b3d1bbd8c355b1d4f73ba0f80d14988db803cb6af96296197103e5c7928fb8c40f99defbef6502cf5385709e391d683d79a4ceffa32f18dc2cf6a3bf51f
|
@@ -37,16 +37,16 @@ module RelatonIso
|
|
37
37
|
return @array.first.fetch lang unless hit
|
38
38
|
|
39
39
|
bibitem = hit.fetch lang
|
40
|
-
bibitem.to_all_parts
|
40
|
+
all_parts_item = bibitem.to_all_parts
|
41
41
|
parts.reject { |h| h.hit["docRef"] == hit.hit["docRef"] }.each do |hi|
|
42
42
|
isobib = RelatonIsoBib::IsoBibliographicItem.new(
|
43
43
|
formattedref: RelatonBib::FormattedRef.new(content: hi.hit["docRef"]),
|
44
44
|
)
|
45
|
-
|
45
|
+
all_parts_item.relation << RelatonBib::DocumentRelation.new(
|
46
46
|
type: "instance", bibitem: isobib,
|
47
47
|
)
|
48
48
|
end
|
49
|
-
|
49
|
+
all_parts_item
|
50
50
|
end
|
51
51
|
|
52
52
|
private
|
@@ -49,23 +49,26 @@ module RelatonIso
|
|
49
49
|
ret = isobib_get1(code, year, corr, opts)
|
50
50
|
return nil if ret.nil?
|
51
51
|
|
52
|
-
|
53
|
-
|
52
|
+
if year || opts[:keep_year] || opts[:all_parts]
|
53
|
+
ret
|
54
|
+
else
|
55
|
+
ret.to_most_recent_reference
|
56
|
+
end
|
54
57
|
end
|
55
58
|
|
56
59
|
private
|
57
60
|
|
58
61
|
def fetch_ref_err(code, year, missed_years)
|
59
62
|
id = year ? "#{code}:#{year}" : code
|
60
|
-
warn "WARNING: no match found online for #{id}. "\
|
63
|
+
warn "[relaton-iso] WARNING: no match found online for #{id}. "\
|
61
64
|
"The code must be exactly like it is on the standards website."
|
62
|
-
warn "(There was no match for #{year}, though there were matches "\
|
65
|
+
warn "[relaton-iso] (There was no match for #{year}, though there were matches "\
|
63
66
|
"found for #{missed_years.join(', ')}.)" unless missed_years.empty?
|
64
67
|
if /\d-\d/ =~ code
|
65
|
-
warn "The provided document part may not exist, or the document "\
|
68
|
+
warn "[relaton-iso] The provided document part may not exist, or the document "\
|
66
69
|
"may no longer be published in parts."
|
67
70
|
else
|
68
|
-
warn "If you wanted to cite all document parts for the reference, "\
|
71
|
+
warn "[relaton-iso] If you wanted to cite all document parts for the reference, "\
|
69
72
|
"use \"#{code} (all parts)\".\nIf the document is not a standard, "\
|
70
73
|
"use its document type abbreviation (TS, TR, PAS, Guide)."
|
71
74
|
end
|
@@ -130,7 +133,7 @@ module RelatonIso
|
|
130
133
|
(opts[:all_parts] || i.hit["docRef"] =~ %r{^#{code}(?!-)}) && (
|
131
134
|
corr && %r{^#{code}[\w-]*(:\d{4})?/#{corr}} =~ i.hit["docRef"] ||
|
132
135
|
!corr && %r{^#{code}[\w-]*(:\d{4})?/} !~ i.hit["docRef"]
|
133
|
-
|
136
|
+
) # && %r{^#{code}} =~ i.hit["docRef"]
|
134
137
|
end
|
135
138
|
end
|
136
139
|
|
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", "~> 0.
|
41
|
-
spec.add_dependency "relaton-iso-bib", "~> 0.
|
40
|
+
spec.add_dependency "relaton-iec", "~> 0.10.0"
|
41
|
+
spec.add_dependency "relaton-iso-bib", "~> 0.9.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: 0.
|
4
|
+
version: 0.12.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: 2020-
|
11
|
+
date: 2020-03-30 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: byebug
|
@@ -156,28 +156,28 @@ dependencies:
|
|
156
156
|
requirements:
|
157
157
|
- - "~>"
|
158
158
|
- !ruby/object:Gem::Version
|
159
|
-
version: 0.
|
159
|
+
version: 0.10.0
|
160
160
|
type: :runtime
|
161
161
|
prerelease: false
|
162
162
|
version_requirements: !ruby/object:Gem::Requirement
|
163
163
|
requirements:
|
164
164
|
- - "~>"
|
165
165
|
- !ruby/object:Gem::Version
|
166
|
-
version: 0.
|
166
|
+
version: 0.10.0
|
167
167
|
- !ruby/object:Gem::Dependency
|
168
168
|
name: relaton-iso-bib
|
169
169
|
requirement: !ruby/object:Gem::Requirement
|
170
170
|
requirements:
|
171
171
|
- - "~>"
|
172
172
|
- !ruby/object:Gem::Version
|
173
|
-
version: 0.
|
173
|
+
version: 0.9.0
|
174
174
|
type: :runtime
|
175
175
|
prerelease: false
|
176
176
|
version_requirements: !ruby/object:Gem::Requirement
|
177
177
|
requirements:
|
178
178
|
- - "~>"
|
179
179
|
- !ruby/object:Gem::Version
|
180
|
-
version: 0.
|
180
|
+
version: 0.9.0
|
181
181
|
description: 'RelatonIso: retrieve ISO Standards for bibliographic use using the IsoBibliographicItem
|
182
182
|
model'
|
183
183
|
email:
|