relaton-gb 1.12.1 → 1.13.0

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: 2428a14a41dedaa3593734a0af63e49d959468b60d0ee6f7c9671f5a554d42d2
4
- data.tar.gz: 4b7080ea176fa7f02630faf497e3acce7ed1478f61bc75468599f055affcc359
3
+ metadata.gz: 2f3844801b9c641a154e348f6353bd015852bb2397188c78cf0eff2db6195a4b
4
+ data.tar.gz: 4dabafff1ae9b09e935e0c4f1942ba4db625b9321cdfe64bda829dc2aa2e64fb
5
5
  SHA512:
6
- metadata.gz: 1d58812cd6f9b8789d3d4496fc82ad544ff7d02b33a762efc45e4d46b15fde5726197fa7f5fa0b9cd3d3ea84a2e7d3578a94cdb3d995bd3c76799f66cdfdc2b6
7
- data.tar.gz: 7a4ccde3cb418d0a70354b14f26e3a13a2b019b9778de10e23985b5e626e7c85d073826ffe17131f260f4a2eb8c78c67f5162db2083d7a42a37763f972e41eb9
6
+ metadata.gz: ffd17de2c4b98e5a75d538d85d0cb21b612a46f911af2ebf4e05a61e4d8e839956c1f3bb54a9aa02bd954ac0ebfd937b0a9614ed952d896c9c487abab2ce5b8a
7
+ data.tar.gz: 587cfd65266caf303f1b5ceb2a67288411c23fba83bf06057ee0aed2b071e8f5c44bf34e6444ed2e4490ffaf771955d9c46ce3db2a475955c843b2b07473776e
data/grammars/biblio.rng CHANGED
@@ -225,9 +225,9 @@
225
225
  <zeroOrMore>
226
226
  <ref name="forename"/>
227
227
  </zeroOrMore>
228
- <zeroOrMore>
229
- <ref name="initial"/>
230
- </zeroOrMore>
228
+ <optional>
229
+ <ref name="formatted-initials"/>
230
+ </optional>
231
231
  <ref name="surname"/>
232
232
  <zeroOrMore>
233
233
  <ref name="addition"/>
@@ -247,8 +247,8 @@
247
247
  <ref name="LocalizedString"/>
248
248
  </element>
249
249
  </define>
250
- <define name="initial">
251
- <element name="initial">
250
+ <define name="formatted-initials">
251
+ <element name="formatted-initials">
252
252
  <ref name="LocalizedString"/>
253
253
  </element>
254
254
  </define>
@@ -264,6 +264,9 @@
264
264
  </define>
265
265
  <define name="forename">
266
266
  <element name="forename">
267
+ <optional>
268
+ <attribute name="initial"/>
269
+ </optional>
267
270
  <ref name="LocalizedString"/>
268
271
  </element>
269
272
  </define>
data/grammars/isodoc.rng CHANGED
@@ -69,6 +69,17 @@
69
69
  </zeroOrMore>
70
70
  </element>
71
71
  </define>
72
+ <define name="AdmonitionType">
73
+ <choice>
74
+ <value>warning</value>
75
+ <value>note</value>
76
+ <value>tip</value>
77
+ <value>important</value>
78
+ <value>caution</value>
79
+ <value>statement</value>
80
+ <value>editorial</value>
81
+ </choice>
82
+ </define>
72
83
  <define name="index">
73
84
  <element name="index">
74
85
  <optional>
@@ -1274,7 +1285,12 @@
1274
1285
  </define>
1275
1286
  <define name="span">
1276
1287
  <element name="span">
1277
- <attribute name="class"/>
1288
+ <optional>
1289
+ <attribute name="class"/>
1290
+ </optional>
1291
+ <optional>
1292
+ <attribute name="style"/>
1293
+ </optional>
1278
1294
  <oneOrMore>
1279
1295
  <ref name="TextElement"/>
1280
1296
  </oneOrMore>
@@ -2493,6 +2509,16 @@
2493
2509
  <text/>
2494
2510
  </element>
2495
2511
  </optional>
2512
+ <optional>
2513
+ <element name="amendment">
2514
+ <text/>
2515
+ </element>
2516
+ </optional>
2517
+ <optional>
2518
+ <element name="corrigendum">
2519
+ <text/>
2520
+ </element>
2521
+ </optional>
2496
2522
  <optional>
2497
2523
  <element name="language">
2498
2524
  <text/>
@@ -20,8 +20,8 @@ module RelatonGb
20
20
  # @return [RelatonGb::HitCollection]
21
21
  def scrape_page(text)
22
22
  search_html = OpenURI.open_uri(
23
- "http://www.ttbz.org.cn/Home/Standard?searchType=2&key=" +
24
- CGI.escape(text.tr("-", [8212].pack("U")))
23
+ "http://www.ttbz.org.cn/Home/Standard?searchType=2&key=" \
24
+ "#{CGI.escape(text.tr('-', [8212].pack('U')))}",
25
25
  ).read
26
26
  header = Nokogiri::HTML search_html
27
27
  xpath = '//table[contains(@class, "standard_list_table")]/tr/td/a'
@@ -29,7 +29,7 @@ module RelatonGb
29
29
  hits = header.xpath(xpath).map do |h|
30
30
  docref = h.at(t_xpath).text.gsub(/â\u0080\u0094/, "-")
31
31
  status = h.at("../preceding-sibling::td[1]").text.delete "\r\n"
32
- pid = h[:href].sub(%r{\/$}, "")
32
+ pid = h[:href].sub(%r{/$}, "")
33
33
  Hit.new pid: pid, docref: docref, status: status, scrapper: self
34
34
  end
35
35
  HitCollection.new hits
@@ -43,7 +43,7 @@ module RelatonGb
43
43
  def scrape_doc(hit)
44
44
  src = "http://www.ttbz.org.cn#{hit.pid}"
45
45
  doc = Nokogiri::HTML OpenURI.open_uri(src), nil, Encoding::UTF_8.to_s
46
- GbBibliographicItem.new **scrapped_data(doc, src, hit)
46
+ GbBibliographicItem.new(**scrapped_data(doc, src, hit))
47
47
  rescue OpenURI::HTTPError, SocketError, OpenSSL::SSL::SSLError, Net::OpenTimeout
48
48
  raise RelatonBib::RequestError, "Cannot access #{src}"
49
49
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module RelatonGb
4
- VERSION = "1.12.1"
4
+ VERSION = "1.13.0"
5
5
  end
data/relaton_gb.gemspec CHANGED
@@ -35,5 +35,5 @@ Gem::Specification.new do |spec|
35
35
 
36
36
  spec.add_dependency "cnccs", "~> 0.1.1"
37
37
  spec.add_dependency "gb-agencies", "~> 0.0.1"
38
- spec.add_dependency "relaton-iso-bib", "~> 1.12.0"
38
+ spec.add_dependency "relaton-iso-bib", "~> 1.13.0"
39
39
  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.1
4
+ version: 1.13.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: 2022-07-19 00:00:00.000000000 Z
11
+ date: 2022-08-21 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: equivalent-xml
@@ -156,14 +156,14 @@ dependencies:
156
156
  requirements:
157
157
  - - "~>"
158
158
  - !ruby/object:Gem::Version
159
- version: 1.12.0
159
+ version: 1.13.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: 1.12.0
166
+ version: 1.13.0
167
167
  description: 'RelatonGb: retrieve Chinese GB Standards for bibliographic use using
168
168
  the BibliographicItem model.'
169
169
  email: