relaton-oasis 1.16.2 → 1.17.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/README.adoc +3 -3
- data/grammars/basicdoc.rng +18 -2
- data/grammars/biblio.rng +1 -0
- data/lib/relaton_oasis/data_parser_utils.rb +9 -8
- data/lib/relaton_oasis/document_type.rb +16 -0
- data/lib/relaton_oasis/hash_converter.rb +13 -8
- data/lib/relaton_oasis/oasis_bibliographic_item.rb +2 -2
- data/lib/relaton_oasis/version.rb +1 -1
- data/lib/relaton_oasis.rb +1 -0
- data/relaton_oasis.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: f5469967625cf054d713b017d05167fe3b0360d7ffd76472c4f5915583498702
|
|
4
|
+
data.tar.gz: d5e2d86d21472cdf36434e66549e592412ec217085c49e57904d0ede564ee902
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: dde0c10159a3c48e996b0bf27e8f57b36a84aa36998dfaae20515aee8eef38ba732d0fc808a5e326c492dfd2a08eb4090deb161522937a2b26a8299d3ece4b03
|
|
7
|
+
data.tar.gz: b0b264297ebe67a008062d653907377407cacd8c5044de408df2ca37e063e0a1ede7dce5da3e702df664115d228db3b7b740af64fa8743b497146a5ecbf2008e
|
data/README.adoc
CHANGED
|
@@ -62,7 +62,7 @@ item = RelatonOasis::OasisBibliography.get "OASIS amqp-core"
|
|
|
62
62
|
[source,ruby]
|
|
63
63
|
----
|
|
64
64
|
item.to_xml
|
|
65
|
-
=> "<bibitem id="OASISamqp-core" type="standard" schema-version="v1.2.
|
|
65
|
+
=> "<bibitem id="OASISamqp-core" type="standard" schema-version="v1.2.5">
|
|
66
66
|
<fetched>2022-12-05</fetched>
|
|
67
67
|
<title type="main" format="text/plain" language="en" script="Latn">Advanced Message Queueing Protocol (AMQP) v1.0</title>
|
|
68
68
|
<docidentifier type="OASIS" primary="true">OASIS amqp-core</docidentifier>
|
|
@@ -75,7 +75,7 @@ With argument `bibdata: true` it ouputs XML wrapped by `bibdata` element and add
|
|
|
75
75
|
[source,ruby]
|
|
76
76
|
----
|
|
77
77
|
item.to_xml bibdata: true
|
|
78
|
-
=> "<bibdata type="standard" schema-version="v1.2.
|
|
78
|
+
=> "<bibdata type="standard" schema-version="v1.2.5">
|
|
79
79
|
<fetched>2022-12-05</fetched>
|
|
80
80
|
<title type="main" format="text/plain" language="en" script="Latn">Advanced Message Queueing Protocol (AMQP) v1.0</title>
|
|
81
81
|
<docidentifier type="OASIS" primary="true">OASIS amqp-core</docidentifier>
|
|
@@ -121,7 +121,7 @@ RelatonOasis::XMLParser.from_xml File.read("spec/fixtures/oasis_bibdata.xml")
|
|
|
121
121
|
[source,ruby]
|
|
122
122
|
----
|
|
123
123
|
hash = YAML.load_file "spec/fixtures/oasis_bibdata.yaml"
|
|
124
|
-
=> {"schema-version"=>"v1.2.
|
|
124
|
+
=> {"schema-version"=>"v1.2.5",
|
|
125
125
|
"id"=>"OASISamqp-core",
|
|
126
126
|
...
|
|
127
127
|
|
data/grammars/basicdoc.rng
CHANGED
|
@@ -346,6 +346,8 @@
|
|
|
346
346
|
<ref name="keyword"/>
|
|
347
347
|
<ref name="xref"/>
|
|
348
348
|
<ref name="hyperlink"/>
|
|
349
|
+
<ref name="index"/>
|
|
350
|
+
<ref name="index-xref"/>
|
|
349
351
|
</choice>
|
|
350
352
|
</oneOrMore>
|
|
351
353
|
</element>
|
|
@@ -623,6 +625,8 @@
|
|
|
623
625
|
<ref name="eref"/>
|
|
624
626
|
<ref name="xref"/>
|
|
625
627
|
<ref name="hyperlink"/>
|
|
628
|
+
<ref name="index"/>
|
|
629
|
+
<ref name="index-xref"/>
|
|
626
630
|
</choice>
|
|
627
631
|
</zeroOrMore>
|
|
628
632
|
</element>
|
|
@@ -636,6 +640,8 @@
|
|
|
636
640
|
<ref name="eref"/>
|
|
637
641
|
<ref name="xref"/>
|
|
638
642
|
<ref name="hyperlink"/>
|
|
643
|
+
<ref name="index"/>
|
|
644
|
+
<ref name="index-xref"/>
|
|
639
645
|
</choice>
|
|
640
646
|
</zeroOrMore>
|
|
641
647
|
</element>
|
|
@@ -648,6 +654,8 @@
|
|
|
648
654
|
<ref name="eref"/>
|
|
649
655
|
<ref name="xref"/>
|
|
650
656
|
<ref name="hyperlink"/>
|
|
657
|
+
<ref name="index"/>
|
|
658
|
+
<ref name="index-xref"/>
|
|
651
659
|
</choice>
|
|
652
660
|
</zeroOrMore>
|
|
653
661
|
</element>
|
|
@@ -655,7 +663,11 @@
|
|
|
655
663
|
<define name="keyword">
|
|
656
664
|
<element name="keyword">
|
|
657
665
|
<zeroOrMore>
|
|
658
|
-
<
|
|
666
|
+
<choice>
|
|
667
|
+
<ref name="PureTextElement"/>
|
|
668
|
+
<ref name="index"/>
|
|
669
|
+
<ref name="index-xref"/>
|
|
670
|
+
</choice>
|
|
659
671
|
</zeroOrMore>
|
|
660
672
|
</element>
|
|
661
673
|
</define>
|
|
@@ -676,7 +688,11 @@
|
|
|
676
688
|
<define name="strike">
|
|
677
689
|
<element name="strike">
|
|
678
690
|
<zeroOrMore>
|
|
679
|
-
<
|
|
691
|
+
<choice>
|
|
692
|
+
<ref name="PureTextElement"/>
|
|
693
|
+
<ref name="index"/>
|
|
694
|
+
<ref name="index-xref"/>
|
|
695
|
+
</choice>
|
|
680
696
|
</zeroOrMore>
|
|
681
697
|
</element>
|
|
682
698
|
</define>
|
data/grammars/biblio.rng
CHANGED
|
@@ -150,16 +150,17 @@ module RelatonOasis
|
|
|
150
150
|
#
|
|
151
151
|
# Parse document type.
|
|
152
152
|
#
|
|
153
|
-
# @return [
|
|
153
|
+
# @return [RelatonOasis::DocumentType] document type
|
|
154
154
|
#
|
|
155
155
|
def parse_doctype
|
|
156
|
-
case text
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
156
|
+
type = case text
|
|
157
|
+
when /OASIS Project Specification/, /Committee Specification/
|
|
158
|
+
"specification"
|
|
159
|
+
when /Technical Memorandum/ then "memorandum"
|
|
160
|
+
when /Technical Resolution/ then "resolution"
|
|
161
|
+
else "standard"
|
|
162
|
+
end
|
|
163
|
+
DocumentType.new(type: type)
|
|
163
164
|
end
|
|
164
165
|
|
|
165
166
|
#
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
module RelatonOasis
|
|
2
|
+
class DocumentType < RelatonBib::DocumentType
|
|
3
|
+
DCTYPES = %w[specification memorandum resolution standard].freeze
|
|
4
|
+
|
|
5
|
+
def initialize(type:, abbreviation: nil)
|
|
6
|
+
chceck_type type
|
|
7
|
+
super
|
|
8
|
+
end
|
|
9
|
+
|
|
10
|
+
def chceck_type(type)
|
|
11
|
+
unless DCTYPES.include? type
|
|
12
|
+
Util.warn "WARNING: invalid doctype: `#{type}`"
|
|
13
|
+
end
|
|
14
|
+
end
|
|
15
|
+
end
|
|
16
|
+
end
|
|
@@ -1,15 +1,20 @@
|
|
|
1
1
|
module RelatonOasis
|
|
2
|
-
|
|
2
|
+
module HashConverter
|
|
3
|
+
include RelatonBib::HashConverter
|
|
4
|
+
extend self
|
|
5
|
+
|
|
3
6
|
@@acronyms = nil
|
|
4
7
|
|
|
5
|
-
|
|
6
|
-
|
|
8
|
+
private
|
|
9
|
+
|
|
10
|
+
# @param item_hash [Hash]
|
|
11
|
+
# @return [RelatonBib::BibliographicItem]
|
|
12
|
+
def bib_item(item_hash)
|
|
13
|
+
OasisBibliographicItem.new(**item_hash)
|
|
14
|
+
end
|
|
7
15
|
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
def bib_item(item_hash)
|
|
11
|
-
OasisBibliographicItem.new(**item_hash)
|
|
12
|
-
end
|
|
16
|
+
def create_doctype(**args)
|
|
17
|
+
DocumentType.new(**args)
|
|
13
18
|
end
|
|
14
19
|
end
|
|
15
20
|
end
|
|
@@ -53,11 +53,11 @@ module RelatonOasis
|
|
|
53
53
|
#
|
|
54
54
|
# @return [String] XML representation of bibliographic item
|
|
55
55
|
#
|
|
56
|
-
def to_xml(**opts)
|
|
56
|
+
def to_xml(**opts) # rubocop:disable Metrics/AbcSize,Metrics/CyclomaticComplexity
|
|
57
57
|
super(**opts) do |b|
|
|
58
58
|
if opts[:bibdata] && technology_area.any?
|
|
59
59
|
ext = b.ext do
|
|
60
|
-
|
|
60
|
+
doctype&.to_xml b
|
|
61
61
|
editorialgroup&.to_xml b
|
|
62
62
|
technology_area.each { |ta| b.send :"technology-area", ta }
|
|
63
63
|
end
|
data/lib/relaton_oasis.rb
CHANGED
|
@@ -6,6 +6,7 @@ require "relaton_bib"
|
|
|
6
6
|
require_relative "relaton_oasis/version"
|
|
7
7
|
require_relative "relaton_oasis/config"
|
|
8
8
|
require_relative "relaton_oasis/util"
|
|
9
|
+
require_relative "relaton_oasis/document_type"
|
|
9
10
|
require_relative "relaton_oasis/oasis_bibliographic_item"
|
|
10
11
|
require_relative "relaton_oasis/xml_parser"
|
|
11
12
|
require_relative "relaton_oasis/hash_converter"
|
data/relaton_oasis.gemspec
CHANGED
|
@@ -33,7 +33,7 @@ Gem::Specification.new do |spec|
|
|
|
33
33
|
|
|
34
34
|
spec.add_dependency "mechanize", "~> 2.8.0"
|
|
35
35
|
spec.add_dependency "multi_json", "~> 1.15.0"
|
|
36
|
-
spec.add_dependency "relaton-bib", "~> 1.
|
|
36
|
+
spec.add_dependency "relaton-bib", "~> 1.17.0"
|
|
37
37
|
spec.add_dependency "relaton-index", "~> 0.2.0"
|
|
38
38
|
|
|
39
39
|
# For more information and examples about making a new gem, checkout our
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: relaton-oasis
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 1.
|
|
4
|
+
version: 1.17.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: 2023-
|
|
11
|
+
date: 2023-11-27 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: mechanize
|
|
@@ -44,14 +44,14 @@ dependencies:
|
|
|
44
44
|
requirements:
|
|
45
45
|
- - "~>"
|
|
46
46
|
- !ruby/object:Gem::Version
|
|
47
|
-
version: 1.
|
|
47
|
+
version: 1.17.0
|
|
48
48
|
type: :runtime
|
|
49
49
|
prerelease: false
|
|
50
50
|
version_requirements: !ruby/object:Gem::Requirement
|
|
51
51
|
requirements:
|
|
52
52
|
- - "~>"
|
|
53
53
|
- !ruby/object:Gem::Version
|
|
54
|
-
version: 1.
|
|
54
|
+
version: 1.17.0
|
|
55
55
|
- !ruby/object:Gem::Dependency
|
|
56
56
|
name: relaton-index
|
|
57
57
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -97,6 +97,7 @@ files:
|
|
|
97
97
|
- lib/relaton_oasis/data_parser.rb
|
|
98
98
|
- lib/relaton_oasis/data_parser_utils.rb
|
|
99
99
|
- lib/relaton_oasis/data_part_parser.rb
|
|
100
|
+
- lib/relaton_oasis/document_type.rb
|
|
100
101
|
- lib/relaton_oasis/hash_converter.rb
|
|
101
102
|
- lib/relaton_oasis/index.rb
|
|
102
103
|
- lib/relaton_oasis/oasis_bibliographic_item.rb
|