relaton-bib 1.9.10 → 1.9.11
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 +32 -6
- 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: a3f1dc44ef7d2716e9dab35fdb81005962960fb608d388b2d556073758f3cf25
|
4
|
+
data.tar.gz: e31e80c8a248a626bf83bc85e0f3d781544e5461c65e805d1a8ff45025808caa
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 90256a1674ec5311fd7fedb5d0822a5cb10bb9ecaf6c7f5865d74b9a28e6b4feaa969fae327610726720524010db1f1d290dbad48902a3b6e4a86e468542179f
|
7
|
+
data.tar.gz: 29cfeccc2388db9096b094274653800499a4a40a52b7102e9283e64030e921edd37a93ea8c70f92cd2056ac654a2e8b9a4184ca08a05863365f12fa6c15e6305
|
@@ -331,7 +331,7 @@ module RelatonBib
|
|
331
331
|
#
|
332
332
|
# @param [Nokogiri::XML::Builder, nil] builder
|
333
333
|
#
|
334
|
-
# @return [String]
|
334
|
+
# @return [String, Nokogiri::XML::Builder::NodeBuilder] XML
|
335
335
|
#
|
336
336
|
def to_bibxml(builder = nil)
|
337
337
|
if builder
|
@@ -339,8 +339,8 @@ module RelatonBib
|
|
339
339
|
else
|
340
340
|
Nokogiri::XML::Builder.new(encoding: "UTF-8") do |xml|
|
341
341
|
render_bibxml xml
|
342
|
-
end
|
343
|
-
end
|
342
|
+
end.doc.root.to_xml
|
343
|
+
end
|
344
344
|
end
|
345
345
|
|
346
346
|
# @return [Hash]
|
@@ -761,13 +761,40 @@ module RelatonBib
|
|
761
761
|
# rubocop:enable Style/NestedParenthesizedCalls, Metrics/BlockLength
|
762
762
|
|
763
763
|
#
|
764
|
-
# Render BibXML (RFC)
|
764
|
+
# Render BibXML (RFC, BCP)
|
765
765
|
#
|
766
766
|
# @param [Nokogiri::XML::Builder] builder
|
767
767
|
#
|
768
768
|
def render_bibxml(builder)
|
769
769
|
target = link.detect { |l| l.type == "src" } || link.detect { |l| l.type == "doi" }
|
770
|
-
bxml =
|
770
|
+
bxml = if docnumber&.match(/^BCP/) || docidentifier[0].id.include?("BCP")
|
771
|
+
render_bibxml_refgroup(builder)
|
772
|
+
else
|
773
|
+
render_bibxml_ref(builder)
|
774
|
+
end
|
775
|
+
bxml[:target] = target.content.to_s if target
|
776
|
+
end
|
777
|
+
|
778
|
+
#
|
779
|
+
# Render BibXML (BCP)
|
780
|
+
#
|
781
|
+
# @param [Nokogiri::XML::Builder] builder
|
782
|
+
#
|
783
|
+
def render_bibxml_refgroup(builder)
|
784
|
+
builder.referencegroup(anchor: anchor) do |b|
|
785
|
+
relation.each do |r|
|
786
|
+
r.bibitem.to_bibxml(b) if r.type == "includes"
|
787
|
+
end
|
788
|
+
end
|
789
|
+
end
|
790
|
+
|
791
|
+
#
|
792
|
+
# Render BibXML (RFC)
|
793
|
+
#
|
794
|
+
# @param [Nokogiri::XML::Builder] builder
|
795
|
+
#
|
796
|
+
def render_bibxml_ref(builder)
|
797
|
+
builder.reference(anchor: anchor) do |xml|
|
771
798
|
xml.front do
|
772
799
|
xml.title title[0].title.content if title.any?
|
773
800
|
render_seriesinfo xml
|
@@ -778,7 +805,6 @@ module RelatonBib
|
|
778
805
|
render_abstract xml
|
779
806
|
end
|
780
807
|
end
|
781
|
-
bxml[:target] = target.content.to_s if target
|
782
808
|
end
|
783
809
|
|
784
810
|
def anchor
|
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.11
|
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-24 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: byebug
|