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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 791772f93f6ec77db4778d4b983bd5b8238342ce83e3b1ebc7ab57f249a13d20
4
- data.tar.gz: fffd96ca42623382338182a6cb6532fde99c18ebddfd516808f49eb493d31cd6
3
+ metadata.gz: 89950d6f16ecee59114ef4adeb31673bdb32584d6ba3c3ae20591b76e1c3f522
4
+ data.tar.gz: c4da2965dae170674c58a3c1c8d879e23fcb5339df8db54da09ec5b6149c772e
5
5
  SHA512:
6
- metadata.gz: b5440de1b9a0555946b6be63f5c557d9f91b54c247d5876e5f8aaf4e74bfefa1f91d526a1453c99a401e2d82e03ed07af66e2f950a4e0f51d844e9ba0738c427
7
- data.tar.gz: 8addf5e0b704189efdb1a6f871553c79ef23d1c38c324e728d9e72151a9c7317029340f3b0f4ad25b394a6acfcee679532c3f323a37aab0b0946bb33ce88461a
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
- "./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&.match(/^(3GPP|W3C|[A-Z]{2,})(?:\.(?=[A-Z])|(?=\d))/)
82
- type = self::FLAVOR || ($~ && $~[1])
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
- ret << DocumentIdentifier.new(type: type, id: id, scope: scope) if id
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
@@ -1,3 +1,3 @@
1
1
  module RelatonBib
2
- VERSION = "1.9.12".freeze
2
+ VERSION = "1.9.13".freeze
3
3
  end
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.12
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-28 00:00:00.000000000 Z
11
+ date: 2021-12-29 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: byebug