relaton-bib 1.9.19 → 1.9.20

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: fcf7272c206af7f7206cc3886a744db7a1c0084d1f999164f7971829c16e640e
4
- data.tar.gz: c5260c213ab4542c98e5df926bb638451345fded8b7ebaa76897212aab9bb7c5
3
+ metadata.gz: b714ee74a9d4da85784bbcc2e7fb50c9548215c1399a799290646eb230529f2f
4
+ data.tar.gz: 75cf8abea4defed1d25cd241443ae6b8df03688a47e8cce4e907bab03315d978
5
5
  SHA512:
6
- metadata.gz: 5a60302d3043fdac1e1ca6b1ebfbd7244b2788a266d5c6392f1279797f4e4c6fc7f3a951cc05b79bf24c7f2bfc7267bf1d1740ddfefe8534a54156233bb1664a
7
- data.tar.gz: c5f46067ab37b963dee5c04fa9294a9e3522906ae011af2397eb18f88b0c48d37b0727eb44ca78dd17ba77e493a4246a8feef4c338ae68564a320e1cd148c0bf
6
+ metadata.gz: 50dd80e6be598a65d4ded5f35e047b7b32a1c9cdcdacdd0539d13e149533501f093e95bbb176b1a58f566274c16ec88b461d50c295daa9bb46c52a9c683bf949
7
+ data.tar.gz: 58ac55543ac1f21477ca3c1125c8d50ccd88aee77c1ab74c4aa374839549d289083827d3b54795cb35901fa26bf46b3a7f4fff46c7b86e8ee23043f05c18ba04
@@ -766,8 +766,8 @@ module RelatonBib
766
766
  # @param [Nokogiri::XML::Builder] builder
767
767
  #
768
768
  def render_bibxml(builder)
769
- target = link.detect { |l| l.type == "src" } ||
770
- link.detect { |l| l.type == "doi" }
769
+ target = link.detect { |l| l.type.casecmp("src").zero? } ||
770
+ link.detect { |l| l.type.casecmp("doi").zero? }
771
771
  bxml = if docnumber&.match(/^BCP/) || docidentifier[0].id.include?("BCP")
772
772
  render_bibxml_refgroup(builder)
773
773
  else
@@ -920,13 +920,22 @@ module RelatonBib
920
920
  def render_person(builder, person)
921
921
  render_organization builder, person.affiliation.first&.organization
922
922
  if person.name.completename
923
- builder.parent[:fullname] = person.name.completename
923
+ builder.parent[:fullname] = person.name.completename.content
924
+ elsif person.name.forename.any?
925
+ builder.parent[:fullname] = person.name.forename.map(&:content).join
924
926
  end
925
927
  if person.name.initial.any?
926
928
  builder.parent[:initials] = person.name.initial.map(&:content).join
929
+ elsif person.name.forename.any?
930
+ builder.parent[:initials] = person.name.forename.map do |f|
931
+ "#{f.content[0]}."
932
+ end.join
927
933
  end
928
934
  if person.name.surname
929
- builder.parent[:surname] = person.name.surname
935
+ if person.name.forename.any?
936
+ builder.parent[:fullname] += " #{person.name.surname}"
937
+ end
938
+ builder.parent[:surname] = person.name.surname.content
930
939
  end
931
940
  end
932
941
 
@@ -312,7 +312,7 @@ module RelatonBib
312
312
  # @return [Array<RelatonBib::BibliographicDate>] published data.
313
313
  #
314
314
  def dates(reference)
315
- return unless (date = reference.at "./front/date")
315
+ return [] unless (date = reference.at "./front/date")
316
316
 
317
317
  d = [date[:year], month(date[:month]), (date[:day] || 1)].compact.join "-"
318
318
  date = Time.parse(d).strftime "%Y-%m-%d"
@@ -1,3 +1,3 @@
1
1
  module RelatonBib
2
- VERSION = "1.9.19".freeze
2
+ VERSION = "1.9.20".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.19
4
+ version: 1.9.20
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ribose Inc.
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2022-01-10 00:00:00.000000000 Z
11
+ date: 2022-01-12 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: byebug