relaton-3gpp 1.19.1 → 1.20.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 45004cd52d3255e9882f17e3c4331025aaf389c21ad1c756ba3aeccd5953f5b0
4
- data.tar.gz: d87bbfcdbdd04d17726554e7bcbd7438b8edc5f31dcc7030553522f292ea9ec2
3
+ metadata.gz: 74bc486a5a0d3e66901c7640aa55f126d9450c51df3bdf89862f5a3b0b691f49
4
+ data.tar.gz: fc8f0453409f49844546bf9ab06cea41003bd2cc8fea6a0a397e4be3fe460ecd
5
5
  SHA512:
6
- metadata.gz: 9e11c551066552effe3e897850210ba5b7e06f033b5ddc2798f1ec74b68534cd3b87772b6175f506af4909e376f55c078701035a2a4353399ab8f88f4ffc1d76
7
- data.tar.gz: 2303de76da8eebe06ac967b54fe08b4e2cb78215f66cf8a789182f8c81d89286ca97034e1617dee50b0efb0e92a90c7aa75914903c0e79a336b830daa613e2d4
6
+ metadata.gz: 169902768cd60d092d4928972d9126de1e749ab958645f9eb7b5f383552f0bbaa148ba899a07bf2f09625e760b6625487ee259661b75ce265a699e7e474b65f0
7
+ data.tar.gz: 5d80742c1ec0afb5c6c83165ef5adfef79644fe245a7cab2ebd27ee35894c4a4c29f85414fb5e7ab51b6ad1dc888f2a5d0b771aa785babe9dd4d255c024bb13e
data/README.adoc CHANGED
@@ -127,7 +127,7 @@ Relaton3gpp::BibliographicItem.new(**bib_hash)
127
127
 
128
128
  === Fetch data
129
129
 
130
- There is a 3GPP dataset ftp://www.3gpp.org/Information/Databases/Spec_Status/[latest *.zip] which can be converted into RelatonXML/BibXML/BibYAML formats.
130
+ There is a 3GPP dataset ftp://www.3gpp.org/Information/Databases/[latest *.csv] which can be converted into RelatonXML/BibXML/BibYAML formats.
131
131
 
132
132
  The method `Relaton3GPP::DataFetcher.fetch(output: "data", format: "yaml")` converts all the documents from the dataset and save them to the `./data` folder in YAML format.
133
133
  Arguments:
@@ -3,12 +3,15 @@ module Relaton3gpp
3
3
  DOCSUBTYPES = %w[spec release].freeze
4
4
  RADIOTECHNOLOGIES = %w[2G 3G LTE 5G].freeze
5
5
 
6
+ # @return [String, nil]
7
+ attr_reader :radiotechnology, :release
8
+
6
9
  #
7
10
  # Initialize bibliographic item.
8
11
  #
9
- # @param [String] radiotechnology
12
+ # @param [String, nil] radiotechnology
10
13
  # @param [Boolean] common_ims_spec
11
- # @param [Relaton3gpp::Release] release
14
+ # @param [Relaton3gpp::Release, nil] release
12
15
  #
13
16
  def initialize(**args) # rubocop:disable Metrics/AbcSize, Metrics/MethodLength, Metrics/CyclomaticComplexity, Metrics/PerceivedComplexity
14
17
  Util.warn "Doctype is missing" if args[:type].nil?
@@ -61,9 +64,9 @@ module Relaton3gpp
61
64
  b.subdoctype subdoctype if subdoctype
62
65
  editorialgroup&.to_xml b
63
66
  ics.each { |i| i.to_xml b }
64
- b.radiotechnology @radiotechnology if @radiotechnology
67
+ b.radiotechnology radiotechnology if radiotechnology
65
68
  b.send :"common-ims-spec", @common_ims_spec if @common_ims_spec
66
- @release&.to_xml b
69
+ release&.to_xml b
67
70
  end
68
71
  ext["schema-version"] = ext_schema unless opts[:embedded]
69
72
  end
@@ -71,8 +74,8 @@ module Relaton3gpp
71
74
  end
72
75
 
73
76
  def has_ext_attrs? # rubocop:disable Metrics/CyclomaticComplexity
74
- doctype || subdoctype || editorialgroup || ics.any? || @radiotechnology ||
75
- @common_ims_spec || @release
77
+ doctype || subdoctype || editorialgroup || ics.any? || radiotechnology ||
78
+ @common_ims_spec || release
76
79
  end
77
80
 
78
81
  #
@@ -82,10 +85,14 @@ module Relaton3gpp
82
85
  #
83
86
  def to_hash(embedded: false)
84
87
  hash = super
