relaton-3gpp 1.16.0 → 1.16.2

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: 278b44aea0c38ddea22e6a0a21878f5cb3d9583d075fa834e6393e38697afcee
4
- data.tar.gz: 3a45e0924830617708fae512d3d5702d15a5b338b2604f0d29ff91b0fb1d4da4
3
+ metadata.gz: dc9a67e4e91cfa69ac115b3eb9263314e46371dab6a17d817239f42458b85d17
4
+ data.tar.gz: a1f1868e75bf1bb214a2c82b0d8602ca4598f17d80db46d76e990d493761c290
5
5
  SHA512:
6
- metadata.gz: 6f14e50f4d8923a65f8cb3fd17221f73cf7a7f31d5a3ff9115ee7369c3f48ec17ee1b641c0f116aa3f1df3ee9e7b815aeeef4286f98f1a69a58058bcc86546be
7
- data.tar.gz: 431626986874aa0cac2ca4d2dd4ad921ad7fd3ce3ecea958a2376f0294e54ab54ade75643ff0ea0d2185ed74e208c85469d27b8594180f6dfb3d48fdcd5df064
6
+ metadata.gz: fca3c90a8cbcbb69ae7007599e6e923b825e520c50913b82798f7d15c93448a82edf1e5bf1209c735fba32ff79266808f37af259929146ab612ebb9f784de489
7
+ data.tar.gz: d01210d357aee80d68d1187e40f94d546e5a99d42c2119ad55f6efac6bc6afc04010a906fdfe9a01d219f4a03dac70c85d6065ff9260f3e8c5c209a0b67bb427
data/README.adoc CHANGED
@@ -23,16 +23,27 @@ Or install it yourself as:
23
23
 
24
24
  == Usage
25
25
 
26
- === Search for a standard using keywords
26
+ === Configuration
27
+
28
+ Configuration is optional. The available option is `logger` which is a `Logger` instance. By default, the logger is `Logger.new($stderr)` with `Logger::WARN` level. To change the logger level, use `Relaton3gpp.configure` block.
27
29
 
28
30
  [source,ruby]
29
31
  ----
30
32
  require 'relaton_3gpp'
31
33
  => true
32
34
 
35
+ Relaton3gpp.configure do |config|
36
+ config.logger.level = Logger::DEBUG
37
+ end
38
+ ----
39
+
40
+ === Search for a standard using keywords
41
+
42
+ [source,ruby]
43
+ ----
33
44
  item = Relaton3gpp::Bibliography.get "3GPP TR 00.01U:UMTS/3.0.0"
