relaton-calconnect 1.1.0 → 1.5.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,4 +1,4 @@
1
- require "relaton_iso_bib"
1
+ require "relaton_bib"
2
2
  require "relaton_calconnect/version"
3
3
  require "relaton_calconnect/cc_bibliography"
4
4
  require "relaton_calconnect/hit_collection"
@@ -1,5 +1,5 @@
1
1
  module RelatonCalconnect
2
- class CcBibliographicItem < RelatonIsoBib::IsoBibliographicItem
2
+ class CcBibliographicItem < RelatonBib::BibliographicItem
3
3
  TYPES = %w[
4
4
  directive guide specification standard report administrative amendment
5
5
  technical\ corrigendum advisory
@@ -1,5 +1,4 @@
1
1
  module RelatonCalconnect
2
- class HashConverter < RelatonIsoBib::HashConverter
3
-
2
+ class HashConverter < RelatonBib::HashConverter
4
3
  end
5
4
  end
@@ -1,3 +1,3 @@
1
1
  module RelatonCalconnect
2
- VERSION = "1.1.0".freeze
2
+ VERSION = "1.5.0".freeze
3
3
  end
@@ -1,15 +1,11 @@
1
1
  module RelatonCalconnect
2
- class XMLParser < RelatonIsoBib::XMLParser
2
+ class XMLParser < RelatonBib::XMLParser
3
3
  class << self
4
- def from_xml(xml)
5
- doc = Nokogiri::XML xml
6
- doc.remove_namespaces!
7
- cctitem = doc.at("/bibitem|/bibdata")
8
- if cctitem
9
- CcBibliographicItem.new(item_data(cctitem))
10
- else
11
- warn "[relaton-calconnect] can't find bibitem or bibdata element in the XML"
12
- end
4
+ # override RelatonBib::BibliographicItem.bib_item method
5
+ # @param item_hash [Hash]
6
+ # @return [RelatonIsoBib::IsoBibliographicItem]
7
+ def bib_item(item_hash)
8
+ CcBibliographicItem.new item_hash
13
9
  end
14
10
  end
15
11
  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-iso-bib", "~> 1.1.0"
40
+ spec.add_dependency "relaton-bib", "~> 1.5.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.1.0
4
+ version: 1.5.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ribose Inc.
8
- autorequire:
8
+ autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2020-06-03 00:00:00.000000000 Z
11
+ date: 2020-10-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: debase
@@ -151,19 +151,19 @@ dependencies:
151
151
  - !ruby/object:Gem::Version
152
152
  version: '0'
153
153
  - !ruby/object:Gem::Dependency
154
- name: relaton-iso-bib
154
+ name: relaton-bib
155
155
  requirement: !ruby/object:Gem::Requirement
156
156
  requirements:
157
157
  - - "~>"
158
158
  - !ruby/object:Gem::Version
159
- version: 1.1.0
159
+ version: 1.5.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.1.0
166
+ version: 1.5.0
167
167
  description: 'RelatonIso: retrieve CC Standards for bibliographic use using the IsoBibliographicItem
168
168
  model'
169
169
  email:
@@ -189,7 +189,6 @@ files:
189
189
  - grammars/biblio.rng
190
190
  - grammars/csd.rng
191
191
  - grammars/isodoc.rng
192
- - grammars/isostandard.rng
193
192
  - grammars/reqt.rng
194
193
  - lib/relaton_calconnect.rb
195
194
  - lib/relaton_calconnect/cc_bibliographic_item.rb
@@ -206,7 +205,7 @@ homepage: https://github.com/relaton/relaton-calconnect
206
205
  licenses:
207
206
  - BSD-2-Clause
208
207
  metadata: {}
209
- post_install_message:
208
+ post_install_message:
210
209
  rdoc_options: []
211
210
  require_paths:
212
211
  - lib
@@ -222,7 +221,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
222
221
  version: '0'
223
222
  requirements: []
224
223
  rubygems_version: 3.0.6
225
- signing_key:
224
+ signing_key:
226
225
  specification_version: 4
227
226
  summary: 'RelatonIso: retrieve CC Standards for bibliographic use using the IsoBibliographicItem
228
227
  model'
@@ -1,530 +0,0 @@
1
- <?xml version="1.0" encoding="UTF-8"?>
2
- <grammar xmlns="http://relaxng.org/ns/structure/1.0" datatypeLibrary="http://www.w3.org/2001/XMLSchema-datatypes">
3
- <!-- default namespace isostandard = "https://www.metanorma.com/ns/iso" -->
4
- <include href="isodoc.rng">
5
- <start>
6
- <ref name="iso-standard"/>
7
- </start>
8
- <define name="organization">
9
- <element name="organization">
10
- <oneOrMore>
11
- <ref name="orgname"/>
12
- </oneOrMore>
13
- <optional>
14
- <ref name="abbreviation"/>
15
- </optional>
16
- <optional>
17
- <ref name="uri"/>
18
- </optional>
19
- <zeroOrMore>
20
- <ref name="org-identifier"/>
21
- </zeroOrMore>
22
- <zeroOrMore>
23
- <ref name="contact"/>
24
- </zeroOrMore>
25
- <optional>
26
- <ref name="technical-committee"/>
27
- </optional>
28
- <optional>
29
- <ref name="subcommittee"/>
30
- </optional>
31
- <optional>
32
- <ref name="workgroup"/>
33
- </optional>
34
- <optional>
35
- <ref name="secretariat"/>
36
- </optional>
37
- </element>
38
- </define>
39
- <define name="BibDataExtensionType">
40
- <ref name="doctype"/>
41
- <ref name="editorialgroup"/>
42
- <zeroOrMore>
43
- <ref name="ics"/>
44
- </zeroOrMore>
45
- <ref name="structuredidentifier"/>
46
- <optional>
47
- <ref name="stagename"/>
48
- </optional>
49
- </define>
50
- <define name="bdate">
51
- <element name="date">
52
- <attribute name="type">
53
- <choice>
54
- <ref name="BibliographicDateType"/>
55
- <text/>
56
- </choice>
57
- </attribute>
58
- <choice>
59
- <group>
60
- <element name="from">
61
- <ref name="ISO8601Date"/>
62
- </element>
63
- <optional>
64
- <element name="to">
65
- <ref name="ISO8601Date"/>
66
- </element>
67
- </optional>
68
- </group>
69
- <element name="on">
70
- <choice>
71
- <ref name="ISO8601Date"/>
72
- <value>--</value>
73
- <value>–</value>
74
- </choice>
75
- </element>
76
- </choice>
77
- </element>
78
- </define>
79
- <define name="ul">
80
- <element name="ul">
81
- <attribute name="id">
82
- <data type="ID"/>
83
- </attribute>
84
- <oneOrMore>
85
- <ref name="ul_li"/>
86
- </oneOrMore>
87
- <zeroOrMore>
88
- <ref name="note"/>
89
- </zeroOrMore>
90
- </element>
91
- </define>
92
- <define name="sections">
93
- <element name="sections">
94
- <zeroOrMore>
95
- <choice>
96
- <ref name="note"/>
97
- <ref name="admonition"/>
98
- </choice>
99
- </zeroOrMore>
100
- <ref name="clause"/>
101
- <optional>
102
- <choice>
103
- <ref name="term-clause"/>
104
- <ref name="terms"/>
105
- </choice>
106
- </optional>
107
- <optional>
108
- <ref name="definitions"/>
109
- </optional>
110
- <oneOrMore>
111
- <ref name="clause"/>
112
- </oneOrMore>
113
- </element>
114
- </define>
115
- <define name="Clause-Section">
116
- <optional>
117
- <attribute name="id">
118
- <data type="ID"/>
119
- </attribute>
120
- </optional>
121
- <optional>
122
- <attribute name="language"/>
123
- </optional>
124
- <optional>
125
- <attribute name="script"/>
126
- </optional>
127
- <optional>
128
- <attribute name="inline-header">
129
- <data type="boolean"/>
130
- </attribute>
131
- </optional>
132
- <optional>
133
- <attribute name="obligation">
134
- <choice>
135
- <value>normative</value>
136
- <value>informative</value>
137
- </choice>
138
- </attribute>
139
- </optional>
140
- <optional>
141
- <ref name="section-title"/>
142
- </optional>
143
- <choice>
144
- <group>
145
- <oneOrMore>
146
- <ref name="BasicBlock"/>
147
- </oneOrMore>
148
- <zeroOrMore>
149
- <ref name="note"/>
150
- </zeroOrMore>
151
- </group>
152
- <oneOrMore>
153
- <ref name="clause-subsection"/>
154
- </oneOrMore>
155
- </choice>
156
- </define>
157
- <define name="term">
158
- <element name="term">
159
- <optional>
160
- <attribute name="id">
161
- <data type="ID"/>
162
- </attribute>
163
- </optional>
164
- <ref name="preferred"/>
165
- <zeroOrMore>
166
- <ref name="admitted"/>
167
- </zeroOrMore>
168
- <zeroOrMore>
169
- <ref name="deprecates"/>
170
- </zeroOrMore>
171
- <optional>
172
- <ref name="termdomain"/>
173
- </optional>
174
- <ref name="definition"/>
175
- <zeroOrMore>
176
- <ref name="termnote"/>
177
- </zeroOrMore>
178
- <zeroOrMore>
179
- <ref name="termexample"/>
180
- </zeroOrMore>
181
- <zeroOrMore>
182
- <ref name="termsource"/>
183
- </zeroOrMore>
184
- </element>
185
- </define>
186
- <define name="definition">
187
- <element name="definition">
188
- <oneOrMore>
189
- <choice>
190
- <ref name="paragraph"/>
191
- <ref name="figure"/>
192
- <ref name="formula"/>
193
- </choice>
194
- </oneOrMore>
195
- </element>
196
- </define>
197
- <define name="annex">
198
- <element name="annex">
199
- <optional>
200
- <attribute name="id">
201
- <data type="ID"/>
202
- </attribute>
203
- </optional>
204
- <optional>
205
- <attribute name="language"/>
206
- </optional>
207
- <optional>
208
- <attribute name="script"/>
209
- </optional>
210
- <optional>
211
- <attribute name="inline-header">
212
- <data type="boolean"/>
213
- </attribute>
214
- </optional>
215
- <optional>
216
- <attribute name="obligation">
217
- <choice>
218
- <value>normative</value>
219
- <value>informative</value>
220
- </choice>
221
- </attribute>
222
- </optional>
223
- <optional>
224
- <ref name="section-title"/>
225
- </optional>
226
- <zeroOrMore>
227
- <!--
228
- allow hanging paragraps in annexes: they introduce lists
229
- ( paragraph-with-footnote | table | note | formula | admonition | ol | ul | dl | figure | quote | sourcecode | review | example )*,
230
- -->
231
- <ref name="BasicBlock"/>
232
- </zeroOrMore>
233
- <zeroOrMore>
234
- <ref name="note"/>
235
- </zeroOrMore>
236
- <zeroOrMore>
237
- <ref name="clause-hanging-paragraph-with-footnote"/>
238
- </zeroOrMore>
239
- <zeroOrMore>
240
- <ref name="annex-appendix"/>
241
- </zeroOrMore>
242
- </element>
243
- </define>
244
- <define name="AdmonitionType">
245
- <choice>
246
- <value>danger</value>
247
- <value>caution</value>
248
- <value>warning</value>
249
- <value>important</value>
250
- <value>safety precautions</value>
251
- </choice>
252
- </define>
253
- <define name="preface">
254
- <element name="preface">
255
- <optional>
256
- <ref name="preface_abstract"/>
257
- </optional>
258
- <ref name="foreword"/>
259
- <optional>
260
- <ref name="introduction"/>
261
- </optional>
262
- </element>
263
- </define>
264
- <define name="DocumentType">
265
- <choice>
266
- <value>international-standard</value>
267
- <value>technical-specification</value>
268
- <value>technical-report</value>
269
- <value>publicly-available-specification</value>
270
- <value>international-workshop-agreement</value>
271
- <value>guide</value>
272
- <value>amendment</value>
273
- <value>technical-corrigendum</value>
274
- </choice>
275
- </define>
276
- <define name="structuredidentifier">
277
- <element name="structuredidentifier">
278
- <optional>
279
- <attribute name="type"/>
280
- </optional>
281
- <group>
282
- <ref name="documentnumber"/>
283
- <optional>
284
- <ref name="tc-documentnumber"/>
285
- </optional>
286
- </group>
287
- </element>
288
- </define>
289
- <define name="foreword">
290
- <element name="foreword">
291
- <ref name="Basic-Section"/>
292
- </element>
293
- </define>
294
- <define name="introduction">
295
- <element name="introduction">
296
- <ref name="Content-Section"/>
297
- </element>
298
- </define>
299
- <define name="editorialgroup">
300
- <element name="editorialgroup">
301
- <oneOrMore>
302
- <ref name="technical-committee"/>
303
- </oneOrMore>
304
- <zeroOrMore>
305
- <ref name="subcommittee"/>
306
- </zeroOrMore>
307
- <zeroOrMore>
308
- <ref name="workgroup"/>
309
- </zeroOrMore>
310
- <optional>
311
- <ref name="secretariat"/>
312
- </optional>
313
- </element>
314
- </define>
315
- <define name="Content-Section">
316
- <optional>
317
- <attribute name="id">
318
- <data type="ID"/>
319
- </attribute>
320
- </optional>
321
- <optional>
322
- <attribute name="language"/>
323
- </optional>
324
- <optional>
325
- <attribute name="script"/>
326
- </optional>
327
- <optional>
328
- <attribute name="obligation">
329
- <choice>
330
- <value>normative</value>
331
- <value>informative</value>
332
- </choice>
333
- </attribute>
334
- </optional>
335
- <optional>
336
- <ref name="section-title"/>
337
- </optional>
338
- <choice>
339
- <group>
340
- <zeroOrMore>
341
- <ref name="BasicBlock"/>
342
- </zeroOrMore>
343
- <zeroOrMore>
344
- <ref name="note"/>
345
- </zeroOrMore>
346
- </group>
347
- <oneOrMore>
348
- <ref name="content-subsection"/>
349
- </oneOrMore>
350
- </choice>
351
- </define>
352
- <define name="table">
353
- <element name="table">
354
- <attribute name="id">
355
- <data type="ID"/>
356
- </attribute>
357
- <optional>
358
- <attribute name="width"/>
359
- </optional>
360
- <optional>
361
- <attribute name="unnumbered">
362
- <data type="boolean"/>
363
- </attribute>
364
- </optional>
365
- <optional>
366
- <attribute name="subsequence"/>
367
- </optional>
368
- <optional>
369
- <attribute name="alt"/>
370
- </optional>
371
- <optional>
372
- <attribute name="summary"/>
373
- </optional>
374
- <optional>
375
- <attribute name="uri">
376
- <data type="anyURI"/>
377
- </attribute>
378
- </optional>
379
- <optional>
380
- <ref name="tname"/>
381
- </optional>
382
- <optional>
383
- <ref name="thead"/>
384
- </optional>
385
- <ref name="tbody"/>
386
- <optional>
387
- <ref name="tfoot"/>
388
- </optional>
389
- <zeroOrMore>
390
- <ref name="table-note"/>
391
- </zeroOrMore>
392
- <optional>
393
- <ref name="dl"/>
394
- </optional>
395
- </element>
396
- </define>
397
- </include>
398
- <!-- end overrides -->
399
- <!--
400
- We display the Normative References between scope and terms; but to keep the
401
- grammar simple, we keep the references together
402
- -->
403
- <define name="iso-standard">
404
- <element name="iso-standard">
405
- <ref name="bibdata"/>
406
- <zeroOrMore>
407
- <ref name="termdocsource"/>
408
- </zeroOrMore>
409
- <optional>
410
- <ref name="boilerplate"/>
411
- </optional>
412
- <ref name="preface"/>
413
- <oneOrMore>
414
- <ref name="sections"/>
415
- </oneOrMore>
416
- <zeroOrMore>
417
- <ref name="annex"/>
418
- </zeroOrMore>
419
- <ref name="bibliography"/>
420
- </element>
421
- </define>
422
- <define name="documentnumber">
423
- <element name="project-number">
424
- <optional>
425
- <attribute name="part">
426
- <data type="int"/>
427
- </attribute>
428
- </optional>
429
- <optional>
430
- <attribute name="subpart">
431
- <data type="int"/>
432
- </attribute>
433
- </optional>
434
- <text/>
435
- </element>
436
- </define>
437
- <define name="tc-documentnumber">
438
- <element name="tc-document-number">
439
- <data type="int"/>
440
- </element>
441
- </define>
442
- <define name="subcommittee">
443
- <element name="subcommittee">
444
- <ref name="IsoWorkgroup"/>
445
- </element>
446
- </define>
447
- <define name="workgroup">
448
- <element name="workgroup">
449
- <ref name="IsoWorkgroup"/>
450
- </element>
451
- </define>
452
- <define name="secretariat">
453
- <element name="secretariat">
454
- <text/>
455
- </element>
456
- </define>
457
- <define name="clause-hanging-paragraph-with-footnote">
458
- <element name="clause">
459
- <optional>
460
- <attribute name="id">
461
- <data type="ID"/>
462
- </attribute>
463
- </optional>
464
- <optional>
465
- <attribute name="language"/>
466
- </optional>
467
- <optional>
468
- <attribute name="script"/>
469
- </optional>
470
- <optional>
471
- <attribute name="inline-header">
472
- <data type="boolean"/>
473
- </attribute>
474
- </optional>
475
- <optional>
476
- <attribute name="obligation">
477
- <choice>
478
- <value>normative</value>
479
- <value>informative</value>
480
- </choice>
481
- </attribute>
482
- </optional>
483
- <optional>
484
- <ref name="section-title"/>
485
- </optional>
486
- <zeroOrMore>
487
- <!-- allow hanging paragraphs in annexes: they introduce lists -->
488
- <ref name="BasicBlock"/>
489
- </zeroOrMore>
490
- <zeroOrMore>
491
- <ref name="note"/>
492
- </zeroOrMore>
493
- <zeroOrMore>
494
- <ref name="clause-hanging-paragraph-with-footnote"/>
495
- </zeroOrMore>
496
- </element>
497
- </define>
498
- <define name="annex-appendix">
499
- <element name="appendix">
500
- <ref name="Clause-Section"/>
501
- </element>
502
- </define>
503
- <define name="ul_li">
504
- <element name="li">
505
- <optional>
506
- <attribute name="id">
507
- <data type="ID"/>
508
- </attribute>
509
- </optional>
510
- <optional>
511
- <attribute name="uncheckedcheckbox">
512
- <data type="boolean"/>
513
- </attribute>
514
- </optional>
515
- <optional>
516
- <attribute name="checkedcheckbox">
517
- <data type="boolean"/>
518
- </attribute>
519
- </optional>
520
- <oneOrMore>
521
- <ref name="BasicBlock"/>
522
- </oneOrMore>
523
- </element>
524
- </define>
525
- <define name="stagename">
526
- <element name="stagename">
527
- <text/>
528
- </element>
529
- </define>
530
- </grammar>