relaton-gb 1.20.2 → 1.20.4

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 545e535b0db62ecab737c3067cd5b3f8f2104560e104b1dc2cbc7c920ab7238b
4
- data.tar.gz: 3672fda5a7bb420fb5cc1086b60d46ce3b94f0ae4d9cf7759101f9b67cce2aac
3
+ metadata.gz: f018c7b2bdd3de88295eef4a3f1443754ffdbfd70b67655a3283c473a610cc09
4
+ data.tar.gz: 30f02de58467dd014c5dffb88c10431a2e9e3a92999d72b9e1adab766a753f57
5
5
  SHA512:
6
- metadata.gz: 74581dbf698e664f97cdfa66c1d4f948f2a14713eeb772ce20838a03f01fba1eb864afe5b6a4153f8fc80a32b30d3893bdbfa713667edd83c193f6bada37e533
7
- data.tar.gz: 3141ac12e00f11a00a44d4563a48e7aa16b7b762514dc63ca828f104191614c55ec75ab6cf2df7ccc0e860ab50ccc4d42665ce61e98fd49ae51e81d2fcee55e2
6
+ metadata.gz: 3a33d2082e6f14c0b00e622b141699dc83aa22a6c8a7c90774c80ae9d098b53d4aad305ccf7388131083b4828688abb9a44efba2107fb4fcafb6d5e23e5e6f03
7
+ data.tar.gz: 8c012e61b469aea8b4965a941bad8fd1141e0d1ab0e79b55f48790a70c215e0ae0933d35cfb4ada37efd4f4289d912a7bb685a178477f8d645e980c3ad45830a
@@ -1,7 +1,6 @@
1
1
  # encoding: UTF-8
2
2
  # frozen_string_literal: true
3
3
 
4
- require "open-uri"
5
4
  require "nokogiri"
6
5
  require "relaton_gb/scrapper"
7
6
  require "relaton_gb/gb_bibliographic_item"
@@ -23,7 +22,7 @@ module RelatonGb
23
22
  ).map do |h|
24
23
  ref = h.at "./td[2]/a"
25
24
  pid = ref[:onclick].match(/[0-9A-F]+/).to_s
26
- rdate = h.at("./td[7]").text
25
+ rdate = h.at("./td[8]").text
27
26
  Hit.new pid: pid, docref: ref.text, scrapper: self, release_date: rdate
28
27
  end
29
28
  HitCollection.new hits.sort_by(&:release_date).reverse
@@ -52,7 +51,7 @@ module RelatonGb
52
51
  # * :name [String]
53
52
  def get_committee(doc, _ref)
54
53
  name = doc.at("//div[contains(., '归口单位') or contains(., '归口部门')]/following-sibling::div")
55
- { type: "technical", name: name.text.delete("\r\n\t\t") }
54
+ { type: "technical", name: name.text.strip }
56
55
  end
57
56
  end
58
57
  end
@@ -28,7 +28,8 @@ module RelatonGb
28
28
  # @param hash [Hash]
29
29
  # @return [RelatonGb::GbBibliographicItem]
30
30
  def hash_to_bib(hash)
31
- ::RelatonGb::GbBibliographicItem.new hash
31
+ item_hash = HashConverter.hash_to_bib hash
32
+ ::RelatonGb::GbBibliographicItem.new(**item_hash)
32
33
  end
33
34
 
34
35
  # Returns hash of XML grammar
@@ -123,7 +123,7 @@ module RelatonGb
123
123
  # @return [Array<String>]
124
124
  def get_ccs(doc)
125
125
  [doc.at("//div[contains(text(), '中国标准分类号')]/following-sibling::div").
126
- text.delete("\r\n\t\t")]
126
+ text.strip]
127
127
  end
128
128
 
129
129
  # @param doc [Nokogiri::HTML::Document]
@@ -136,7 +136,7 @@ module RelatonGb
136
136
  " | //dt[contains(text(), '国际标准分类号')]/following-sibling::dd")
137
137
  return [] unless ics
138
138
 
139
- field, group, subgroup = ics.text.delete("\r\n\t\t").split "."
139
+ field, group, subgroup = ics.text.strip.split "."
140
140
  [{ field: field, group: group.ljust(3, "0"), subgroup: subgroup }]
141
141
  end
142
142
 
@@ -181,7 +181,7 @@ module RelatonGb
181
181
  def get_dates(doc)
182
182
  date = doc.at("//div[contains(text(), '发布日期')]/following-sibling::div"\
183
183
  " | //dt[contains(text(), '发布日期')]/following-sibling::dd")
184
- [{ type: "published", on: date.text.delete("\r\n\t\t") }]
184
+ [{ type: "published", on: date.text.strip }]
185
185
  end
186
186
  end
187
187
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module RelatonGb
4
- VERSION = "1.20.2"
4
+ VERSION = "1.20.4"
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.20.2
4
+ version: 1.20.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ribose Inc.
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2026-01-22 00:00:00.000000000 Z
11
+ date: 2026-04-22 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: cnccs