relaton-ietf 1.18.0 → 1.19.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.adoc +5 -12
- data/grammars/basicdoc.rng +3 -0
- data/lib/relaton_ietf/data_fetcher.rb +3 -3
- data/lib/relaton_ietf/document_type.rb +1 -1
- data/lib/relaton_ietf/ietf_bibliography.rb +3 -3
- data/lib/relaton_ietf/rfc_index_entry.rb +6 -4
- data/lib/relaton_ietf/util.rb +1 -4
- data/lib/relaton_ietf/version.rb +1 -1
- data/lib/relaton_ietf/xml_parser.rb +4 -0
- data/lib/relaton_ietf.rb +0 -1
- data/relaton_ietf.gemspec +2 -1
- metadata +19 -6
- data/lib/relaton_ietf/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: 03b7d70436b1b0e29c81ad94edaa90ec760e0aa967221741968244814ef90843
|
4
|
+
data.tar.gz: 30e46687eb8e4db1166f2bfb7eee7dee973d4e07b98c83d70fc7d15289145a75
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 69445fabf05f86f46b9b44aa606e9cf6095625bc37ce1b13063b0c78f557b772415bd062c756c84f05918eddc6b78dc6350d38baa934c95d7a39a370c0b29f64
|
7
|
+
data.tar.gz: 3c0c12e1eaa48c80d25e8eb2a540655c5ea22133951518780406b22c87d727776bf69098204c90d9cf0b1c466e8621db21c1f71d0ef8e9dc36c5b59144cb6844
|
data/README.adoc
CHANGED
@@ -33,24 +33,13 @@ Or install it yourself as:
|
|
33
33
|
|
34
34
|
== Usage
|
35
35
|
|
36
|
-
===
|
37
|
-
|
38
|
-
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 `RelatonIetf.configure` block.
|
36
|
+
=== Fetching documents
|
39
37
|
|
40
38
|
[source,ruby]
|
41
39
|
----
|
42
40
|
require 'relaton_ietf'
|
43
41
|
=> true
|
44
42
|
|
45
|
-
RelatonIetf.configure do |config|
|
46
|
-
config.logger.level = Logger::DEBUG
|
47
|
-
end
|
48
|
-
----
|
49
|
-
|
50
|
-
=== Fetching documents
|
51
|
-
|
52
|
-
[source,ruby]
|
53
|
-
----
|
54
43
|
# Fetch RFC document
|
55
44
|
item = RelatonIetf::IetfBibliography.get 'IETF RFC 8341'
|
56
45
|
[relaton-ietf] (IETF RFC 8341) Fetching from Relaton repository ...
|
@@ -165,6 +154,10 @@ Done in: 360 sec.
|
|
165
154
|
=> nil
|
166
155
|
----
|
167
156
|
|
157
|
+
=== Logging
|
158
|
+
|
159
|
+
RelatonIetf 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.
|
160
|
+
|
168
161
|
== Contributing
|
169
162
|
|
170
163
|
Bug reports and pull requests are welcome on GitHub at https://github.com/metanorma/relaton-ietf.
|
data/grammars/basicdoc.rng
CHANGED
@@ -168,8 +168,8 @@ module RelatonIetf
|
|
168
168
|
rfc_index.xpath("xmlns:rfc-entry").each do |doc|
|
169
169
|
save_doc RfcEntry.parse(doc)
|
170
170
|
rescue StandardError => e
|
171
|
-
|
172
|
-
|
171
|
+
Util.error "Error parsing #{doc.at('./xmlns:doc-id').text}: #{e.message}\n" \
|
172
|
+
"#{e.backtrace[0..5].join("\n")}"
|
173
173
|
end
|
174
174
|
end
|
175
175
|
|
@@ -199,7 +199,7 @@ module RelatonIetf
|
|
199
199
|
end
|
200
200
|
file = file_name entry
|
201
201
|
if check_duplicate && @files.include?(file)
|
202
|
-
warn "File #{file} already exists. Document: #{entry.docnumber}"
|
202
|
+
Util.warn "File #{file} already exists. Document: #{entry.docnumber}"
|
203
203
|
elsif check_duplicate
|
204
204
|
@files << file
|
205
205
|
end
|
@@ -18,13 +18,13 @@ module RelatonIetf
|
|
18
18
|
# reference is required
|
19
19
|
# @return [RelatonIetf::IetfBibliographicItem] Relaton of reference
|
20
20
|
def get(code, _year = nil, _opts = {})
|
21
|
-
Util.
|
21
|
+
Util.info "Fetching from Relaton repository ...", key: code
|
22
22
|
result = search code
|
23
23
|
if result
|
24
24
|
docid = result.docidentifier.detect(&:primary) || result.docidentifier.first
|
25
|
-
Util.
|
25
|
+
Util.info "Found: `#{docid.id}`", key: code
|
26
26
|
else
|
27
|
-
Util.
|
27
|
+
Util.info "Not found.", key: code
|
28
28
|
end
|
29
29
|
result
|
30
30
|
end
|
@@ -123,10 +123,12 @@ module RelatonIetf
|
|
123
123
|
#
|
124
124
|
def parse_relation
|
125
125
|
@is_also.map do |ref|
|
126
|
-
|
127
|
-
|
128
|
-
|
129
|
-
|
126
|
+
entry = @doc.at("/xmlns:rfc-index/xmlns:rfc-entry[xmlns:doc-id = '#{ref}']")
|
127
|
+
bib = RfcEntry.parse entry
|
128
|
+
# fref = RelatonBib::FormattedRef.new content: ref
|
129
|
+
# id = ref.sub(/^([A-Z]+)0*(\d+)$/, '\1 \2')
|
130
|
+
# docid = RelatonBib::DocumentIdentifier.new(type: "IETF", id: id, primary: true)
|
131
|
+
# bib = IetfBibliographicItem.new formattedref: fref, docid: [docid]
|
130
132
|
{ type: "includes", bibitem: bib }
|
131
133
|
end
|
132
134
|
end
|
data/lib/relaton_ietf/util.rb
CHANGED
data/lib/relaton_ietf/version.rb
CHANGED
data/lib/relaton_ietf.rb
CHANGED
data/relaton_ietf.gemspec
CHANGED
@@ -29,6 +29,7 @@ Gem::Specification.new do |spec|
|
|
29
29
|
spec.require_paths = ["lib"]
|
30
30
|
spec.required_ruby_version = Gem::Requirement.new(">= 2.7.0")
|
31
31
|
|
32
|
-
spec.add_dependency "
|
32
|
+
spec.add_dependency "base64"
|
33
|
+
spec.add_dependency "relaton-bib", "~> 1.19.0"
|
33
34
|
spec.add_dependency "relaton-index", "~> 0.2.3"
|
34
35
|
end
|
metadata
CHANGED
@@ -1,29 +1,43 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: relaton-ietf
|
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: base64
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - ">="
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '0'
|
20
|
+
type: :runtime
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - ">="
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '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
|
@@ -71,7 +85,6 @@ files:
|
|
71
85
|
- lib/relaton_ietf.rb
|
72
86
|
- lib/relaton_ietf/bibxml_parser.rb
|
73
87
|
- lib/relaton_ietf/committee.rb
|
74
|
-
- lib/relaton_ietf/config.rb
|
75
88
|
- lib/relaton_ietf/data_fetcher.rb
|
76
89
|
- lib/relaton_ietf/document_type.rb
|
77
90
|
- lib/relaton_ietf/hash_converter.rb
|
@@ -105,7 +118,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
105
118
|
- !ruby/object:Gem::Version
|
106
119
|
version: '0'
|
107
120
|
requirements: []
|
108
|
-
rubygems_version: 3.3.
|
121
|
+
rubygems_version: 3.3.27
|
109
122
|
signing_key:
|
110
123
|
specification_version: 4
|
111
124
|
summary: 'RelatonIetf: retrieve IETF Standards for bibliographic use using the BibliographicItem
|