relaton-oasis 1.16.2 → 1.17.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: 186697624e16817571af23ec1665efd8a562bbba0c9b980ab3068b1d7dfb24e6
4
- data.tar.gz: 327389bf02d3f0ba84ce42ae08f9473215305c9ca72017ca80cc0bc39c64ed20
3
+ metadata.gz: f5469967625cf054d713b017d05167fe3b0360d7ffd76472c4f5915583498702
4
+ data.tar.gz: d5e2d86d21472cdf36434e66549e592412ec217085c49e57904d0ede564ee902
5
5
  SHA512:
6
- metadata.gz: 44148f1ebdc5e14d6ab59323192415e37f6d812df9147d0fb3fb9b73aab0a35cd65e59077c17ef3ffca684840e909df07975ebfe596bef5885e729a4814b5107
7
- data.tar.gz: f9cf5995c54f4d0a086f523ed018857a38459c60667df2065fc6c5cd8e74e2d85a0c0b4c7c404d05161197c59734540dfe456aac91c48f0b5be52ef105efa569
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.4">
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.4">
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.4",
124
+ => {"schema-version"=>"v1.2.5",
125
125
  "id"=>"OASISamqp-core",
126
126
  ...
127
127
 
@@ -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
- <ref name="PureTextElement"/>
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
- <ref name="PureTextElement"/>
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
@@ -942,6 +942,7 @@
942
942
  <value>obsoleted</value>
943
943
  <value>confirmed</value>
944
944
  <value>updated</value>
945
+ <value>corrected</value>
945
946
  <value>issued</value>
946
947
  <value>transmitted</value>
947
948
  <value>copied</value>
@@ -150,16 +150,17 @@ module RelatonOasis
150
150
  #
151
151
  # Parse document type.
152
152
  #
153
- # @return [String] document type
153
+ # @return [RelatonOasis::DocumentType] document type
154
154
  #
155
155
  def parse_doctype
156
- 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
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
- class HashConverter < RelatonBib::HashConverter
2
+ module HashConverter
3
+ include RelatonBib::HashConverter
4
+ extend self
5
+
3
6
  @@acronyms = nil
4
7
 
5
- class << self
6
- private
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
- # @param item_hash [Hash]
9
- # @return [RelatonBib::BibliographicItem]
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
- b.doctype doctype if doctype
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
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module RelatonOasis
4
- VERSION = "1.16.2"
4
+ VERSION = "1.17.0"
5
5
  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"
@@ -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.16.0"
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.16.2
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-10-18 00:00:00.000000000 Z
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.16.0
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.16.0
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