34
- [relaton-3gpp] ("3GPP TR 00.01U:UMTS/3.0.0") fetching...
35
- [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 repsitory ...
46
+ [relaton-3gpp] (3GPP TR 00.01U:UMTS/3.0.0) found `3GPP TR 00.01U:UMTS/3.0.0`
36
47
  => #<Relaton3gpp::BibliographicItem:0x00007f92d94264e0
37
48
  ...
38
49
  ----
@@ -14,19 +14,19 @@ module Relaton3gpp
14
14
  def initialize(**args) # rubocop:disable Metrics/AbcSize, Metrics/MethodLength, Metrics/CyclomaticComplexity, Metrics/PerceivedComplexity
15
15
  @radiotechnology = args.delete(:radiotechnology)
16
16
  if @radiotechnology && !RADIOTECHNOLOGIES.include?(@radiotechnology)
17
- warn "[relaton-3gpp] Unknown radiotechnology type: #{@radiotechnology}"
18
- warn "[relaton-3gpp] Possible radiotechnology types: #{RADIOTECHNOLOGIES.join ' '}"
17
+ Util.warn "Unknown radiotechnology type: `#{@radiotechnology}`"
18
+ Util.warn "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 warn "[relaton-3gpp] doctype is missing"
22
+ if args[:doctype].nil? then Util.warn "doctype is missing"
23
23
  elsif !DOCTYPES.include?(args[:doctype])
24
- warn "[relaton-3gpp] Unknown doctype: #{args[:doctype]}"
25
- warn "[relaton-3gpp] Possible doctypes: #{DOCTYPES.join ' '}"
24
+ Util.warn "Unknown doctype: `#{args[:doctype]}`"
25
+ Util.warn "Possible doctypes: `#{DOCTYPES.join '`, `'}`"
26
26
  end
27
27
  if args[:docsubtype] && !DOCSUBTYPES.include?(args[:docsubtype])
28
- warn "[relaton-3gpp] Unknown docsubtype: #{args[:docsubtype]}"
29
- warn "[relaton-3gpp] Possible docsubtypes: #{DOCSUBTYPES.join ' '}"
28
+ Util.warn "Unknown docsubtype: `#{args[:docsubtype]}`"
29
+ Util.warn "Possible docsubtypes: `#{DOCSUBTYPES.join '`, `'}`"
30
30
  end
31
31
  super(**args)
32
32
  end
@@ -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
- warn "[relaton-3gpp] (\"#{ref}\") fetching..."
37
+ Util.warn "(#{ref}) fetching from Relaton repository ..."
38
38
  result = search(ref)
39
39
  unless result
40
- warn "[relaton-3gpp] (\"#{ref}\") not found"
40
+ Util.warn "(#{ref}) not found"
41
41
  return
42
42
  end
43
43
 
44
- warn "[relaton-3gpp] (\"#{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,10 @@
1
+ module Relaton3gpp
2
+ module Config
3
+ include RelatonBib::Config
4
+ end
5
+ extend Config
6
+
7
+ class Configuration < RelatonBib::Configuration
8
+ PROGNAME = "relaton-3gpp".freeze
9
+ end
10
+ end
@@ -0,0 +1,9 @@
1
+ module Relaton3gpp
2
+ module Util
3
+ extend RelatonBib::Util
4
+
5
+ def self.logger
6
+ Relaton3gpp.configuration.logger
7
+ end
8
+ end
9
+ end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Relaton3gpp
4
- VERSION = "1.16.0"
4
+ VERSION = "1.16.2"
5
5
  end
data/lib/relaton_3gpp.rb CHANGED
@@ -4,6 +4,8 @@ require "net/http"
4
4
  require "relaton/index"
5
5
  require "relaton_bib"
6
6
  require_relative "relaton_3gpp/version"
7
+ require_relative "relaton_3gpp/config"
8
+ require_relative "relaton_3gpp/util"
7
9
  require_relative "relaton_3gpp/release"
8
10
  require_relative "relaton_3gpp/bibliographic_item"
9
11
  require_relative "relaton_3gpp/hash_converter"
@@ -18,9 +20,9 @@ module Relaton3gpp
18
20
  # Returns hash of XML reammar
19
21
  # @return [String]
20
22
  def self.grammar_hash
21
- gem_path = File.expand_path "..", __dir__
22
- grammars_path = File.join gem_path, "grammars", "*"
23
- grammars = Dir[grammars_path].sort.map { |gp| File.read gp }.join
24
- Digest::MD5.hexdigest grammars
23
+ # gem_path = File.expand_path "..", __dir__
24
+ # grammars_path = File.join gem_path, "grammars", "*"
25
+ # grammars = Dir[grammars_path].sort.map { |gp| File.read gp }.join
26
+ Digest::MD5.hexdigest Relaton3gpp::VERSION + RelatonBib::VERSION # grammars
25
27
  end
26
28
  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.0
4
+ version: 1.16.2
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-09-03 00:00:00.000000000 Z
11
+ date: 2023-10-06 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: mdb
@@ -107,11 +107,13 @@ files:
107
107
  - lib/relaton_3gpp.rb
108
108
  - lib/relaton_3gpp/bibliographic_item.rb
109
109
  - lib/relaton_3gpp/bibliography.rb
110
+ - lib/relaton_3gpp/config.rb
110
111
  - lib/relaton_3gpp/data_fetcher.rb
111
112
  - lib/relaton_3gpp/hash_converter.rb
112
113
  - lib/relaton_3gpp/parser.rb
113
114
  - lib/relaton_3gpp/processor.rb
114
115
  - lib/relaton_3gpp/release.rb
116
+ - lib/relaton_3gpp/util.rb
115
117
  - lib/relaton_3gpp/version.rb
116
118
  - lib/relaton_3gpp/xml_parser.rb
117
119
  - relaton_3gpp.gemspec