pubid-core 1.2.2 → 1.3.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/pubid/core/renderer/base.rb +29 -24
- data/lib/pubid/core/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 044351542136162d7aca14a0c3f2997c922c7cee236b2ba5e849284ed3c0b2eb
|
4
|
+
data.tar.gz: '07709b34769d3aef2501c8e715a5757273e0010f332b45760742fdf1b832c617'
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c8485180c9bbfd44d7e7f2d8a80177171e17bbd3db278d22a440b470ee82747fbcf5e888872773522aa35106028360dd7318a7af4b091290dbcb11d2835d9f41
|
7
|
+
data.tar.gz: d44abfc112288e85c383f0d9871bf0904cf8dd13a2e5808043371806961bec0b39fa263fd2bcf55e1e31ad099d96b8c80c0834b6258dcc706a9f5fae43646693
|
@@ -42,31 +42,36 @@ module Pubid::Core::Renderer
|
|
42
42
|
|
43
43
|
# Renders amendment and corrigendum when applied through identifier type
|
44
44
|
def render_supplement(supplement_params, **args)
|
45
|
-
if supplement_params[:base].type == :amd
|
46
|
-
|
47
|
-
|
45
|
+
base = if supplement_params[:base].type == :amd
|
46
|
+
# render inner amendment (cor -> amd -> base)
|
47
|
+
render_supplement(supplement_params[:base].get_params, **args)
|
48
|
+
else
|
49
|
+
self.class.new(supplement_params[:base].get_params).render_base_identifier(
|
50
|
+
# always render year for identifiers with supplement
|
51
|
+
**args.merge({ with_date: true }),
|
52
|
+
)
|
53
|
+
end
|
54
|
+
supplement = case supplement_params[:typed_stage].type.type
|
55
|
+
when :amd
|
56
|
+
render_amendments(
|
57
|
+
[Pubid::Iso::Amendment.new(**supplement_params.slice(:number, :year, :typed_stage, :edition, :iteration))],
|
58
|
+
args,
|
59
|
+
nil,
|
60
|
+
)
|
61
|
+
when :cor
|
62
|
+
render_corrigendums(
|
63
|
+
[Pubid::Iso::Corrigendum.new(**supplement_params.slice(:number, :year, :typed_stage, :edition, :iteration))],
|
64
|
+
args,
|
65
|
+
nil,
|
66
|
+
)
|
67
|
+
# copy parameters from Identifier only supported by Corrigendum
|
68
|
+
end
|
69
|
+
|
70
|
+
if supplement_params[:base].language
|
71
|
+
base + supplement + render_language(supplement_params[:base].language, args, nil)
|
48
72
|
else
|
49
|
-
|
50
|
-
|
51
|
-
**args.merge({ with_date: true }),
|
52
|
-
)
|
53
|
-
end +
|
54
|
-
case supplement_params[:type].type
|
55
|
-
when :amd
|
56
|
-
render_amendments(
|
57
|
-
[Pubid::Iso::Amendment.new(**supplement_params.slice(:number, :year, :stage, :edition, :iteration))],
|
58
|
-
args,
|
59
|
-
nil,
|
60
|
-
)
|
61
|
-
when :cor
|
62
|
-
render_corrigendums(
|
63
|
-
[Pubid::Iso::Corrigendum.new(**supplement_params.slice(:number, :year, :stage, :edition, :iteration))],
|
64
|
-
args,
|
65
|
-
nil,
|
66
|
-
)
|
67
|
-
# copy parameters from Identifier only supported by Corrigendum
|
68
|
-
end +
|
69
|
-
(supplement_params[:base].language ? render_language(supplement_params[:base].language, args, nil) : "")
|
73
|
+
base + supplement
|
74
|
+
end
|
70
75
|
end
|
71
76
|
|
72
77
|
# Render identifier
|
data/lib/pubid/core/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: pubid-core
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.3.0
|
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-
|
11
|
+
date: 2022-11-01 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rake
|