relaton-bib 1.9.13 → 1.9.14
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/lib/relaton_bib/bibxml_parser.rb +4 -1
- data/lib/relaton_bib/document_identifier.rb +4 -4
- data/lib/relaton_bib/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a2b90151346cbb5d5f53a8125ff301d62115f730a521d13b53d363ba6876339a
|
4
|
+
data.tar.gz: e42718acaca9c77fb47278f03fa5a7f616da09da3ab53d30447e70c45167355b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d84d64063570dcf4e8f4b60a0b5e9df6cca896fa1be79a308e5001099671b1e0a748851d9633d07d2b4ad3ab2318e632d8747cb8f90dfa87d9194153cbbb0cfa
|
7
|
+
data.tar.gz: 7f7d753a7a88138ecb17ef255d64cee353d43b59339825602cf20ddd5ea76c5d2b096b6e75198112792ba17f8c4e985f85eeab01fee0e892c0b1ec1e1e504f7a
|
@@ -81,7 +81,10 @@ module RelatonBib
|
|
81
81
|
id = reference["anchor"] || reference["docName"] || reference["number"]
|
82
82
|
type_match = id&.match(/^(3GPP|W3C|[A-Z]{2,})(?:\.(?=[A-Z])|(?=\d))/)
|
83
83
|
type = self::FLAVOR || (type_match && type_match[1])
|
84
|
-
|
84
|
+
if id
|
85
|
+
pid = id.sub(/^(3GPP|W3C|[A-Z]{2,})\.?/, '\1 ')
|
86
|
+
ret << DocumentIdentifier.new(type: type, id: pid)
|
87
|
+
end
|
85
88
|
%w[anchor docName number].each do |atr|
|
86
89
|
if reference[atr]
|
87
90
|
ret << DocumentIdentifier.new(id: reference[atr], type: type, scope: atr)
|
@@ -20,7 +20,7 @@ module RelatonBib
|
|
20
20
|
def remove_part
|
21
21
|
case @type
|
22
22
|
when "Chinese Standard" then @id.sub!(/\.\d+/, "")
|
23
|
-
when "ISO", "IEC" then @id.sub!(/-[^:]+/, "")
|
23
|
+
when "ISO", "IEC", "BSI" then @id.sub!(/-[^:]+/, "")
|
24
24
|
when "URN" then remove_urn_part
|
25
25
|
end
|
26
26
|
end
|
@@ -28,7 +28,7 @@ module RelatonBib
|
|
28
28
|
def remove_date
|
29
29
|
case @type
|
30
30
|
when "Chinese Standard" then @id.sub!(/-[12]\d\d\d/, "")
|
31
|
-
when "ISO", "IEC" then @id.sub!(/:[12]\d\d\d/, "")
|
31
|
+
when "ISO", "IEC", "BSI" then @id.sub!(/:[12]\d\d\d/, "")
|
32
32
|
when "URN"
|
33
33
|
@id.sub!(/^(urn:iec:std:[^:]+:[^:]+:)[^:]*/, '\1')
|
34
34
|
end
|
@@ -69,8 +69,8 @@ module RelatonBib
|
|
69
69
|
# @param prefix [String]
|
70
70
|
# @param count [Integer] number of docids
|
71
71
|
# @return [String]
|
72
|
-
def to_asciibib(prefix = "", count = 1)
|
73
|
-
pref = prefix.empty? ? prefix : prefix
|
72
|
+
def to_asciibib(prefix = "", count = 1) # rubocop:disable Metrics/CyclomaticComplexity
|
73
|
+
pref = prefix.empty? ? prefix : "#{prefix}."
|
74
74
|
return "#{pref}docid:: #{id}\n" unless type || scope
|
75
75
|
|
76
76
|
out = count > 1 ? "#{pref}docid::\n" : ""
|
data/lib/relaton_bib/version.rb
CHANGED