relaton-calconnect 1.12.1 → 1.13.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/workflows/release.yml +22 -0
- data/grammars/biblio.rng +8 -5
- data/grammars/isodoc.rng +27 -1
- data/lib/relaton_calconnect/scrapper.rb +17 -5
- data/lib/relaton_calconnect/version.rb +1 -1
- data/relaton_calconnect.gemspec +1 -1
- metadata +5 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 472e2e5fa6688de1b2437d22f1ec7cbe720bbfa3f15020083b9667f5cf153863
|
4
|
+
data.tar.gz: ee3ea9b65ba53b75aae4fb92b83b147869ea639eed7dddf6b95ddf97fb5bc1a8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: fe3271ea3e47ee2d29b39961062c5c85a9604ed0e5af2ec66240abdeb18233e96d4facfea08ab94bcbae31acb015361b280286dfaf82bc4903efea8b023ef824
|
7
|
+
data.tar.gz: 5c284c28bc437bcd77cdf26c1001e12b491e903c810806ac9c207c07093ea1498ca3fad08ba290c11cfc563babc357f46ae21254d985c898615a6a5f1eb43589
|
@@ -0,0 +1,22 @@
|
|
1
|
+
# Auto-generated by Cimas: Do not edit it manually!
|
2
|
+
# See https://github.com/metanorma/cimas
|
3
|
+
name: release
|
4
|
+
|
5
|
+
on:
|
6
|
+
workflow_dispatch:
|
7
|
+
inputs:
|
8
|
+
next_version:
|
9
|
+
description: |
|
10
|
+
Next release version. Possible values: x.y.z, major, minor, patch or pre|rc|etc
|
11
|
+
required: true
|
12
|
+
default: 'skip'
|
13
|
+
push:
|
14
|
+
tags: [ v* ]
|
15
|
+
|
16
|
+
jobs:
|
17
|
+
release:
|
18
|
+
uses: relaton/support/.github/workflows/release.yml@master
|
19
|
+
with:
|
20
|
+
next_version: ${{ github.event.inputs.next_version }}
|
21
|
+
secrets:
|
22
|
+
rubygems-api-key: ${{ secrets.RELATON_CI_RUBYGEMS_API_KEY }}
|
data/grammars/biblio.rng
CHANGED
@@ -225,9 +225,9 @@
|
|
225
225
|
<zeroOrMore>
|
226
226
|
<ref name="forename"/>
|
227
227
|
</zeroOrMore>
|
228
|
-
<
|
229
|
-
<ref name="
|
230
|
-
</
|
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="
|
251
|
-
<element name="
|
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
|
-
<
|
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/>
|
@@ -5,8 +5,13 @@ module RelatonCalconnect
|
|
5
5
|
# DOMAIN = "http://127.0.0.1:4000/".freeze
|
6
6
|
|
7
7
|
class << self
|
8
|
-
#
|
9
|
-
#
|
8
|
+
#
|
9
|
+
# Parse document page
|
10
|
+
#
|
11
|
+
# @papam hit [Hash] document hash
|
12
|
+
#
|
13
|
+
# @return [RelatonCalconnect::CcBibliographicItem] bibliographic item
|
14
|
+
#
|
10
15
|
def parse_page(hit) # rubocop:disable Metrics/AbcSize, Metrics/MethodLength
|
11
16
|
links = array(hit["link"])
|
12
17
|
link = links.detect { |l| l["type"] == "rxl" }
|
@@ -15,6 +20,7 @@ module RelatonCalconnect
|
|
15
20
|
update_links bib, links
|
16
21
|
# XMLParser.from_xml bib_xml
|
17
22
|
else
|
23
|
+
hit.delete "fetched"
|
18
24
|
bib = RelatonCalconnect::CcBibliographicItem.from_hash doc_to_hash hit
|
19
25
|
end
|
20
26
|
bib.link.each do |l|
|
@@ -25,8 +31,13 @@ module RelatonCalconnect
|
|
25
31
|
|
26
32
|
private
|
27
33
|
|
28
|
-
#
|
29
|
-
#
|
34
|
+
#
|
35
|
+
# Fetch bibliographic item from XML source
|
36
|
+
#
|
37
|
+
# @param url [String] URL to fetch
|
38
|
+
#
|
39
|
+
# @return [RelatonCalconnect::CcBibliographicItem] bibliographic item
|
40
|
+
#
|
30
41
|
def fetch_bib_xml(url) # rubocop:disable Metrics/AbcSize, Metrics/MethodLength
|
31
42
|
rxl = get_rxl url
|
32
43
|
uri_rxl = rxl.at("uri[@type='rxl']")
|
@@ -61,7 +72,8 @@ module RelatonCalconnect
|
|
61
72
|
eg.merge!(tc) if tc
|
62
73
|
end
|
63
74
|
dtps = %w[CC CSD]
|
64
|
-
array(doc["docid"]).detect { |id| dtps.include? id["type"].upcase }
|
75
|
+
did = array(doc["docid"]).detect { |id| dtps.include? id["type"].upcase }
|
76
|
+
did["primary"] = true if did
|
65
77
|
doc
|
66
78
|
end
|
67
79
|
|
data/relaton_calconnect.gemspec
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: relaton-calconnect
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.13.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-
|
11
|
+
date: 2022-10-25 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: equivalent-xml
|
@@ -128,14 +128,14 @@ dependencies:
|
|
128
128
|
requirements:
|
129
129
|
- - "~>"
|
130
130
|
- !ruby/object:Gem::Version
|
131
|
-
version: 1.
|
131
|
+
version: 1.13.0
|
132
132
|
type: :runtime
|
133
133
|
prerelease: false
|
134
134
|
version_requirements: !ruby/object:Gem::Requirement
|
135
135
|
requirements:
|
136
136
|
- - "~>"
|
137
137
|
- !ruby/object:Gem::Version
|
138
|
-
version: 1.
|
138
|
+
version: 1.13.0
|
139
139
|
description: 'RelatonIso: retrieve CC Standards for bibliographic use using the IsoBibliographicItem
|
140
140
|
model'
|
141
141
|
email:
|
@@ -145,6 +145,7 @@ extensions: []
|
|
145
145
|
extra_rdoc_files: []
|
146
146
|
files:
|
147
147
|
- ".github/workflows/rake.yml"
|
148
|
+
- ".github/workflows/release.yml"
|
148
149
|
- ".gitignore"
|
149
150
|
- ".rspec"
|
150
151
|
- ".rubocop.yml"
|