relaton-calconnect 1.4.0 → 1.7.0
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 +4 -4
- data/.github/workflows/macos.yml +2 -0
- data/grammars/csd.rng +8 -1
- data/grammars/isodoc.rng +21 -44
- data/lib/relaton_calconnect.rb +1 -0
- data/lib/relaton_calconnect/cc_bibliography.rb +2 -2
- data/lib/relaton_calconnect/hash_converter.rb +11 -0
- data/lib/relaton_calconnect/technical_committee.rb +8 -0
- data/lib/relaton_calconnect/version.rb +1 -1
- data/lib/relaton_calconnect/xml_parser.rb +13 -0
- 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: 75f9c141dad7c987f632c31349e4b303cc5c20b1e3b71a70e81699d87be9cdb0
|
4
|
+
data.tar.gz: 6344ca6ea01264f7534324137a48831a92c95c79b563147cc216e132ee26e4ac
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: '05830b711c1331f64e2662bc17aa6c5d4fe1c4735f0c7831309a2457454ce6b9e92197cc5e17627fbf296fe601a3240913739e0df2f99124abb6daa3c04c860b'
|
7
|
+
data.tar.gz: 816f5ed634566d5ac0a5bd69f5f077538afd1c7908e700d24087681ee04a8b81821da4f18315e6db425d3e04d75d6b7e3a80ae18ab95ce75df9a748ec7f95907
|
data/.github/workflows/macos.yml
CHANGED
@@ -26,6 +26,8 @@ jobs:
|
|
26
26
|
- name: Update gems
|
27
27
|
run: |
|
28
28
|
sudo gem install bundler --force
|
29
|
+
ruby -v | grep 2.5 && bundle config set build.debase --with-cflags="-Wno-error=implicit-function-declaration"
|
30
|
+
ruby -v | grep 2.5 && bundle config set build.ruby-debug-ide --with-cflags="-Wno-error=implicit-function-declaration"
|
29
31
|
bundle install --jobs 4 --retry 3
|
30
32
|
- name: Run specs
|
31
33
|
run: |
|
data/grammars/csd.rng
CHANGED
@@ -86,7 +86,7 @@
|
|
86
86
|
</element>
|
87
87
|
</define>
|
88
88
|
<define name="technical-committee">
|
89
|
-
<element name="
|
89
|
+
<element name="committee">
|
90
90
|
<optional>
|
91
91
|
<attribute name="type"/>
|
92
92
|
</optional>
|
@@ -96,6 +96,13 @@
|
|
96
96
|
</include>
|
97
97
|
<define name="csd-standard">
|
98
98
|
<element name="csd-standard">
|
99
|
+
<attribute name="version"/>
|
100
|
+
<attribute name="type">
|
101
|
+
<choice>
|
102
|
+
<value>semantic</value>
|
103
|
+
<value>presentation</value>
|
104
|
+
</choice>
|
105
|
+
</attribute>
|
99
106
|
<ref name="bibdata"/>
|
100
107
|
<zeroOrMore>
|
101
108
|
<ref name="termdocsource"/>
|
data/grammars/isodoc.rng
CHANGED
@@ -24,6 +24,14 @@
|
|
24
24
|
<start>
|
25
25
|
<ref name="standard-document"/>
|
26
26
|
</start>
|
27
|
+
<define name="doctype">
|
28
|
+
<element name="doctype">
|
29
|
+
<optional>
|
30
|
+
<attribute name="abbreviation"/>
|
31
|
+
</optional>
|
32
|
+
<ref name="DocumentType"/>
|
33
|
+
</element>
|
34
|
+
</define>
|
27
35
|
<define name="hyperlink">
|
28
36
|
<element name="link">
|
29
37
|
<attribute name="target">
|
@@ -42,7 +50,6 @@
|
|
42
50
|
</define>
|
43
51
|
<define name="xref">
|
44
52
|
<element name="xref">
|
45
|
-
<!-- attribute target { xsd:IDREF }, -->
|
46
53
|
<attribute name="target">
|
47
54
|
<data type="string">
|
48
55
|
<param name="pattern">\i\c*|\c+#\c+</param>
|
@@ -142,6 +149,11 @@
|
|
142
149
|
<data type="boolean"/>
|
143
150
|
</attribute>
|
144
151
|
</optional>
|
152
|
+
<optional>
|
153
|
+
<attribute name="key">
|
154
|
+
<data type="boolean"/>
|
155
|
+
</attribute>
|
156
|
+
</optional>
|
145
157
|
<oneOrMore>
|
146
158
|
<ref name="dt"/>
|
147
159
|
<ref name="dd"/>
|
@@ -864,6 +876,13 @@
|
|
864
876
|
</define>
|
865
877
|
<define name="standard-document">
|
866
878
|
<element name="standard-document">
|
879
|
+
<attribute name="version"/>
|
880
|
+
<attribute name="type">
|
881
|
+
<choice>
|
882
|
+
<value>semantic</value>
|
883
|
+
<value>presentation</value>
|
884
|
+
</choice>
|
885
|
+
</attribute>
|
867
886
|
<ref name="bibdata"/>
|
868
887
|
<optional>
|
869
888
|
<ref name="boilerplate"/>
|
@@ -1158,49 +1177,7 @@
|
|
1158
1177
|
</define>
|
1159
1178
|
<define name="annex">
|
1160
1179
|
<element name="annex">
|
1161
|
-
<
|
1162
|
-
<attribute name="id">
|
1163
|
-
<data type="ID"/>
|
1164
|
-
</attribute>
|
1165
|
-
</optional>
|
1166
|
-
<optional>
|
1167
|
-
<attribute name="language"/>
|
1168
|
-
</optional>
|
1169
|
-
<optional>
|
1170
|
-
<attribute name="script"/>
|
1171
|
-
</optional>
|
1172
|
-
<optional>
|
1173
|
-
<attribute name="inline-header">
|
1174
|
-
<data type="boolean"/>
|
1175
|
-
</attribute>
|
1176
|
-
</optional>
|
1177
|
-
<attribute name="obligation">
|
1178
|
-
<choice>
|
1179
|
-
<value>normative</value>
|
1180
|
-
<value>informative</value>
|
1181
|
-
</choice>
|
1182
|
-
</attribute>
|
1183
|
-
<optional>
|
1184
|
-
<ref name="section-title"/>
|
1185
|
-
</optional>
|
1186
|
-
<group>
|
1187
|
-
<group>
|
1188
|
-
<zeroOrMore>
|
1189
|
-
<ref name="BasicBlock"/>
|
1190
|
-
</zeroOrMore>
|
1191
|
-
<zeroOrMore>
|
1192
|
-
<ref name="note"/>
|
1193
|
-
</zeroOrMore>
|
1194
|
-
</group>
|
1195
|
-
<zeroOrMore>
|
1196
|
-
<choice>
|
1197
|
-
<ref name="annex-subsection"/>
|
1198
|
-
<ref name="terms"/>
|
1199
|
-
<ref name="definitions"/>
|
1200
|
-
<ref name="references"/>
|
1201
|
-
</choice>
|
1202
|
-
</zeroOrMore>
|
1203
|
-
</group>
|
1180
|
+
<ref name="Annex-Section"/>
|
1204
1181
|
</element>
|
1205
1182
|
</define>
|
1206
1183
|
<define name="terms">
|
data/lib/relaton_calconnect.rb
CHANGED
@@ -4,6 +4,7 @@ require "relaton_calconnect/cc_bibliography"
|
|
4
4
|
require "relaton_calconnect/hit_collection"
|
5
5
|
require "relaton_calconnect/hit"
|
6
6
|
require "relaton_calconnect/scrapper"
|
7
|
+
require "relaton_calconnect/technical_committee"
|
7
8
|
require "relaton_calconnect/cc_bibliographic_item"
|
8
9
|
require "relaton_calconnect/xml_parser"
|
9
10
|
require "relaton_calconnect/hash_converter"
|
@@ -64,9 +64,9 @@ module RelatonCalconnect
|
|
64
64
|
return { ret: item } if !year
|
65
65
|
|
66
66
|
item.date.select { |d| d.type == "published" }.each do |d|
|
67
|
-
return { ret: item } if year.to_i == d.on
|
67
|
+
return { ret: item } if year.to_i == d.on(:year)
|
68
68
|
|
69
|
-
missed_years << d.on
|
69
|
+
missed_years << d.on(:year)
|
70
70
|
end
|
71
71
|
end
|
72
72
|
{ years: missed_years }
|
@@ -1,4 +1,15 @@
|
|
1
1
|
module RelatonCalconnect
|
2
2
|
class HashConverter < RelatonBib::HashConverter
|
3
|
+
class << self
|
4
|
+
# @param ret [Hash]
|
5
|
+
def editorialgroup_hash_to_bib(ret)
|
6
|
+
return unless ret[:editorialgroup]
|
7
|
+
|
8
|
+
technical_committee = array(ret[:editorialgroup]).map do |wg|
|
9
|
+
TechnicalCommittee.new RelatonBib::WorkGroup.new(wg)
|
10
|
+
end
|
11
|
+
ret[:editorialgroup] = RelatonBib::EditorialGroup.new technical_committee
|
12
|
+
end
|
13
|
+
end
|
3
14
|
end
|
4
15
|
end
|
@@ -7,6 +7,19 @@ module RelatonCalconnect
|
|
7
7
|
def bib_item(item_hash)
|
8
8
|
CcBibliographicItem.new item_hash
|
9
9
|
end
|
10
|
+
|
11
|
+
# @param ext [Nokogiri::XML::Element]
|
12
|
+
# @return [RelatonBib::EditorialGroup, nil]
|
13
|
+
def fetch_editorialgroup(ext)
|
14
|
+
return unless ext && (eg = ext.at "editorialgroup")
|
15
|
+
|
16
|
+
eg = eg.xpath("committee", "technical-committee").map do |tc|
|
17
|
+
wg = RelatonBib::WorkGroup.new(content: tc.text, number: tc[:number]&.to_i,
|
18
|
+
type: tc[:type])
|
19
|
+
TechnicalCommittee.new wg
|
20
|
+
end
|
21
|
+
RelatonBib::EditorialGroup.new eg if eg.any?
|
22
|
+
end
|
10
23
|
end
|
11
24
|
end
|
12
25
|
end
|
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.7.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: 2020-
|
11
|
+
date: 2020-11-27 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: debase
|
@@ -156,14 +156,14 @@ dependencies:
|
|
156
156
|
requirements:
|
157
157
|
- - "~>"
|
158
158
|
- !ruby/object:Gem::Version
|
159
|
-
version: 1.
|
159
|
+
version: 1.7.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.
|
166
|
+
version: 1.7.0
|
167
167
|
description: 'RelatonIso: retrieve CC Standards for bibliographic use using the IsoBibliographicItem
|
168
168
|
model'
|
169
169
|
email:
|
@@ -198,6 +198,7 @@ files:
|
|
198
198
|
- lib/relaton_calconnect/hit_collection.rb
|
199
199
|
- lib/relaton_calconnect/processor.rb
|
200
200
|
- lib/relaton_calconnect/scrapper.rb
|
201
|
+
- lib/relaton_calconnect/technical_committee.rb
|
201
202
|
- lib/relaton_calconnect/version.rb
|
202
203
|
- lib/relaton_calconnect/xml_parser.rb
|
203
204
|
- relaton_calconnect.gemspec
|