relaton-etsi 1.18.0 → 1.19.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: bd8b1afecd70ee7ac07ba4b734af8b0b9ade5998348866f82876b06bfd7be068
4
- data.tar.gz: cd83c99606d209824fffaa12ea2133eccf6c0b73a92d010d30e9353307d63303
3
+ metadata.gz: 7e6de56729e08a6ed75056d304e5bf59b79882496c0e86edf99ba144ef56e3ac
4
+ data.tar.gz: fc98cc4219dba9e46e33a25217eab20d2ce97512229b619bdf7984e8f8d078ba
5
5
  SHA512:
6
- metadata.gz: 5ca5594263e19b6fa91fb59d5f1c5a55cbd24c59bc45de30761e644c26859cce4da0bdebf3e5d5330fa6d83696b5a3843aca401b4c46ea3618892c81576a5eee
7
- data.tar.gz: 8f5633242ded91de51eb65c456e7ddd9286159cef042043d29dd1abc1452ccab42736911cf6fc52f00cdfb5a969a9e1b426922f41486eb2112d344816966ed39
6
+ metadata.gz: 45a0d19f40ad27cd253bbabdeeda09585df5354ffbcc5b24a92ece33a1afb3fa4c1ca77d58bae5d99fc71ef7c086f317a18236345d60cb0184bf79a33d91a861
7
+ data.tar.gz: c7c6c1ea3ba9544809ea59b0c90b891efea0d6212c342788e8723c970a2321d3f9912395bd2ea86ecedf9f0db9e868ced450491039f2f479dad013e056c1d04b
data/README.adoc CHANGED
@@ -23,24 +23,13 @@ Or install it yourself as:
23
23
 
24
24
  == Usage
25
25
 
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 `RelatonEtsi.configure` block.
26
+ === Search for a standard using keywords
29
27
 
30
28
  [source,ruby]
31
29
  ----
32
30
  require 'relaton_etsi'
33
31
  => true
34
32
 
35
- RelatonEtsi.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
- ----
44
33
  item = RelatonEtsi::Bibliography.get("ETSI GS ZSM 012 V1.1.1")
45
34
  [relaton-etsi] (ETSI GS ZSM 012 V1.1.1) Fetching from Relaton repository ...
46
35
  [relaton-etsi] (ETSI GS ZSM 012 V1.1.1) Found: `ETSI GS ZSM 012 V1.1.1 (2022-12)`
@@ -156,6 +145,10 @@ Done in: 204 sec.
156
145
  => nil
157
146
  ----
158
147
 
148
+ === Logging
149
+
150
+ RelatonEtsi uses the relaton-logger gem for logging. By default, it logs to STDOUT. To change the log levels and add other loggers, read the https://github.com/relaton/relaton-logger#usage[relaton-logger] documentation.
151
+
159
152
  == Development
160
153
 
161
154
  After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
@@ -244,6 +244,9 @@
244
244
  <data type="ID"/>
245
245
  </attribute>
246
246
  <attribute name="reviewer"/>
247
+ <optional>
248
+ <attribute name="type"/>
249
+ </optional>
247
250
  <optional>
248
251
  <attribute name="date">
249
252
  <data type="dateTime"/>
@@ -32,14 +32,14 @@ module RelatonEtsi
32
32
  # @param opts [Hash] options
33
33
  # @return [RelatonEtsi::BibliographicItem]
34
34
  def get(ref, _year = nil, _opts = {})
35
- Util.warn "(#{ref}) Fetching from Relaton repository ..."
35
+ Util.info "Fetching from Relaton repository ...", key: ref
36
36
  result = search(ref)
37
37
  unless result
38
- Util.warn "(#{ref}) Not found."
38
+ Util.info "Not found.", key: ref
39
39
  return
40
40
  end
41
41
 
42
- Util.warn "(#{ref}) Found: `#{result.docidentifier[0].id}`"
42
+ Util.info "Found: `#{result.docidentifier[0].id}`", key: ref
43
43
  result
44
44
  end
45
45
 
@@ -34,13 +34,13 @@ module RelatonEtsi
34
34
  def check_type(type)
35
35
  return if DOCTYPES.value? type
36
36
 
37
- Util.warn "WARNING: invalid doctype: `#{type}`"
37
+ Util.warn "invalid doctype: `#{type}`"
38
38
  end
39
39
 
40
40
  def check_abbreviation(abbreviation)
41
41
  return if abbreviation.nil? || DOCTYPES.key?(abbreviation)
42
42
 
43
- Util.warn "WARNING: invalid doctype abbreviation: `#{abbreviation}`"
43
+ Util.warn "invalid doctype abbreviation: `#{abbreviation}`"
44
44
  end
45
45
  end
46
46
  end
@@ -10,5 +10,9 @@ module RelatonEtsi
10
10
  def bib_item(item_hash)
11
11
  BibliographicItem.new(**item_hash)
12
12
  end
13
+
14
+ def create_doctype(**args)
15
+ DocumentType.new(**args)
16
+ end
13
17
  end
14
18
  end
@@ -1,9 +1,6 @@
1
1
  module RelatonEtsi
2
2
  module Util
3
3
  extend RelatonBib::Util
4
-
5
- def self.logger
6
- RelatonEtsi.configuration.logger
7
- end
4
+ PROGNAME = "relaton-etsi".freeze
8
5
  end
9
6
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module RelatonEtsi
4
- VERSION = "1.18.0"
4
+ VERSION = "1.19.0"
5
5
  end
@@ -23,6 +23,10 @@ module RelatonEtsi
23
23
  BibliographicItem.new(**item_hash)
24
24
  end
25
25
 
26
+ def create_doctype(type)
27
+ DocumentType.new type: type.text, abbreviation: type[:abbreviation]
28
+ end
29
+
26
30
  # def fetch_status(item)
27
31
  # status = item.at "./status"
28
32
  # return unless status
data/lib/relaton_etsi.rb CHANGED
@@ -6,7 +6,6 @@ require "csv"
6
6
  require "relaton/index"
7
7
  require "relaton_bib"
8
8
  require_relative "relaton_etsi/version"
9
- require_relative "relaton_etsi/config"
10
9
  require_relative "relaton_etsi/util"
11
10
  require_relative "relaton_etsi/pubid"
12
11
  require_relative "relaton_etsi/document_type"
metadata CHANGED
@@ -1,29 +1,43 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: relaton-etsi
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.18.0
4
+ version: 1.19.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: 2024-01-06 00:00:00.000000000 Z
11
+ date: 2024-07-03 00:00:00.000000000 Z
12
12
  dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: csv
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - "~>"
18
+ - !ruby/object:Gem::Version
19
+ version: '3.0'
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - "~>"
25
+ - !ruby/object:Gem::Version
26
+ version: '3.0'
13
27
  - !ruby/object:Gem::Dependency
14
28
  name: relaton-bib
15
29
  requirement: !ruby/object:Gem::Requirement
16
30
  requirements:
17
31
  - - "~>"
18
32
  - !ruby/object:Gem::Version
19
- version: 1.18.0
33
+ version: 1.19.0
20
34
  type: :runtime
21
35
  prerelease: false
22
36
  version_requirements: !ruby/object:Gem::Requirement
23
37
  requirements:
24
38
  - - "~>"
25
39
  - !ruby/object:Gem::Version
26
- version: 1.18.0
40
+ version: 1.19.0
27
41
  - !ruby/object:Gem::Dependency
28
42
  name: relaton-index
29
43
  requirement: !ruby/object:Gem::Requirement
@@ -59,7 +73,6 @@ files:
59
73
  - lib/relaton_etsi.rb
60
74
  - lib/relaton_etsi/bibliographic_item.rb
61
75
  - lib/relaton_etsi/bibliography.rb
62
- - lib/relaton_etsi/config.rb
63
76
  - lib/relaton_etsi/data_fetcher.rb
64
77
  - lib/relaton_etsi/data_parser.rb
65
78
  - lib/relaton_etsi/document_type.rb
@@ -90,7 +103,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
90
103
  - !ruby/object:Gem::Version
91
104
  version: '0'
92
105
  requirements: []
93
- rubygems_version: 3.3.26
106
+ rubygems_version: 3.3.27
94
107
  signing_key:
95
108
  specification_version: 4
96
109
  summary: 'RelatonEtsi: retrieve ETSI Standards for bibliographic using the BibliographicItem
@@ -1,10 +0,0 @@
1
- module RelatonEtsi
2
- module Config
3
- include RelatonBib::Config
4
- end
5
- extend Config
6
-
7
- class Configuration < RelatonBib::Configuration
8
- PROGNAME = "relaton-etsi".freeze
9
- end
10
- end