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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 944fd26ef5c5b32d7a9a5023bc1c2291f6bfb772814c19bfd214dc951449186c
4
- data.tar.gz: 0b168752f3e1c622cdcb04c24b7f8e0d492bea3617b0e8bbcb1e2e388717e3ce
3
+ metadata.gz: a3f1dc44ef7d2716e9dab35fdb81005962960fb608d388b2d556073758f3cf25
4
+ data.tar.gz: e31e80c8a248a626bf83bc85e0f3d781544e5461c65e805d1a8ff45025808caa
5
5
  SHA512:
6
- metadata.gz: 6a0ee9af618a698c0ff2552185f4520e1bb37023ee0b51d5c8757a1a9b490631b589d5da49203cd099460d1807f1e1f2e71a85eb0cda25841e17cc9fecbcc124
7
- data.tar.gz: f4f8cdc21e0320d29f5c40d7732fbb9af3fea8fd3c3db4b841895f8c316eaa88ce5e3033038f05b7e278f1fd31501f0a9e75b26e79ccab55137619b19dc47660
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] <description>
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.doc.root.to_xml
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 = builder.reference(anchor: anchor) do |xml|
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
@@ -1,3 +1,3 @@
1
1
  module RelatonBib
2
- VERSION = "1.9.10".freeze
2
+ VERSION = "1.9.11".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.10
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-23 00:00:00.000000000 Z
11
+ date: 2021-12-24 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: byebug