relaton-bib 1.9.12 → 1.9.13
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/relaton_bib/bibliographic_item.rb +0 -5
- data/lib/relaton_bib/bibxml_parser.rb +24 -14
- data/lib/relaton_bib/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 89950d6f16ecee59114ef4adeb31673bdb32584d6ba3c3ae20591b76e1c3f522
|
4
|
+
data.tar.gz: c4da2965dae170674c58a3c1c8d879e23fcb5339df8db54da09ec5b6149c772e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 68a1d32eecd5aa1646d852ffb0074f09dfb306bf3251cac7d4983945a89f991149c3e959dae6c54ce2efe93c2dad4345230b2fa627db50b9e88fea2f34e933f0
|
7
|
+
data.tar.gz: 6a69d4380d9fb2b8d3cfa0012509d56bea2de0c48672bd10f8033e5b5dc0c5f858aca650829ecdcf3aaa222f3e600bfc1e832cc61ac006448ffa4f74d6b1a034
|
@@ -815,7 +815,6 @@ module RelatonBib
|
|
815
815
|
|
816
816
|
h[di.scope.to_sym] = di.id
|
817
817
|
end
|
818
|
-
# did = docidentifier.detect { |di| di.type == "rfc-anchor" }
|
819
818
|
return attrs if attrs.any?
|
820
819
|
|
821
820
|
docidentifier.first&.tap do |di|
|
@@ -823,10 +822,6 @@ module RelatonBib
|
|
823
822
|
end
|
824
823
|
end
|
825
824
|
|
826
|
-
# def id_to_ref_attr(id)
|
827
|
-
# id.sub(/^(RFC|BCP)\s/, '\1').sub(/^(\d?[A-Z]+)\s/, '\1.')
|
828
|
-
# end
|
829
|
-
|
830
825
|
def render_keyword(builder)
|
831
826
|
keyword.each { |kw| builder.keyword kw.content }
|
832
827
|
end
|
@@ -67,21 +67,31 @@ module RelatonBib
|
|
67
67
|
#
|
68
68
|
def docids(reference, ver) # rubocop:disable Metrics/MethodLength,Metrics/CyclomaticComplexity,Metrics/PerceivedComplexity,Metrics/AbcSize
|
69
69
|
ret = []
|
70
|
-
sfid = reference.at("./seriesInfo[@name='#{self::FLAVOR}']",
|
71
|
-
|
72
|
-
if sfid
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
else # if self::FLAVOR
|
77
|
-
id, scope = if reference[:anchor] then [reference[:anchor], "anchor"]
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
70
|
+
# sfid = reference.at("./seriesInfo[@name='#{self::FLAVOR}']",
|
71
|
+
# "./front/seriesInfo[@name='#{self::FLAVOR}']")
|
72
|
+
# if sfid
|
73
|
+
# type = sfid[:name]
|
74
|
+
# id = sfid[:value]
|
75
|
+
# # scope = "series"
|
76
|
+
# else # if self::FLAVOR
|
77
|
+
# id, scope = if reference[:anchor] then [reference[:anchor], "anchor"]
|
78
|
+
# elsif reference[:docName] then [reference[:docName], "docName"]
|
79
|
+
# elsif reference[:number] then [reference[:number], "number"]
|
80
|
+
# end
|
81
|
+
id = reference["anchor"] || reference["docName"] || reference["number"]
|
82
|
+
type_match = id&.match(/^(3GPP|W3C|[A-Z]{2,})(?:\.(?=[A-Z])|(?=\d))/)
|
83
|
+
type = self::FLAVOR || (type_match && type_match[1])
|
84
|
+
ret << DocumentIdentifier.new(type: type, id: id) if id
|
85
|
+
%w[anchor docName number].each do |atr|
|
86
|
+
if reference[atr]
|
87
|
+
ret << DocumentIdentifier.new(id: reference[atr], type: type, scope: atr)
|
88
|
+
end
|
83
89
|
end
|
84
|
-
|
90
|
+
# end
|
91
|
+
# if id
|
92
|
+
# ret << DocumentIdentifier.new(type: type, id: id)
|
93
|
+
# ret << DocumentIdentifier.new(type: type, id: id, scope: scope) if scope
|
94
|
+
# end
|
85
95
|
# if (id = reference[:anchor])
|
86
96
|
# ret << DocumentIdentifier.new(type: "rfc-anchor", id: id)
|
87
97
|
# end
|
data/lib/relaton_bib/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: relaton-bib
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.9.
|
4
|
+
version: 1.9.13
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ribose Inc.
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-12-
|
11
|
+
date: 2021-12-29 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: byebug
|