relaton-gb 1.12.0 → 1.12.1

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: 470fd611ac4b5a75b5731a6f3ad632559dd6c21b5f5df0845265641329b6bddd
4
- data.tar.gz: '080c1b5148f7971ae800963c810d437c3dc3d323d4a00b8b27c1c44e3debc010'
3
+ metadata.gz: 2428a14a41dedaa3593734a0af63e49d959468b60d0ee6f7c9671f5a554d42d2
4
+ data.tar.gz: 4b7080ea176fa7f02630faf497e3acce7ed1478f61bc75468599f055affcc359
5
5
  SHA512:
6
- metadata.gz: e0b0be08a47ee2c6904df4abb18aaf9943c4b3522c3d375f1c81a959bcd5ebc8faf175c88fb2ac47ee56c77c3e6599e849f6f081017540128fca0588ac0b4b0d
7
- data.tar.gz: d6a0c996d1c778868774940066c8e3923c99d52448c3221d576bb4e8271f08bf3569d5e856aa55e24c9d0f611693b34b9775b13bf29eaf3406c45908022f28af
6
+ metadata.gz: 1d58812cd6f9b8789d3d4496fc82ad544ff7d02b33a762efc45e4d46b15fde5726197fa7f5fa0b9cd3d3ea84a2e7d3578a94cdb3d995bd3c76799f66cdfdc2b6
7
+ data.tar.gz: 7a4ccde3cb418d0a70354b14f26e3a13a2b019b9778de10e23985b5e626e7c85d073826ffe17131f260f4a2eb8c78c67f5162db2083d7a42a37763f972e41eb9
@@ -47,7 +47,7 @@ module RelatonGb
47
47
  # * :type [String]
48
48
  # * :name [String]
49
49
  def get_committee(doc, _ref)
50
- name = doc.at("//div[contains(text(), '归口单位')]/following-sibling::div")
50
+ name = doc.at("//div[contains(., '归口单位') or contains(., '归口部门')]/following-sibling::div")
51
51
  { type: "technical", name: name.text.delete("\r\n\t\t") }
52
52
  end
53
53
  end
@@ -27,8 +27,8 @@ module RelatonGb
27
27
  end
28
28
 
29
29
  def ccs_hash_to_bib(ret)
30
- ret[:ccs] = array(ret[:ccs]).map do |ccs|
31
- ccs[:code] ? Cnccs.fetch(ccs[:code]) : Cnccs.fetch(ccs)
30
+ ret[:ccs] = RelatonBib.array(ret[:ccs]).map do |ccs|
31
+ (ccs[:code] && Cnccs.fetch(ccs[:code])) || Cnccs.fetch(ccs)
32
32
  end
33
33
  end
34
34
  end
@@ -38,9 +38,9 @@ module RelatonGb
38
38
 
39
39
  # @return [String]
40
40
  def inspect
41
- "<#{self.class}:#{format('%<id>#.14x', id: object_id << 1)} "\
42
- "@fullIdentifier=\"#{@fetch&.shortref}\" "\
43
- "@docref=\"#{docref}\">"
41
+ "<#{self.class}:#{format('%<id>#.14x', id: object_id << 1)} " \
42
+ "@fullIdentifier=\"#{@fetch&.shortref}\" " \
43
+ "@docref=\"#{docref}\">"
44
44
  end
45
45
  end
46
46
  end
@@ -14,12 +14,11 @@ module RelatonGb
14
14
 
15
15
  @prefixes = nil
16
16
 
17
- # rubocop:disable Metrics/MethodLength
18
17
  # @param doc [Nokogiri::HTML::Document]
19
18
  # @param src [String]
20
19
  # @param hit [RelatonGb::Hit]
21
20
  # @return [Hash]
22
- def scrapped_data(doc, src, hit)
21
+ def scrapped_data(doc, src, hit) # rubocop:disable Metrics/AbcSize, Metrics/MethodLength
23
22
  {
24
23
  fetched: Date.today.to_s,
25
24
  committee: get_committee(doc, hit.docref),
@@ -38,7 +37,6 @@ module RelatonGb
38
37
  structuredidentifier: fetch_structuredidentifier(hit.docref),
39
38
  }
40
39
  end
41
- # rubocop:enable Metrics/MethodLength
42
40
 
43
41
  # @param docref [String]
44
42
  # @return [Array<RelatonBib::DocumentIdentifier>]
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module RelatonGb
4
- VERSION = "1.12.0"
4
+ VERSION = "1.12.1"
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: relaton-gb
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.12.0
4
+ version: 1.12.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-06-25 00:00:00.000000000 Z
11
+ date: 2022-07-19 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: equivalent-xml