pubid 2.0.0.pre.alpha.56 → 2.0.0.pre.alpha.57

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: e85316ccc412af8b803094d2709f82df1d8f3a2fc92e5759f480c3f34507bb69
4
- data.tar.gz: 7889336578a2ca23f923e1ead5d8823ed096d20254b64daa8116d3266fd1bec6
3
+ metadata.gz: 70979465840486106762bb8f458350afc40c642b0511505514a595e78bdb8ab5
4
+ data.tar.gz: e9ee0e755aa917dabbf8fa006e581d3a9bad351a743833f9d4ebe6fecd04465d
5
5
  SHA512:
6
- metadata.gz: eaee3e9a2f9a1f4b8c7542a0c05cd2567e854ddf33b7ea53af76f6d448d3504275e891a0ad7e84f959a4e5a0d17eee58b1bc2ebb87000a4583f53d77bd60a9dd
7
- data.tar.gz: 4f6e244f34f0832cf7232e5a4c53cbaa284da3931a68d0360dbeebd4cbf4a455b116eb217fd8b3896a59b2c2f7a33a2661f320dd99b7b8d9deb74100916b63e5
6
+ metadata.gz: 0eb981cb03629a763f0607d11e38a55fc30cf8662081a9fdd3a5e5b9defc56fa55b7598b589c16d5a4a7eaafabd5c74210c8e65433ed9a919302a661241d7456
7
+ data.tar.gz: 551760209ddb0c5816ee9e463fc058144e50822d41fdf2e94d8f7c7cdb136515416a1c1be02be4b1109a1da8e640a270842e6d915162d3bdc4eeea44ab83d553
@@ -13,14 +13,18 @@ module Pubid
13
13
  annotated: context.annotated,
14
14
  )
15
15
 
16
- stage_str = annotate(@id.typed_stage.render(context:),
16
+ # A nil typed_stage means "no stage" (metanorma-iso's draft-biblio
17
+ # flow assigns nil through the public setter); render the supplement
18
+ # without the stage segment instead of crashing on nil.render.
19
+ stage_str = @id.typed_stage &&
20
+ annotate(@id.typed_stage.render(context:),
17
21
  typed_stage_css(@id.typed_stage),
18
22
  annotated: context.annotated)
19
- parts << "#{base_str}/#{stage_str}"
23
+ parts << (stage_str ? "#{base_str}/#{stage_str}" : "#{base_str}/")
20
24
 
21
25
  num_port = render_number_portion(context)
22
26
  if num_port && !num_port.empty? && !num_port.start_with?(":")
23
- parts << (stage_str.end_with?(".") ? "" : " ")
27
+ parts << (stage_str&.end_with?(".") ? "" : " ")
24
28
  end
25
29
  parts << num_port
26
30
 
data/lib/pubid/version.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Pubid
4
- VERSION = "2.0.0.pre.alpha.56"
4
+ VERSION = "2.0.0.pre.alpha.57"
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pubid
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.0.pre.alpha.56
4
+ version: 2.0.0.pre.alpha.57
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ribose Inc.