85
- hash["radiotechnology"] = @radiotechnology if @radiotechnology
86
- hash["common-ims-spec"] = @common_ims_spec if @common_ims_spec
87
- hash["release"] = @release.to_hash if @release
88
+ hash["ext"]["radiotechnology"] = radiotechnology if radiotechnology
89
+ hash["ext"]["common-ims-spec"] = @common_ims_spec if @common_ims_spec
90
+ hash["ext"]["release"] = release.to_hash if release
88
91
  hash
89
92
  end
93
+
94
+ def has_ext?
95
+ super || radiotechnology || @common_ims_spec || release
96
+ end
90
97
  end
91
98
  end
@@ -5,12 +5,17 @@ module Relaton3gpp
5
5
 
6
6
  def hash_to_bib(args)
7
7
  hash = super
8
+ hash[:radiotechnology] = hash[:ext][:radiotechnology] if hash.dig(:ext, :radiotechnology)
9
+ hash[:common_ims_spec] = hash[:ext][:"common-ims-spec"] if hash.dig(:ext, :"common-ims-spec")
8
10
  release_hash_to_bib(hash)
9
11
  hash
10
12
  end
11
13
 
12
14
  def release_hash_to_bib(hash)
13
- hash[:release] &&= Release.new(**hash[:release])
15
+ release = hash.dig(:ext, :release) || hash[:release] # @TODO remove hash[:release] after release is moved to ext
16
+ return unless release
17
+
18
+ hash[:release] = Release.new(**release)
14
19
  end
15
20
 
16
21
  # @param item_hash [Hash]
@@ -40,6 +40,7 @@ module Relaton3gpp
40
40
  date: parse_date,
41
41
  doctype: parse_doctype,
42
42
  editorialgroup: parse_editorialgroup,
43
+ version: parse_version,
43
44
  # biblionote: parse_note,
44
45
  # docstatus: parse_status,
45
46
  radiotechnology: parse_radiotechnology,
@@ -100,7 +101,15 @@ module Relaton3gpp
100
101
  def number
101
102
  num = "#{doctype_abbr} #{@row[0]}"
102
103
  num += ":#{release}" if release
103
- "#{num}/#{@row['Version']}"
104
+ "#{num}/#{version}"
105
+ end
106
+
107
+ def version
108
+ @row["Version"]
109
+ end
110
+
111
+ def parse_version
112
+ [RelatonBib::BibliographicItem::Version.new(nil, version)]
104
113
  end
105
114
 
106
115
  def doctype_abbr
@@ -199,11 +208,11 @@ module Relaton3gpp
199
208
  # @return [String] radio technology
200
209
  #
201
210
  def parse_radiotechnology
202
- case @row[:"WPM Code 3G"]
211
+ case @row["WPM Code 3G"]
203
212
  when /5G/ then "5G"
204
213
  when /4G/ then "LTE"
205
214
  when /3G/ then "3G"
206
- else @row[:"WPM Code 2G"] && "2G"
215
+ else @row["WPM Code 2G"] && "2G"
207
216
  end
208
217
  end
209
218
 
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Relaton3gpp
4
- VERSION = "1.19.1"
4
+ VERSION = "1.20.0"
5
5
  end
data/relaton_3gpp.gemspec CHANGED
@@ -38,6 +38,6 @@ Gem::Specification.new do |spec| # rubocop:disable Metrics/BlockLength
38
38
 
39
39
  spec.add_dependency "csv"
40
40
  spec.add_dependency "net-ftp", "~> 0.1.0"
41
- spec.add_dependency "relaton-bib", "~> 1.19.1"
41
+ spec.add_dependency "relaton-bib", "~> 1.20.0"
42
42
  spec.add_dependency "relaton-index", "~> 0.2.0"
43
43
  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.19.1
4
+ version: 1.20.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: 2024-07-12 00:00:00.000000000 Z
11
+ date: 2024-12-12 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: csv
@@ -44,14 +44,14 @@ dependencies:
44
44
  requirements:
45
45
  - - "~>"
46
46
  - !ruby/object:Gem::Version
47
- version: 1.19.1
47
+ version: 1.20.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.19.1
54
+ version: 1.20.0
55
55
  - !ruby/object:Gem::Dependency
56
56
  name: relaton-index
57
57
  requirement: !ruby/object:Gem::Requirement
@@ -108,7 +108,7 @@ licenses:
108
108
  - BSD-2-Clause
109
109
  metadata:
110
110
  homepage_uri: https://github.com/relaton/relaton-3gpp
111
- post_install_message:
111
+ post_install_message:
112
112
  rdoc_options: []
113
113
  require_paths:
114
114
  - lib
@@ -124,7 +124,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
124
124
  version: '0'
125
125
  requirements: []
126
126
  rubygems_version: 3.3.27
127
- signing_key:
127
+ signing_key:
128
128
  specification_version: 4
129
129
  summary: 'Relaton3gpp: Ruby XMLDOC impementation.'
130
130
  test_files: []