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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 2a3c1e99b3327c14f2364992238d1d6a4040809dca85a6640254e2669784a449
4
- data.tar.gz: ca910a6333a2e5e9dc1c907577bee5c3e0c34bc6a891e07b310f4be39e9ecc59
3
+ metadata.gz: 044351542136162d7aca14a0c3f2997c922c7cee236b2ba5e849284ed3c0b2eb
4
+ data.tar.gz: '07709b34769d3aef2501c8e715a5757273e0010f332b45760742fdf1b832c617'
5
5
  SHA512:
6
- metadata.gz: b148eeaf72cd34a292d1da244e33a4c4f7eb1549cca374e9c7da7aadc6a09de262c992de578725ebb5ecaad4c1fa625365dbfda519119ccec82c39da224d71f7
7
- data.tar.gz: 9fb7676fbd6e7ffbf1bce920a626d70a260c24e83d59569447595c4e28157e879969b6700423d9199564e915d7929ca5c93a507e2703d79c192f0cc21d6f91cf
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
- # render inner amendment (cor -> amd -> base)
47
- render_supplement(supplement_params[:base].get_params, **args)
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
- 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
- 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
@@ -1,5 +1,5 @@
1
1
  module Pubid
2
2
  module Core
3
- VERSION = "1.2.2".freeze
3
+ VERSION = "1.3.0".freeze
4
4
  end
5
5
  end
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.2.2
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-10-15 00:00:00.000000000 Z
11
+ date: 2022-11-01 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rake