pubid 2.0.16 → 2.0.17
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 +4 -4
- data/lib/pubid/iso/supplement_identifier.rb +8 -0
- data/lib/pubid/renderers/supplement_renderer.rb +5 -12
- data/lib/pubid/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 0da3c4f8d7e991cfcee13325c148d4a58d3f9819521e24e96d6c9847dd0c49f1
|
|
4
|
+
data.tar.gz: 54c6aa151ee3c7ea3769b8ce83f153767ee48b804e967a02b805c097e71f8b31
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 80f63afedfd49021008da385957f9ea5c4dfb858e941467be476fb41027888a802c16c1c6542c86a0ef427cc507b9a419912bcb8529f3a2fe24dfd1939e0362a
|
|
7
|
+
data.tar.gz: a47f5d38518d79b0443f1cb9903f5b82d6875031be8f6b579f4b6b5fb0da7dab2e68f25c3ec4ecc008554a45dcacebc17c89d69edc606dcf34ec866c3c774bd3
|
|
@@ -56,6 +56,14 @@ module Pubid
|
|
|
56
56
|
def to_s(**opts)
|
|
57
57
|
return super if opts[:format] && opts[:format] != :human
|
|
58
58
|
|
|
59
|
+
# A supplement segment without a stage is malformed per ISO DIR
|
|
60
|
+
# composition (pubid#680): raise instead of emitting a bare "/".
|
|
61
|
+
unless typed_stage
|
|
62
|
+
raise ArgumentError,
|
|
63
|
+
"cannot render supplement without a typed_stage: " \
|
|
64
|
+
"#{base.respond_to?(:to_s) ? base : self}"
|
|
65
|
+
end
|
|
66
|
+
|
|
59
67
|
context = build_rendering_context(
|
|
60
68
|
nil, format: :human, **opts.except(:with_publisher)
|
|
61
69
|
)
|
|
@@ -13,20 +13,13 @@ module Pubid
|
|
|
13
13
|
annotated: context.annotated,
|
|
14
14
|
)
|
|
15
15
|
|
|
16
|
-
# A supplement without a
|
|
17
|
-
#
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
# the stage (metanorma-iso#1696).
|
|
21
|
-
unless @id.typed_stage
|
|
22
|
-
raise ArgumentError,
|
|
23
|
-
"cannot render supplement without a typed_stage: #{base_str}"
|
|
24
|
-
end
|
|
25
|
-
|
|
26
|
-
stage_str = annotate(@id.typed_stage.render(context:),
|
|
16
|
+
# A supplement without a stage renders without the stage segment.
|
|
17
|
+
# Flavors that require a stage raise in their own identifier class.
|
|
18
|
+
stage_str = @id.typed_stage &&
|
|
19
|
+
annotate(@id.typed_stage.render(context:),
|
|
27
20
|
typed_stage_css(@id.typed_stage),
|
|
28
21
|
annotated: context.annotated)
|
|
29
|
-
parts << "#{base_str}/#{stage_str}"
|
|
22
|
+
parts << (stage_str ? "#{base_str}/#{stage_str}" : "#{base_str}")
|
|
30
23
|
|
|
31
24
|
num_port = render_number_portion(context)
|
|
32
25
|
if num_port && !num_port.empty? && !num_port.start_with?(":")
|
data/lib/pubid/version.rb
CHANGED