relaton-bib 1.10.2 → 1.10.3

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: 4b28d437689d9d1a6d8e354677100412885d35532b08b8fd62d67b356594ce56
4
- data.tar.gz: 8bd4cbc416dbbb143736a0c73a0679cfaa3e219de96c12f70018b2b626571fd8
3
+ metadata.gz: f5d4afe9383395a6aedab41481f8cd61e54705b875a070a6a0c96e60bf34eb35
4
+ data.tar.gz: ef3ad715dbe15c38ed939b7860ddc8fcda697c2937d3b92bc698432d5a682fb6
5
5
  SHA512:
6
- metadata.gz: 9ebaf2a67d28cd7fc4b2a1c06ae29af2f28f5c422c4313aaa17c067857e7171ed0af1a4173ccc0a5d7df77a8f3e7a1b8eed5e70b13f149eec5ad67af5be911ab
7
- data.tar.gz: a0bade6608af304ec6062405df7b4e3103fd4e7411aa659294c3863d4cd8de71b1dd81ae719ac2c6cdca0feee6d4836a2c3909a76939773fb7df497901fc0cf9
6
+ metadata.gz: 345f8b3198bef26aa58297acafff8386e906075220aa73bfdfc68ca07b0435049a5ee89c77b85ef46af57b26cf073622a50d6be7e519372446de13453366c859
7
+ data.tar.gz: fa4ec221835cb39a95c4f39ada023a603a59e493d0170ca78785869bc8bcd13477a50484dd29470bd5d7030ecf70b4f18cce7c11edc6546f0129c36fd599e156
@@ -809,9 +809,21 @@ module RelatonBib
809
809
  render_abstract xml
810
810
  end
811
811
  render_seriesinfo xml
812
+ render_format xml
812
813
  end
813
814
  end
814
815
 
816
+ def render_format(builder)
817
+ link.select { |l| l.type == "TXT" }.each do |l|
818
+ builder.format type: l.type, target: l.content
819
+ end
820
+ end
821
+
822
+ #
823
+ # Create reference attributes
824
+ #
825
+ # @return [Hash<Symbol=>String>] attributes
826
+ #
815
827
  def ref_attrs
816
828
  discopes = %w[anchor docName number]
817
829
  attrs = docidentifier.each_with_object({}) do |di, h|
@@ -826,24 +838,42 @@ module RelatonBib
826
838
  end
827
839
  end
828
840
 
841
+ #
842
+ # Render keyword
843
+ #
844
+ # @param [Nokogiri::XML::Builder] builder xml builder
845
+ #
829
846
  def render_keyword(builder)
830
847
  keyword.each { |kw| builder.keyword kw.content }
831
848
  end
832
849
 
850
+ #
851
+ # Render workgroup
852
+ #
853
+ # @param [Nokogiri::XML::Builder] builder xml builder
854
+ #
833
855
  def render_workgroup(builder)
834
856
  editorialgroup&.technical_committee&.each do |tc|
835
857
  builder.workgroup tc.workgroup.name
836
858
  end
837
859
  end
838
860
 
839
- # @param [Nokogiri::XML::Builder] builder
861
+ #
862
+ # Render abstract
863
+ #
864
+ # @param [Nokogiri::XML::Builder] builder xml builder
865
+ #
840
866
  def render_abstract(builder)
841
867
  return unless abstract.any?
842
868
 
843
869
  builder.abstract { |xml| xml << abstract[0].content.gsub(/(<\/?)p(>)/, '\1t\2') }
844
870
  end
845
871
 
846
- # @param [Nokogiri::XML::Builder] builder
872
+ #
873
+ # Render date
874
+ #
875
+ # @param [Nokogiri::XML::Builder] builder xml builder
876
+ #
847
877
  def render_date(builder)
848
878
  dt = date.detect { |d| d.type == "published" }
849
879
  return unless dt
@@ -860,7 +890,11 @@ module RelatonBib
860
890
  # end
861
891
  end
862
892
 
863
- # @param [Nokogiri::XML::Builder] builder
893
+ #
894
+ # Render seriesinfo
895
+ #
896
+ # @param [Nokogiri::XML::Builder] builder xml builder
897
+ #
864
898
  def render_seriesinfo(builder)
865
899
  docidentifier.each do |di|
866
900
  if BibXMLParser::SERIESINFONAMES.include? di.type
@@ -877,7 +911,11 @@ module RelatonBib
877
911
  end
878
912
  end
879
913
 
880
- # @param [Nokogiri::XML::Builder] builder
914
+ #
915
+ # Render authors
916
+ #
917
+ # @param [Nokogiri::XML::Builder] builder xml builder
918
+ #
881
919
  def render_authors(builder)
882
920
  contributor.each do |c|
883
921
  builder.author do |xml|
@@ -890,8 +928,12 @@ module RelatonBib
890
928
  end
891
929
  end
892
930
 
893
- # @param [Nokogiri::XML::Builder] builder
894
- # @param [RelatonBib::ContributionInfo] contrib
931
+ #
932
+ # Render address
933
+ #
934
+ # @param [Nokogiri::XML::Builder] builder xml builder
935
+ # @param [RelatonBib::ContributionInfo] contrib contributor
936
+ #
895
937
  def render_address(builder, contrib)
896
938
  # addr = contrib.entity.contact.reject do |cn|
897
939
  # cn.is_a?(Address) && cn.postcode.nil?
@@ -913,8 +955,12 @@ module RelatonBib
913
955
  end
914
956
  end
915
957
 
916
- # @param [Nokogiri::XML::Builder] builder
917
- # @param [Array<RelatonBib::Address, RelatonBib::Contact>] addr
958
+ #
959
+ # Render contact
960
+ #
961
+ # @param [Nokogiri::XML::Builder] builder xml builder
962
+ # @param [Array<RelatonBib::Address, RelatonBib::Contact>] addr contact
963
+ #
918
964
  def render_contact(builder, addr)
919
965
  %w[phone email uri].each do |type|
920
966
  cont = addr.detect { |cn| cn.is_a?(Contact) && cn.type == type }
@@ -922,8 +968,12 @@ module RelatonBib
922
968
  end
923
969
  end
924
970
 
925
- # @param [Nokogiri::XML::Builder] builder
926
- # @param [RelatonBib::Person] person
971
+ #
972
+ # Render person
973
+ #
974
+ # @param [Nokogiri::XML::Builder] builder xml builder
975
+ # @param [RelatonBib::Person] person person
976
+ #
927
977
  def render_person(builder, person)
928
978
  render_organization builder, person.affiliation.first&.organization
929
979
  if person.name.completename
@@ -946,8 +996,12 @@ module RelatonBib
946
996
  end
947
997
  end
948
998
 
949
- # @param [Nokogiri::XML::Builder] builder
950
- # @param [RelatonBib::Organization] org
999
+ #
1000
+ # Render organization
1001
+ #
1002
+ # @param [Nokogiri::XML::Builder] builder xml builder
1003
+ # @param [RelatonBib::Organization] org organization
1004
+ #
951
1005
  def render_organization(builder, org)
952
1006
  # return unless org
953
1007
 
@@ -1,3 +1,3 @@
1
1
  module RelatonBib
2
- VERSION = "1.10.2".freeze
2
+ VERSION = "1.10.3".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.10.2
4
+ version: 1.10.3
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-02-18 00:00:00.000000000 Z
11
+ date: 2022-02-22 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: byebug