relaton-3gpp 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: dc9a67e4e91cfa69ac115b3eb9263314e46371dab6a17d817239f42458b85d17
4
- data.tar.gz: a1f1868e75bf1bb214a2c82b0d8602ca4598f17d80db46d76e990d493761c290
3
+ metadata.gz: 4993aeee4498d1ebe35e27a116de70929533ee80ac2a9afeb783f9ed34cac737
4
+ data.tar.gz: cedbd3baeacbc31ca6546cb0effe01fe82bfd9e640f3904d184746169c76819e
5
5
  SHA512:
6
- metadata.gz: fca3c90a8cbcbb69ae7007599e6e923b825e520c50913b82798f7d15c93448a82edf1e5bf1209c735fba32ff79266808f37af259929146ab612ebb9f784de489
7
- data.tar.gz: d01210d357aee80d68d1187e40f94d546e5a99d42c2119ad55f6efac6bc6afc04010a906fdfe9a01d219f4a03dac70c85d6065ff9260f3e8c5c209a0b67bb427
6
+ metadata.gz: 68c6dc3d074bcc95b2e24d96179b23c3ade20d0a48f3af32bd3d7df4acc641d2aeb332b8057ff92249330ffd9f0cec72fd3ce1f270cb9f605407876e07e8b8c0
7
+ data.tar.gz: 13ca9ac5f8abd4e4bc5b2e10cb147eefd061a2be7de4a9c17bd56eda7c5a53df6783d1942b778cd6a5e760dc476c78f5743884f8aad7a73d2642812bc862e8cb
data/README.adoc CHANGED
@@ -42,8 +42,8 @@ end
42
42
  [source,ruby]
43
43
  ----
44
44
  item = Relaton3gpp::Bibliography.get "3GPP TR 00.01U:UMTS/3.0.0"
45
- [relaton-3gpp] (3GPP TR 00.01U:UMTS/3.0.0) fetching repsitory ...
46
- [relaton-3gpp] (3GPP TR 00.01U:UMTS/3.0.0) found `3GPP TR 00.01U:UMTS/3.0.0`
45
+ [relaton-3gpp] (3GPP TR 00.01U:UMTS/3.0.0) Fetching repository ...
46
+ [relaton-3gpp] (3GPP TR 00.01U:UMTS/3.0.0) Found: `3GPP TR 00.01U:UMTS/3.0.0`
47
47
  => #<Relaton3gpp::BibliographicItem:0x00007f92d94264e0
48
48
  ...
49
49
  ----
@@ -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>
@@ -1,6 +1,5 @@
1
1
  module Relaton3gpp
2
2
  class BibliographicItem < RelatonBib::BibliographicItem
3
- DOCTYPES = %w[TR TS].freeze
4
3
  DOCSUBTYPES = %w[spec release].freeze
5
4
  RADIOTECHNOLOGIES = %w[2G 3G LTE 5G].freeze
6
5
 
@@ -12,21 +11,17 @@ module Relaton3gpp
12
11
  # @param [Relaton3gpp::Release] release
13
12
  #
14
13
  def initialize(**args) # rubocop:disable Metrics/AbcSize, Metrics/MethodLength, Metrics/CyclomaticComplexity, Metrics/PerceivedComplexity
14
+ Util.warn "WARNING: Doctype is missing" if args[:type].nil?
15
15
  @radiotechnology = args.delete(:radiotechnology)
16
16
  if @radiotechnology && !RADIOTECHNOLOGIES.include?(@radiotechnology)
17
- Util.warn "Unknown radiotechnology type: `#{@radiotechnology}`"
18
- Util.warn "Possible radiotechnology types: `#{RADIOTECHNOLOGIES.join '`, `'}`"
17
+ Util.warn "WARNING: Unknown radiotechnology type: `#{@radiotechnology}`"
18
+ Util.warn "WARNING: Possible radiotechnology types: `#{RADIOTECHNOLOGIES.join '`, `'}`"
19
19
  end
20
20
  @common_ims_spec = args.delete(:common_ims_spec)
21
21
  @release = args.delete(:release)
22
- if args[:doctype].nil? then Util.warn "doctype is missing"
23
- elsif !DOCTYPES.include?(args[:doctype])
24
- Util.warn "Unknown doctype: `#{args[:doctype]}`"
25
- Util.warn "Possible doctypes: `#{DOCTYPES.join '`, `'}`"
26
- end
27
22
  if args[:docsubtype] && !DOCSUBTYPES.include?(args[:docsubtype])
28
- Util.warn "Unknown docsubtype: `#{args[:docsubtype]}`"
29
- Util.warn "Possible docsubtypes: `#{DOCSUBTYPES.join '`, `'}`"
23
+ Util.warn "WARNING: Unknown docsubtype: `#{args[:docsubtype]}`"
24
+ Util.warn "WARNING: Possible docsubtypes: `#{DOCSUBTYPES.join '`, `'}`"
30
25
  end
31
26
  super(**args)
32
27
  end
@@ -62,7 +57,7 @@ module Relaton3gpp
62
57
  if block_given? then yield b
63
58
  elsif opts[:bibdata] && has_ext_attrs?
64
59
  ext = b.ext do
65
- b.doctype doctype if doctype
60
+ doctype&.to_xml b
66
61
  b.subdoctype subdoctype if subdoctype
67
62
  editorialgroup&.to_xml b
68
63
  ics.each { |i| i.to_xml b }
