relaton-render 0.5.9 → 0.5.10
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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: be542bce28bee8b30b8a719d8e6e822fb998c7d042c2c7b546309733c3ca1d66
|
4
|
+
data.tar.gz: 5be41eba5e9771af4d39bcf7e2df8d4344db4ad9275d2fbf97fcb9c3f7eef362
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 54acff0f3354e44e6af2fe54fc20dd1f1f814b4d632604e820b6ab72a04275dc0b46dcd7981dd7a12f17ddea05506ed73b7c6401b31fe35097b90d5352ea3b5b
|
7
|
+
data.tar.gz: 4a584b500e0e6438fdc69340386c641e6f79780ca8cbe0d01811fddcb0d5baafa99e5679a447efad08e5e6e15d4de2ba5dd56fc7e4832ee914ec6412009d1dd9
|
data/README.adoc
CHANGED
@@ -165,7 +165,7 @@ drawn from the bibliographic item:
|
|
165
165
|
| creatornames | ./contributor[role/@type = 'author'] \| ./contributor[role/@type = 'performer'] \| ./contributor[role/@type = 'adapter'] \| ./contributor[role/@type = 'translator'] \| ./contributor[role/@type = 'editor'] \| ./contributor[role/@type = 'distributor'] \| ./contributor[role/@type = 'authorizer'] \| ./contributor | Y | | <<nametemplate,`nametemplate`>> applied to each name; joining template from internationalisation applied to multiple names
|
166
166
|
| authorcite | ./contributor[role/@type = 'author'] \| ./contributor[role/@type = 'performer'] \| ./contributor[role/@type = 'adapter'] \| ./contributor[role/@type = 'translator'] \| ./contributor[role/@type = 'editor'] \| ./contributor[role/@type = 'distributor'] \| ./contributor[role/@type = 'authorizer'] \| ./contributor | Y | | <<authorcitetemplate,`authorcitetemplate`>> applied to each name; joining template from internationalisation applied to multiple names
|
167
167
|
| role | ./contributor[role/description] \| ./contributor[role/@type] | | |
|
168
|
-
| date | ./date[@type = 'issued'] \| ./date[@type = 'circulated'] \| ./date | | Y |
|
168
|
+
| date | ./date[@type = 'issued'] \| ./date[@type = 'circulated'] \| ./date | | Y | Always truncated to just year
|
169
169
|
| date_updated | ./date[@type = 'updated'] | | Y |
|
170
170
|
| date_accessed | ./date[@type = 'accessed'] | | Y |
|
171
171
|
| series | ./series[@type = 'main' or not(@type) or true] | | Y | <<seriestemplate,`seriestemplate`>> applies to series
|
@@ -157,12 +157,12 @@ module Relaton
|
|
157
157
|
end
|
158
158
|
|
159
159
|
def range(hash)
|
160
|
-
|
161
|
-
|
162
|
-
|
163
|
-
|
164
|
-
|
165
|
-
|
160
|
+
hash[:on] and return hash[:on]
|
161
|
+
hash.has_key?(:from) && hash[:from].nil? and return nil
|
162
|
+
!hash[:from] and return hash
|
163
|
+
hash[:to] && hash[:to] != hash[:from] and
|
164
|
+
return "#{hash[:from]}–#{hash[:to]}"
|
165
|
+
hash[:from]
|
166
166
|
end
|
167
167
|
|
168
168
|
def sizeformat(size, hash)
|
@@ -199,10 +199,8 @@ module Relaton
|
|
199
199
|
end
|
200
200
|
|
201
201
|
def date_range(hash)
|
202
|
-
|
203
|
-
|
204
|
-
else range(hash)
|
205
|
-
end
|
202
|
+
hash[:from] && !hash[:to] and return "#{hash[:from]}–"
|
203
|
+
range(hash)
|
206
204
|
end
|
207
205
|
|
208
206
|
def dateformat(date, _hash)
|
@@ -112,10 +112,13 @@ module Relaton
|
|
112
112
|
date.first
|
113
113
|
end
|
114
114
|
|
115
|
+
# year-only
|
115
116
|
def date(doc, host)
|
116
117
|
ret = date1(doc.date)
|
117
118
|
host and ret ||= date1(host.date)
|
118
|
-
datepick(ret)
|
119
|
+
datepick(ret)&.transform_values do |v|
|
120
|
+
v&.sub(/-.*$/, "")
|
121
|
+
end
|
119
122
|
end
|
120
123
|
|
121
124
|
def date_updated(doc, host)
|
@@ -102,8 +102,9 @@ module Relaton
|
|
102
102
|
|
103
103
|
def other_identifier(doc)
|
104
104
|
doc.docidentifier.each_with_object([]) do |id, ret|
|
105
|
-
|
106
|
-
|
105
|
+
type = id.type&.sub(/^(ISBN|ISSN)\..*$/, "\\1")
|
106
|
+
other_identifier_include.include? type or next
|
107
|
+
ret << @i18n.l10n("#{type}: #{id.id}")
|
107
108
|
end
|
108
109
|
end
|
109
110
|
|
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.5.
|
4
|
+
version: 0.5.10
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ribose Inc.
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2023-01-14 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|