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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 15e59c996299424282311bbcff81938de7f3cedec23726db9d4cfa377bc37f3b
4
- data.tar.gz: 1ccc769d95eb05561a57ba6d4f55ffb006a10cf76bbd362d667d4906db4c38b2
3
+ metadata.gz: 64446d11a9b8ff146087a41ea017e7df943c1d4453ce213aa0ce9a15afd9fa12
4
+ data.tar.gz: 557da1af0ed0723f8e48bf21e447937b70888294c514a2e6df970a99d662dfaf
5
5
  SHA512:
6
- metadata.gz: 927b2cfea7b54d87022642a0e04555c12716a09f800fc79f7133162ffccd9f91ea1ce95b99a3feb18d42e7e1326844585e5384d2f3d777f0b39fd960f0fcd1ce
7
- data.tar.gz: 72ae5ee67833161e820559911ccb9d712952a31225b184475d4c85e6a16fa4405805238c71b12eb733dadb8442ba419c6e2f49cc2917cf8fd924b9fdcd607d9d
6
+ metadata.gz: 831fad8c654c5342b588f7fc6d4c504ce1459b68fe050d3a3d1508288f540d6c9979c09b2c5dd1fbdd472cbe632d8a639942b17854a808ed9a7e13a60d50d733
7
+ data.tar.gz: 9452ff39391c29dae9daf6a4efe25a7afbd9a65b17ebef8174ab6544cb67667b593646ef2dfdf393dfff42336f3d1ccb07fa909a1b05a71f1f10cfd367ecfc08
@@ -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
@@ -62,7 +62,6 @@ module RelatonIso
62
62
  # Fetch edition.
63
63
  edition = doc.at("//div[div[.='Edition']]/text()[last()]")
64
64
  &.text&.match(/\d+$/)&.to_s
65
- hit.pubid.edition = edition if edition
66
65
 
67
66
  titles, abstract, langs = fetch_titles_abstract(doc, lang)
68
67
 
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module RelatonIso
4
- VERSION = "1.13.6"
4
+ VERSION = "1.13.7"
5
5
  end
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-core", "1.2.1"
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.6
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-10-28 00:00:00.000000000 Z
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.2.1
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.2.1
194
+ version: 0.3.0
209
195
  - !ruby/object:Gem::Dependency
210
196
  name: relaton-iso-bib
211
197
  requirement: !ruby/object:Gem::Requirement