@@ -34,14 +34,14 @@ module Relaton3gpp
34
34
  # @param opts [Hash] options
35
35
  # @return [RelatonBib::BibliographicItem]
36
36
  def get(ref, _year = nil, _opts = {})
37
- Util.warn "(#{ref}) fetching from Relaton repository ..."
37
+ Util.warn "(#{ref}) Fetching from Relaton repository ..."
38
38
  result = search(ref)
39
39
  unless result
40
- Util.warn "(#{ref}) not found"
40
+ Util.warn "(#{ref}) Not found."
41
41
  return
42
42
  end
43
43
 
44
- Util.warn "(#{ref}) found `#{result.docidentifier[0].id}`"
44
+ Util.warn "(#{ref}) Found: `#{result.docidentifier[0].id}`"
45
45
  result
46
46
  end
47
47
 
@@ -0,0 +1,18 @@
1
+ module Relaton3gpp
2
+ class DocumentType < RelatonBib::DocumentType
3
+ DOCTYPES = %w[TS TR].freeze
4
+
5
+ def initialize(type:, abbreviation: nil)
6
+ check type
7
+ super
8
+ end
9
+
10
+ # @param type [String]
11
+ def check(type)
12
+ unless DOCTYPES.include? type
13
+ Util.warn "WARNING: Unknown doctype: `#{type}`"
14
+ Util.warn "WARNING: Possible doctypes: `#{DOCTYPES.join '`, `'}`"
15
+ end
16
+ end
17
+ end
18
+ end
@@ -1,21 +1,26 @@
1
1
  module Relaton3gpp
2
- class HashConverter < RelatonBib::HashConverter
3
- class << self
4
- def hash_to_bib(args)
5
- hash = super
6
- release_hash_to_bib(hash)
7
- hash
8
- end
2
+ module HashConverter
3
+ include RelatonBib::HashConverter
4
+ extend self
9
5
 
10
- def release_hash_to_bib(hash)
11
- hash[:release] &&= Release.new(**hash[:release])
12
- end
6
+ def hash_to_bib(args)
7
+ hash = super
8
+ release_hash_to_bib(hash)
9
+ hash
10
+ end
11
+
12
+ def release_hash_to_bib(hash)
13
+ hash[:release] &&= Release.new(**hash[:release])
14
+ end
15
+
16
+ # @param item_hash [Hash]
17
+ # @return [Relaton3gpp::BibliographicItem]
18
+ def bib_item(item_hash)
19
+ BibliographicItem.new(**item_hash)
20
+ end
13
21
 
14
- # @param item_hash [Hash]
15
- # @return [Relaton3gpp::BibliographicItem]
16
- def bib_item(item_hash)
17
- BibliographicItem.new(**item_hash)
18
- end
22
+ def create_doctype(**type)
23
+ DocumentType.new(**type)
19
24
  end
20
25
  end
21
26
  end
@@ -54,7 +54,7 @@ module Relaton3gpp
54
54
  docid: parse_docid,
55
55
  docnumber: number,
56
56
  date: parse_date,
57
- doctype: @spec[:Type],
57
+ doctype: DocumentType.new(type: @spec[:Type]),
58
58
  editorialgroup: parse_editorialgroup,
59
59
  biblionote: parse_note,
60
60
  docstatus: parse_status,
@@ -92,7 +92,7 @@ module Relaton3gpp
92
92
  #
93
93
  # Parse abstract
94
94
  #
95
- # @return [Array<RelatonBib::FormattedString>]
95
+ # @return [Array<RelatonBib::FormattedString>]
96
96
  #
97
97
  def parse_abstract
98
98
  return [] unless @spec[:description]
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Relaton3gpp
4
- VERSION = "1.16.2"
4
+ VERSION = "1.17.0"
5
5
  end
data/lib/relaton_3gpp.rb CHANGED
@@ -6,6 +6,7 @@ require "relaton_bib"
6
6
  require_relative "relaton_3gpp/version"
7
7
  require_relative "relaton_3gpp/config"
8
8
  require_relative "relaton_3gpp/util"
9
+ require_relative "relaton_3gpp/document_type"
9
10
  require_relative "relaton_3gpp/release"
10
11
  require_relative "relaton_3gpp/bibliographic_item"
11
12
  require_relative "relaton_3gpp/hash_converter"
data/relaton_3gpp.gemspec CHANGED
@@ -38,7 +38,7 @@ Gem::Specification.new do |spec|
38
38
 
39
39
  spec.add_dependency "mdb", "~> 0.5.0"
40
40
  spec.add_dependency "net-ftp", "~> 0.1.0"
41
- spec.add_dependency "relaton-bib", "~> 1.16.0"
41
+ spec.add_dependency "relaton-bib", "~> 1.17.0"
42
42
  spec.add_dependency "relaton-index", "~> 0.2.0"
43
43
  spec.add_dependency "rubyzip", "~> 2.3.0"
44
44
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: relaton-3gpp
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-06 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: mdb
@@ -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
@@ -109,6 +109,7 @@ files:
109
109
  - lib/relaton_3gpp/bibliography.rb
110
110
  - lib/relaton_3gpp/config.rb
111
111
  - lib/relaton_3gpp/data_fetcher.rb
112
+ - lib/relaton_3gpp/document_type.rb
112
113
  - lib/relaton_3gpp/hash_converter.rb
113
114
  - lib/relaton_3gpp/parser.rb
114
115
  - lib/relaton_3gpp/processor.rb