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 +4 -4
- data/README.adoc +5 -12
- data/grammars/basicdoc.rng +3 -0
- data/lib/relaton_etsi/bibliography.rb +3 -3
- data/lib/relaton_etsi/document_type.rb +2 -2
- data/lib/relaton_etsi/hash_converter.rb +4 -0
- data/lib/relaton_etsi/util.rb +1 -4
- data/lib/relaton_etsi/version.rb +1 -1
- data/lib/relaton_etsi/xml_parser.rb +4 -0
- data/lib/relaton_etsi.rb +0 -1
- metadata +19 -6
- data/lib/relaton_etsi/config.rb +0 -10
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 7e6de56729e08a6ed75056d304e5bf59b79882496c0e86edf99ba144ef56e3ac
|
|
4
|
+
data.tar.gz: fc98cc4219dba9e46e33a25217eab20d2ce97512229b619bdf7984e8f8d078ba
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
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
|
-
===
|
|
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.
|
data/grammars/basicdoc.rng
CHANGED
|
@@ -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.
|
|
35
|
+
Util.info "Fetching from Relaton repository ...", key: ref
|
|
36
36
|
result = search(ref)
|
|
37
37
|
unless result
|
|
38
|
-
Util.
|
|
38
|
+
Util.info "Not found.", key: ref
|
|
39
39
|
return
|
|
40
40
|
end
|
|
41
41
|
|
|
42
|
-
Util.
|
|
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 "
|
|
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 "
|
|
43
|
+
Util.warn "invalid doctype abbreviation: `#{abbreviation}`"
|
|
44
44
|
end
|
|
45
45
|
end
|
|
46
46
|
end
|
data/lib/relaton_etsi/util.rb
CHANGED
data/lib/relaton_etsi/version.rb
CHANGED
|
@@ -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.
|
|
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-
|
|
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.
|
|
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.
|
|
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.
|
|
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
|