relaton-ietf 1.14.4 → 1.16.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/workflows/release.yml +2 -1
- data/Gemfile +4 -0
- data/README.adoc +1 -1
- data/grammars/biblio.rng +1 -1
- data/grammars/relaton-ietf.rng +15 -0
- data/lib/relaton_ietf/hash_converter.rb +12 -0
- data/lib/relaton_ietf/ietf_bibliographic_item.rb +34 -5
- data/lib/relaton_ietf/rfc_entry.rb +3 -2
- data/lib/relaton_ietf/rfc_index_entry.rb +2 -1
- data/lib/relaton_ietf/version.rb +1 -1
- data/lib/relaton_ietf/xml_parser.rb +6 -0
- data/relaton_ietf.gemspec +2 -6
- metadata +6 -48
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d6e85cde14717a5171d911a03dd3f069ab295314a9750a4795ee4a40694ad525
|
4
|
+
data.tar.gz: d5e62680f2a47c54131c8f9a14bcf03eacd00c86377d99f8a4f126e295afc03c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: af082b142044e88a11d1580c8f1dc2cc8a21a3cabd26a166622513125bcee6f5acd9212233dfabcf21a4a5bb0194ad27274a06577ce76f2e1afc2623d94d6a74
|
7
|
+
data.tar.gz: 608c4bcfb0cee144a867b8cdfc04ceda41554b73a744d43cb1d10e48d4ddca691ba756a62be457dbea0aea77e22d1e162ebc9d3db22349742b6f683584771b12
|
@@ -7,7 +7,8 @@ on:
|
|
7
7
|
inputs:
|
8
8
|
next_version:
|
9
9
|
description: |
|
10
|
-
Next release version. Possible values: x.y.z, major, minor, patch or pre|rc|etc
|
10
|
+
Next release version. Possible values: x.y.z, major, minor, patch (or pre|rc|etc).
|
11
|
+
Also, you can pass 'skip' to skip 'git tag' and do 'gem push' for the current version
|
11
12
|
required: true
|
12
13
|
default: 'skip'
|
13
14
|
repository_dispatch:
|
data/Gemfile
CHANGED
@@ -5,6 +5,10 @@ git_source(:github) { |repo_name| "https://github.com/#{repo_name}" }
|
|
5
5
|
# Specify your gem's dependencies in relaton_ietf.gemspec
|
6
6
|
gemspec
|
7
7
|
|
8
|
+
gem "rake", "~> 13.0"
|
9
|
+
gem "rspec", "~> 3.0"
|
10
|
+
|
11
|
+
gem "equivalent-xml"
|
8
12
|
gem "pry-byebug"
|
9
13
|
gem "ruby-jing"
|
10
14
|
gem "simplecov"
|
data/README.adoc
CHANGED
@@ -85,7 +85,7 @@ item.to_xml bibdata: true
|
|
85
85
|
<docidentifier type="IETF" primary="true">RFC 8341</docidentifier>
|
86
86
|
<docidentifier type="DOI">10.17487/RFC8341</docidentifier>
|
87
87
|
...
|
88
|
-
<ext schema-version="v1.0.
|
88
|
+
<ext schema-version="v1.0.1">
|
89
89
|
<editorialgroup>
|
90
90
|
<committee>netconf</committee>
|
91
91
|
</editorialgroup>
|
data/grammars/biblio.rng
CHANGED
data/grammars/relaton-ietf.rng
CHANGED
@@ -26,6 +26,9 @@
|
|
26
26
|
<zeroOrMore>
|
27
27
|
<ref name="area"/>
|
28
28
|
</zeroOrMore>
|
29
|
+
<optional>
|
30
|
+
<ref name="stream"/>
|
31
|
+
</optional>
|
29
32
|
<optional>
|
30
33
|
<ref name="ipr"/>
|
31
34
|
</optional>
|
@@ -315,4 +318,16 @@
|
|
315
318
|
</optional>
|
316
319
|
</element>
|
317
320
|
</define>
|
321
|
+
<define name="stream">
|
322
|
+
<element name="stream">
|
323
|
+
<choice>
|
324
|
+
<value>IAB</value>
|
325
|
+
<value>IETF</value>
|
326
|
+
<value>Independent</value>
|
327
|
+
<value>IRTF</value>
|
328
|
+
<value>Legacy</value>
|
329
|
+
<value>Editorial</value>
|
330
|
+
</choice>
|
331
|
+
</element>
|
332
|
+
</define>
|
318
333
|
</grammar>
|
@@ -1,6 +1,14 @@
|
|
1
1
|
module RelatonIetf
|
2
2
|
class HashConverter < RelatonBib::HashConverter
|
3
3
|
class << self
|
4
|
+
def hash_to_bib(hash)
|
5
|
+
ret = super
|
6
|
+
return unless ret
|
7
|
+
|
8
|
+
stream_hash_to_bib ret
|
9
|
+
ret
|
10
|
+
end
|
11
|
+
|
4
12
|
#
|
5
13
|
# Ovverides superclass's method
|
6
14
|
#
|
@@ -19,6 +27,10 @@ module RelatonIetf
|
|
19
27
|
end
|
20
28
|
ret[:editorialgroup] = RelatonBib::EditorialGroup.new technical_committee
|
21
29
|
end
|
30
|
+
|
31
|
+
def stream_hash_to_bib(ret)
|
32
|
+
ret[:stream] = ret[:ext][:stream] if ret[:ext]&.key? :stream
|
33
|
+
end
|
22
34
|
end
|
23
35
|
end
|
24
36
|
end
|
@@ -2,18 +2,20 @@ module RelatonIetf
|
|
2
2
|
class IetfBibliographicItem < RelatonBib::BibliographicItem
|
3
3
|
DOCTYPES = %w[rfc internet-draft].freeze
|
4
4
|
|
5
|
-
# @return [String,
|
6
|
-
attr_reader :doctype
|
5
|
+
# @return [String, nil]
|
6
|
+
attr_reader :doctype, :stream
|
7
7
|
|
8
8
|
# @return [Array<String>]
|
9
9
|
attr_reader :keyword
|
10
10
|
|
11
11
|
# @param doctype [String]
|
12
12
|
# @param keyword [Array<String>]
|
13
|
+
# @param stream [String, nil]
|
13
14
|
def initialize(**args)
|
14
15
|
if args[:doctype] && !DOCTYPES.include?(args[:doctype])
|
15
16
|
warn "[relaton-ietf] WARNING: invalid doctype #{args[:doctype]}"
|
16
17
|
end
|
18
|
+
@stream = args.delete(:stream)
|
17
19
|
super
|
18
20
|
end
|
19
21
|
|
@@ -36,12 +38,39 @@ module RelatonIetf
|
|
36
38
|
# @param opts [Hash]
|
37
39
|
# @option opts [Nokogiri::XML::Builder] :builder XML builder
|
38
40
|
# @option opts [Boolean] :bibdata
|
39
|
-
# @option opts [Symbol,
|
41
|
+
# @option opts [Symbol, nil] :date_format (:short), :full
|
40
42
|
# @option opts [String, Symbol] :lang language
|
41
43
|
# @return [String] XML
|
42
|
-
def to_xml(**opts)
|
44
|
+
def to_xml(**opts) # rubocop:disable Metrics/AbcSize, Metrics/CyclomaticComplexity, Metrics/PerceivedComplexity, Metrics/MethodLength
|
43
45
|
opts[:date_format] ||= :short
|
44
|
-
super(**opts)
|
46
|
+
super(**opts) do |builder|
|
47
|
+
if opts[:bibdata] && (doctype || editorialgroup || ics&.any? ||
|
48
|
+
structuredidentifier&.presence? || stream)
|
49
|
+
ext = builder.ext do |b|
|
50
|
+
b.doctype doctype if doctype
|
51
|
+
b.subdoctype subdoctype if subdoctype
|
52
|
+
editorialgroup&.to_xml b
|
53
|
+
ics.each { |i| i.to_xml b }
|
54
|
+
b.stream stream if stream
|
55
|
+
structuredidentifier&.to_xml b
|
56
|
+
end
|
57
|
+
ext["schema-version"] = ext_schema if !opts[:embedded] && respond_to?(:ext_schema)
|
58
|
+
end
|
59
|
+
end
|
60
|
+
end
|
61
|
+
|
62
|
+
#
|
63
|
+
# Render hash
|
64
|
+
#
|
65
|
+
# @return [Hash] docunent hash representation
|
66
|
+
#
|
67
|
+
def to_hash(embedded: false)
|
68
|
+
hash = super
|
69
|
+
return hash unless stream
|
70
|
+
|
71
|
+
hash["ext"] ||= {}
|
72
|
+
hash["ext"]["stream"] = stream
|
73
|
+
hash
|
45
74
|
end
|
46
75
|
|
47
76
|
#
|
@@ -41,6 +41,7 @@ module RelatonIetf
|
|
41
41
|
relation: parse_relation,
|
42
42
|
status: parse_status,
|
43
43
|
series: parse_series,
|
44
|
+
stream: @doc.at("./xmlns:stream")&.text,
|
44
45
|
editorialgroup: parse_editorialgroup,
|
45
46
|
)
|
46
47
|
end
|
@@ -52,7 +53,7 @@ module RelatonIetf
|
|
52
53
|
#
|
53
54
|
def parse_series
|
54
55
|
title = RelatonBib::TypedTitleString.new(content: "RFC")
|
55
|
-
series_is_also +
|
56
|
+
series_is_also + [RelatonBib::Series.new(title: title, number: docnum)] + seires_stream
|
56
57
|
end
|
57
58
|
|
58
59
|
def series_is_also
|
@@ -134,7 +135,7 @@ module RelatonIetf
|
|
134
135
|
#
|
135
136
|
# Create link
|
136
137
|
#
|
137
|
-
# @return [Array<RelatonBib::TypedUri>]
|
138
|
+
# @return [Array<RelatonBib::TypedUri>]
|
138
139
|
#
|
139
140
|
def parse_link
|
140
141
|
url = "https://www.rfc-editor.org/info/rfc#{docnum}"
|
@@ -10,7 +10,7 @@ module RelatonIetf
|
|
10
10
|
def initialize(doc, doc_id, is_also)
|
11
11
|
@doc = doc
|
12
12
|
@name = doc.name.split("-").first
|
13
|
-
@shortnum = doc_id[-4
|
13
|
+
@shortnum = doc_id[-4..].sub(/^0+/, "")
|
14
14
|
@doc_id = doc_id
|
15
15
|
@is_also = is_also
|
16
16
|
end
|
@@ -47,6 +47,7 @@ module RelatonIetf
|
|
47
47
|
formattedref: formattedref,
|
48
48
|
relation: parse_relation,
|
49
49
|
series: parse_series,
|
50
|
+
stream: @doc.at("./xmlns:stream")&.text,
|
50
51
|
)
|
51
52
|
end
|
52
53
|
|
data/lib/relaton_ietf/version.rb
CHANGED
@@ -5,6 +5,12 @@ module RelatonIetf
|
|
5
5
|
class << self
|
6
6
|
private
|
7
7
|
|
8
|
+
def item_data(doc)
|
9
|
+
data = super
|
10
|
+
data[:stream] = doc.at("ext/stream")&.text
|
11
|
+
data
|
12
|
+
end
|
13
|
+
|
8
14
|
# override RelatonBib::BibliographicItem.bib_item method
|
9
15
|
# @param item_hash [Hash]
|
10
16
|
# @return [RelatonIetf::IetfBibliographicItem]
|
data/relaton_ietf.gemspec
CHANGED
@@ -29,10 +29,6 @@ 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.
|
33
|
-
spec.
|
34
|
-
spec.add_development_dependency "rspec", "~> 3.0"
|
35
|
-
|
36
|
-
spec.add_dependency "relaton-bib", "~> 1.14.0"
|
37
|
-
spec.add_dependency "relaton-index", "~> 0.2.0"
|
32
|
+
spec.add_dependency "relaton-bib", "~> 1.16.0"
|
33
|
+
spec.add_dependency "relaton-index", "~> 0.2.3"
|
38
34
|
end
|
metadata
CHANGED
@@ -1,85 +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.16.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: 2023-
|
11
|
+
date: 2023-09-03 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
|
-
- !ruby/object:Gem::Dependency
|
14
|
-
name: equivalent-xml
|
15
|
-
requirement: !ruby/object:Gem::Requirement
|
16
|
-
requirements:
|
17
|
-
- - "~>"
|
18
|
-
- !ruby/object:Gem::Version
|
19
|
-
version: '0.6'
|
20
|
-
type: :development
|
21
|
-
prerelease: false
|
22
|
-
version_requirements: !ruby/object:Gem::Requirement
|
23
|
-
requirements:
|
24
|
-
- - "~>"
|
25
|
-
- !ruby/object:Gem::Version
|
26
|
-
version: '0.6'
|
27
|
-
- !ruby/object:Gem::Dependency
|
28
|
-
name: rake
|
29
|
-
requirement: !ruby/object:Gem::Requirement
|
30
|
-
requirements:
|
31
|
-
- - "~>"
|
32
|
-
- !ruby/object:Gem::Version
|
33
|
-
version: '13.0'
|
34
|
-
type: :development
|
35
|
-
prerelease: false
|
36
|
-
version_requirements: !ruby/object:Gem::Requirement
|
37
|
-
requirements:
|
38
|
-
- - "~>"
|
39
|
-
- !ruby/object:Gem::Version
|
40
|
-
version: '13.0'
|
41
|
-
- !ruby/object:Gem::Dependency
|
42
|
-
name: rspec
|
43
|
-
requirement: !ruby/object:Gem::Requirement
|
44
|
-
requirements:
|
45
|
-
- - "~>"
|
46
|
-
- !ruby/object:Gem::Version
|
47
|
-
version: '3.0'
|
48
|
-
type: :development
|
49
|
-
prerelease: false
|
50
|
-
version_requirements: !ruby/object:Gem::Requirement
|
51
|
-
requirements:
|
52
|
-
- - "~>"
|
53
|
-
- !ruby/object:Gem::Version
|
54
|
-
version: '3.0'
|
55
13
|
- !ruby/object:Gem::Dependency
|
56
14
|
name: relaton-bib
|
57
15
|
requirement: !ruby/object:Gem::Requirement
|
58
16
|
requirements:
|
59
17
|
- - "~>"
|
60
18
|
- !ruby/object:Gem::Version
|
61
|
-
version: 1.
|
19
|
+
version: 1.16.0
|
62
20
|
type: :runtime
|
63
21
|
prerelease: false
|
64
22
|
version_requirements: !ruby/object:Gem::Requirement
|
65
23
|
requirements:
|
66
24
|
- - "~>"
|
67
25
|
- !ruby/object:Gem::Version
|
68
|
-
version: 1.
|
26
|
+
version: 1.16.0
|
69
27
|
- !ruby/object:Gem::Dependency
|
70
28
|
name: relaton-index
|
71
29
|
requirement: !ruby/object:Gem::Requirement
|
72
30
|
requirements:
|
73
31
|
- - "~>"
|
74
32
|
- !ruby/object:Gem::Version
|
75
|
-
version: 0.2.
|
33
|
+
version: 0.2.3
|
76
34
|
type: :runtime
|
77
35
|
prerelease: false
|
78
36
|
version_requirements: !ruby/object:Gem::Requirement
|
79
37
|
requirements:
|
80
38
|
- - "~>"
|
81
39
|
- !ruby/object:Gem::Version
|
82
|
-
version: 0.2.
|
40
|
+
version: 0.2.3
|
83
41
|
description: |
|
84
42
|
RelatonIetf: retrieve IETF Standards for bibliographic use
|
85
43
|
using the BibliographicItem model.
|