relaton-bib 1.5.pre → 1.5.pre1
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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1c135ae20e6dedad964161c4688f955bc1f6ff9945e36dcfbb4aaed73bf6d6bf
|
4
|
+
data.tar.gz: 7e1775460d12c0c2b8e4014cced56a7dbd84abf215c0882e34a11c198977d28c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f6ca89938617badf59e7e92503e1b08a87428ea0cadca42af71e93c9e528a5d2f9fd1a2f7c1a90893233db16cad05c46295561f42962c3fcdb8402cbf331e723
|
7
|
+
data.tar.gz: 82204e17e4ce3dc1df5555eea3f7817b1cbfa4d1f1bd2de22ef3499ea84539dbce1ef114e651a303367ae35b1a78823b043dc954d907f1717b3305662d692312
|
data/lib/relaton_bib.rb
CHANGED
@@ -678,7 +678,7 @@ module RelatonBib
|
|
678
678
|
title.to_xml **opts
|
679
679
|
formattedref&.to_xml builder
|
680
680
|
link.each { |s| s.to_xml builder }
|
681
|
-
docidentifier.each { |di| di.to_xml
|
681
|
+
docidentifier.each { |di| di.to_xml **opts }
|
682
682
|
builder.docnumber docnumber if docnumber
|
683
683
|
date.each { |d| d.to_xml builder, **opts }
|
684
684
|
contributor.each do |c|
|
@@ -45,10 +45,15 @@ module RelatonBib
|
|
45
45
|
#
|
46
46
|
# Add docidentifier xml element
|
47
47
|
#
|
48
|
-
# @param [
|
49
|
-
#
|
50
|
-
|
51
|
-
|
48
|
+
# @param opts [Hash]
|
49
|
+
# @option opts [Nokogiri::XML::Builder] :builder XML builder
|
50
|
+
# @option opts [String] :lang language
|
51
|
+
def to_xml(**opts) # rubocop:disable Metrics/AbcSize
|
52
|
+
lid = if type == "URN" && opts[:lang]
|
53
|
+
id.sub %r{(?<=:)(?:\w{2},)*?(#{opts[:lang]})(?:,\w{2})*}, '\1'
|
54
|
+
else id
|
55
|
+
end
|
56
|
+
element = opts[:builder].docidentifier lid
|
52
57
|
element[:type] = type if type
|
53
58
|
element[:scope] = scope if scope
|
54
59
|
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.5.
|
4
|
+
version: 1.5.pre1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ribose Inc.
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-10-
|
11
|
+
date: 2020-10-08 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: byebug
|