relaton-calconnect 1.6.0 → 1.7.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: 71eab01be22eb03e579101dad181263d23036ac1c09bcd0654d1340fb3d08331
4
- data.tar.gz: f54724b940834a13f225c51e68607e9ba03fc7b06649f419d4e9efbc14bb8126
3
+ metadata.gz: 75f9c141dad7c987f632c31349e4b303cc5c20b1e3b71a70e81699d87be9cdb0
4
+ data.tar.gz: 6344ca6ea01264f7534324137a48831a92c95c79b563147cc216e132ee26e4ac
5
5
  SHA512:
6
- metadata.gz: 378f503164f845b86d9ef58b3698ccc9a9258eb629ef3668c3ed2b7b9eb0122d3ac1536324bf37c9022bfb7574821aa1e9936414ebfb8ead915c60cb2cab4138
7
- data.tar.gz: 49c4cdd01c66e4c4ab32ca95d8b9d77edc52cfd443689840dd81d64b019e336abcfe2d0ba7c9992631344840d81739e63b4dd5ad7fa6b4761a98bbb73fb3dda2
6
+ metadata.gz: '05830b711c1331f64e2662bc17aa6c5d4fe1c4735f0c7831309a2457454ce6b9e92197cc5e17627fbf296fe601a3240913739e0df2f99124abb6daa3c04c860b'
7
+ data.tar.gz: 816f5ed634566d5ac0a5bd69f5f077538afd1c7908e700d24087681ee04a8b81821da4f18315e6db425d3e04d75d6b7e3a80ae18ab95ce75df9a748ec7f95907
@@ -86,7 +86,7 @@
86
86
  </element>
87
87
  </define>
88
88
  <define name="technical-committee">
89
- <element name="technical-committee">
89
+ <element name="committee">
90
90
  <optional>
91
91
  <attribute name="type"/>
92
92
  </optional>
@@ -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">
@@ -141,6 +149,11 @@
141
149
  <data type="boolean"/>
142
150
  </attribute>
143
151
  </optional>
152
+ <optional>
153
+ <attribute name="key">
154
+ <data type="boolean"/>
155
+ </attribute>
156
+ </optional>
144
157
  <oneOrMore>
145
158
  <ref name="dt"/>
146
159
  <ref name="dd"/>
@@ -1164,49 +1177,7 @@
1164
1177
  </define>
1165
1178
  <define name="annex">
1166
1179
  <element name="annex">
1167
- <optional>
1168
- <attribute name="id">
1169
- <data type="ID"/>
1170
- </attribute>
1171
- </optional>
1172
- <optional>
1173
- <attribute name="language"/>
1174
- </optional>
1175
- <optional>
1176
- <attribute name="script"/>
1177
- </optional>
1178
- <optional>
1179
- <attribute name="inline-header">
1180
- <data type="boolean"/>
1181
- </attribute>
1182
- </optional>
1183
- <attribute name="obligation">
1184
- <choice>
1185
- <value>normative</value>
1186
- <value>informative</value>
1187
- </choice>
1188
- </attribute>
1189
- <optional>
1190
- <ref name="section-title"/>
1191
- </optional>
1192
- <group>
1193
- <group>
1194
- <zeroOrMore>
1195
- <ref name="BasicBlock"/>
1196
- </zeroOrMore>
1197
- <zeroOrMore>
1198
- <ref name="note"/>
1199
- </zeroOrMore>
1200
- </group>
1201
- <zeroOrMore>
1202
- <choice>
1203
- <ref name="annex-subsection"/>
1204
- <ref name="terms"/>
1205
- <ref name="definitions"/>
1206
- <ref name="references"/>
1207
- </choice>
1208
- </zeroOrMore>
1209
- </group>
1180
+ <ref name="Annex-Section"/>
1210
1181
  </element>
1211
1182
  </define>
1212
1183
  <define name="terms">
@@ -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"
@@ -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
@@ -0,0 +1,8 @@
1
+ module RelatonCalconnect
2
+ class TechnicalCommittee < RelatonBib::TechnicalCommittee
3
+ # @param builder [Nokogiri::XML::Builder]
4
+ def to_xml(builder)
5
+ builder.committee { |b| workgroup.to_xml b }
6
+ end
7
+ end
8
+ end
@@ -1,3 +1,3 @@
1
1
  module RelatonCalconnect
2
- VERSION = "1.6.0".freeze
2
+ VERSION = "1.7.0".freeze
3
3
  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
@@ -37,5 +37,5 @@ Gem::Specification.new do |spec|
37
37
  spec.add_development_dependency "webmock"
38
38
 
39
39
  spec.add_dependency "faraday"
40
- spec.add_dependency "relaton-bib", "~> 1.6.0"
40
+ spec.add_dependency "relaton-bib", "~> 1.7.0"
41
41
  end
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.6.0
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-13 00:00:00.000000000 Z
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.6.0
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.6.0
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