relaton-iso 1.13.6 → 1.13.7
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.rb +15 -0
- data/lib/relaton_iso/iso_bibliography.rb +4 -1
- data/lib/relaton_iso/scrapper.rb +0 -1
- data/lib/relaton_iso/version.rb +1 -1
- data/relaton_iso.gemspec +1 -2
- metadata +6 -20
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 64446d11a9b8ff146087a41ea017e7df943c1d4453ce213aa0ce9a15afd9fa12
|
4
|
+
data.tar.gz: 557da1af0ed0723f8e48bf21e447937b70888294c514a2e6df970a99d662dfaf
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 831fad8c654c5342b588f7fc6d4c504ce1459b68fe050d3a3d1508288f540d6c9979c09b2c5dd1fbdd472cbe632d8a639942b17854a808ed9a7e13a60d50d733
|
7
|
+
data.tar.gz: 9452ff39391c29dae9daf6a4efe25a7afbd9a65b17ebef8174ab6544cb67667b593646ef2dfdf393dfff42336f3d1ccb07fa909a1b05a71f1f10cfd367ecfc08
|
data/lib/relaton_iso/hit.rb
CHANGED
@@ -6,11 +6,26 @@ module RelatonIso
|
|
6
6
|
# @return [RelatonIsoBib::IsoBibliographicItem]
|
7
7
|
attr_writer :fetch, :pubid
|
8
8
|
|
9
|
+
# Update edition for pubid when provided in Bibliographic Item
|
10
|
+
def update_edition(bibliographic_item)
|
11
|
+
if bibliographic_item.edition
|
12
|
+
# add edition to base document if available
|
13
|
+
if pubid.base
|
14
|
+
pubid.base.edition = bibliographic_item.edition.content
|
15
|
+
else
|
16
|
+
pubid.edition = bibliographic_item.edition.content
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
20
|
+
|
9
21
|
# Parse page.
|
10
22
|
# @param lang [String, nil]
|
11
23
|
# @return [RelatonIso::IsoBibliographicItem]
|
12
24
|
def fetch(lang = nil)
|
13
25
|
@fetch ||= Scrapper.parse_page self, lang
|
26
|
+
# update edition for pubid using fetched data
|
27
|
+
update_edition(@fetch)
|
28
|
+
@fetch
|
14
29
|
end
|
15
30
|
|
16
31
|
# @return [Integer]
|
@@ -117,7 +117,10 @@ module RelatonIso
|
|
117
117
|
|
118
118
|
# filter by year
|
119
119
|
hits = hit_collection.select do |hit|
|
120
|
-
if hit.pubid.year.to_s == year.to_s
|
120
|
+
if (hit.pubid.base.nil? && hit.pubid.year.to_s == year.to_s) ||
|
121
|
+
(!hit.pubid.base.nil? && hit.pubid.base.year.to_s == year.to_s)
|
122
|
+
true
|
123
|
+
elsif (!hit.pubid.base.nil? && hit.pubid.year.to_s == year.to_s)
|
121
124
|
true
|
122
125
|
elsif hit.pubid.year.nil? && hit.hit[:year].to_s == year
|
123
126
|
hit.pubid.year = year
|
data/lib/relaton_iso/scrapper.rb
CHANGED
data/lib/relaton_iso/version.rb
CHANGED
data/relaton_iso.gemspec
CHANGED
@@ -39,7 +39,6 @@ Gem::Specification.new do |spec|
|
|
39
39
|
spec.add_development_dependency "webmock"
|
40
40
|
|
41
41
|
spec.add_dependency "algolia"
|
42
|
-
spec.add_dependency "pubid-
|
43
|
-
spec.add_dependency "pubid-iso", "0.2.1"
|
42
|
+
spec.add_dependency "pubid-iso", "~> 0.3.0"
|
44
43
|
spec.add_dependency "relaton-iso-bib", "~> 1.13.0"
|
45
44
|
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.13.
|
4
|
+
version: 1.13.7
|
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-11-02 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: byebug
|
@@ -178,34 +178,20 @@ dependencies:
|
|
178
178
|
- - ">="
|
179
179
|
- !ruby/object:Gem::Version
|
180
180
|
version: '0'
|
181
|
-
- !ruby/object:Gem::Dependency
|
182
|
-
name: pubid-core
|
183
|
-
requirement: !ruby/object:Gem::Requirement
|
184
|
-
requirements:
|
185
|
-
- - '='
|
186
|
-
- !ruby/object:Gem::Version
|
187
|
-
version: 1.2.1
|
188
|
-
type: :runtime
|
189
|
-
prerelease: false
|
190
|
-
version_requirements: !ruby/object:Gem::Requirement
|
191
|
-
requirements:
|
192
|
-
- - '='
|
193
|
-
- !ruby/object:Gem::Version
|
194
|
-
version: 1.2.1
|
195
181
|
- !ruby/object:Gem::Dependency
|
196
182
|
name: pubid-iso
|
197
183
|
requirement: !ruby/object:Gem::Requirement
|
198
184
|
requirements:
|
199
|
-
- -
|
185
|
+
- - "~>"
|
200
186
|
- !ruby/object:Gem::Version
|
201
|
-
version: 0.
|
187
|
+
version: 0.3.0
|
202
188
|
type: :runtime
|
203
189
|
prerelease: false
|
204
190
|
version_requirements: !ruby/object:Gem::Requirement
|
205
191
|
requirements:
|
206
|
-
- -
|
192
|
+
- - "~>"
|
207
193
|
- !ruby/object:Gem::Version
|
208
|
-
version: 0.
|
194
|
+
version: 0.3.0
|
209
195
|
- !ruby/object:Gem::Dependency
|
210
196
|
name: relaton-iso-bib
|
211
197
|
requirement: !ruby/object:Gem::Requirement
|