relaton-bib 1.9.13 → 1.9.14

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: 89950d6f16ecee59114ef4adeb31673bdb32584d6ba3c3ae20591b76e1c3f522
4
- data.tar.gz: c4da2965dae170674c58a3c1c8d879e23fcb5339df8db54da09ec5b6149c772e
3
+ metadata.gz: a2b90151346cbb5d5f53a8125ff301d62115f730a521d13b53d363ba6876339a
4
+ data.tar.gz: e42718acaca9c77fb47278f03fa5a7f616da09da3ab53d30447e70c45167355b
5
5
  SHA512:
6
- metadata.gz: 68a1d32eecd5aa1646d852ffb0074f09dfb306bf3251cac7d4983945a89f991149c3e959dae6c54ce2efe93c2dad4345230b2fa627db50b9e88fea2f34e933f0
7
- data.tar.gz: 6a69d4380d9fb2b8d3cfa0012509d56bea2de0c48672bd10f8033e5b5dc0c5f858aca650829ecdcf3aaa222f3e600bfc1e832cc61ac006448ffa4f74d6b1a034
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
- ret << DocumentIdentifier.new(type: type, id: id) if id
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" : ""
@@ -1,3 +1,3 @@
1
1
  module RelatonBib
2
- VERSION = "1.9.13".freeze
2
+ VERSION = "1.9.14".freeze
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: relaton-bib
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.9.13
4
+ version: 1.9.14
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ribose Inc.