relaton-render 0.9.0 → 0.9.1

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: 60624cccbc9d2e12cc7bdd47f4a8dfadbfb3173ae3eb9e2cc5c7e9463ff5eae3
4
- data.tar.gz: 7b00ae7cb5612f7c225a5211d18b1d118466e1e6ae96211191462e2d4eface81
3
+ metadata.gz: 75575a57cbac1f7ce210b85d268a9823b40480a39450db3280d56f7957e61cc6
4
+ data.tar.gz: 70b154b648b4128289f6ba3756b6ab214e449616b68be983e3adb45ddb58ad70
5
5
  SHA512:
6
- metadata.gz: 625abfc7777b059ba61e8d1fc8cdb858390f7497e3c537522e84e3aed4e8bc375cb8363651e51b6b4d97d1b54084ce289f3215f7c396dbc0f6be4eb69e520697
7
- data.tar.gz: e15b472ab455fea5e36465fbfcd1571d8dfadcae5bd34034abf02e4bb53e4067e76a5471420b6054829926bd5efa95a857ebf9868b77acada502c6a8a673f72e
6
+ metadata.gz: 3895597474affcbe243087c895f2d98d75e705401b0fb686539bf11e37bc160906a8fe03f1481dd678b2378464b77493e8995bdd59b4f40ee366f12e8649e3dd
7
+ data.tar.gz: 3ab8323c45c199cb25490a7c7eadf0208d82acb0d5457f4c6df8b37dc81ebf50647745cc759110f242a2a7b683ba384954bcacdf0024be69ddb2896523cfa6b1
@@ -128,13 +128,15 @@ module Relaton
128
128
  end
129
129
 
130
130
  def extentformat(extent, hash)
131
- extent.map do |e|
131
+ extent.map do |stack|
132
+ stack.map do |e|
132
133
  e1 = e.transform_values { |v| v.is_a?(Hash) ? range(v) : v }
133
134
  ret = e.each_with_object({}) do |(k, v), m|
134
135
  extentformat1(k, v, m, e1)
135
136
  m
136
137
  end
137
138
  @r.extenttemplate.render(hash.merge(ret))
139
+ end.join(" ")
138
140
  end.join("; ")
139
141
  end
140
142
 
@@ -5,6 +5,8 @@ module Relaton
5
5
  node.nil? and return node
6
6
  node.content.is_a?(Array) and return node.content.map { |x| content(x) }
7
7
  node.content.strip
8
+ #node.children.map { |n| n.text? ? n.content : n.to_xml }.join
9
+ #node.text? ? node.content.strip : node.to_xml.strip
8
10
  end
9
11
 
10
12
  def extract_orgname(org)
@@ -141,13 +141,15 @@ module Relaton
141
141
  doc.extent.each_with_object([]) do |e, acc|
142
142
  case e
143
143
  when RelatonBib::Extent, RelatonBib::LocalityStack
144
- e.locality.each do |e1|
144
+ a = e.locality.each_with_object([]) do |e1, m|
145
145
  if e1.is_a?(RelatonBib::LocalityStack)
146
- acc << extent1(e1.locality)
146
+ m << extent1(e1.locality)
147
147
  else
148
- acc << extent1(Array(e1))
148
+ m.empty? and m << {}
149
+ m[-1].merge!(extent1(Array(e1)))
149
150
  end
150
151
  end
152
+ acc << a
151
153
  when RelatonBib::Locality
152
154
  acc << extent1(Array(e))
153
155
  end
@@ -1,5 +1,5 @@
1
1
  module Relaton
2
2
  module Render
3
- VERSION = "0.9.0".freeze
3
+ VERSION = "0.9.1".freeze
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: relaton-render
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.9.0
4
+ version: 0.9.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ribose Inc.
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2024-12-19 00:00:00.000000000 Z
11
+ date: 2024-12-23 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler