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: 718bae79646e15f68243d997e053ed614d8309dafad8cbb8e9d0189d49198171
4
- data.tar.gz: e54d51485d37662aa2507d074f859b896277d13fe298158ce84faf9570e037bc
3
+ metadata.gz: 1c135ae20e6dedad964161c4688f955bc1f6ff9945e36dcfbb4aaed73bf6d6bf
4
+ data.tar.gz: 7e1775460d12c0c2b8e4014cced56a7dbd84abf215c0882e34a11c198977d28c
5
5
  SHA512:
6
- metadata.gz: 630aee8ec416f891616c5efcdd068994422bfca2415f57a9e211fec53bece058c51af62220301dd7dc547c5fcde34852f5fc970256d6a845040fd58745ab5ca7
7
- data.tar.gz: 7dfc99a09a5e896a76c27fed1c0dcc8ff02b126d51c019831532849626a972a28f2f1593f1d5e59b3a8ced5b97264a6d2abdb876f2874b2a3aad037017aa2757
6
+ metadata.gz: f6ca89938617badf59e7e92503e1b08a87428ea0cadca42af71e93c9e528a5d2f9fd1a2f7c1a90893233db16cad05c46295561f42962c3fcdb8402cbf331e723
7
+ data.tar.gz: 82204e17e4ce3dc1df5555eea3f7817b1cbfa4d1f1bd2de22ef3499ea84539dbce1ef114e651a303367ae35b1a78823b043dc954d907f1717b3305662d692312
@@ -1,6 +1,7 @@
1
1
  require "forwardable"
2
2
  require "relaton_bib/version"
3
3
  require "relaton_bib/deep_dup"
4
+ require "relaton_bib/localized_string"
4
5
  require "relaton_bib/bibliographic_item"
5
6
  require "relaton_bib/hit_collection"
6
7
  require "relaton_bib/hit"
@@ -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 builder }
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 [Nokogiri::XML::Builder] builder
49
- #
50
- def to_xml(builder)
51
- element = builder.docidentifier id
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
@@ -1,7 +1,4 @@
1
1
  # frozen_string_literal: true
2
-
3
- require "relaton_bib/localized_string"
4
-
5
2
  module RelatonBib
6
3
  # Document status.
7
4
  class DocumentStatus
@@ -1,3 +1,3 @@
1
1
  module RelatonBib
2
- VERSION = "1.5.pre".freeze
2
+ VERSION = "1.5.pre1".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.5.pre
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-06 00:00:00.000000000 Z
11
+ date: 2020-10-08 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: byebug