pubid-iso 0.1.11 → 0.1.12
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/identifier.rb +2 -2
- data/lib/pubid/iso/parser.rb +2 -2
- data/lib/pubid/iso/supplement.rb +1 -1
- data/lib/pubid/iso/transformer.rb +14 -12
- data/lib/pubid/iso/version.rb +1 -1
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e97d39eae4c4c0962361910084b0ba9ed9613a01761214d2f4a0750e0c71fe39
|
4
|
+
data.tar.gz: 0b41fc99349db1c5c5672e690305561e01dac3503d7c226b049bada4fcf857b7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7859c8ac83fc94369f1fab9fc6d4c7529cc49d35a5a09c2fa34dda3b95b2d21d1cd5917e277e6c63bbf96ec174496494ca328f8fff0d995e59ae160423d0ba01
|
7
|
+
data.tar.gz: 7a104ec181c49142996ef2133648a9145a2c0a0d01a05348abddf362285327d915e59d0b283913113b03bd343ee44f5f5de5265ba111ad21ed2da25bffee2ef8
|
data/lib/pubid/iso/identifier.rb
CHANGED
@@ -40,10 +40,10 @@ module Pubid::Iso
|
|
40
40
|
raise Errors::SupplementWithoutYearError, "Cannot apply supplement to document without edition year"
|
41
41
|
end
|
42
42
|
if stage
|
43
|
-
|
43
|
+
@stage = (stage.is_a?(Symbol) || stage.is_a?(String)) ? Stage.new(abbr: stage) : stage
|
44
|
+
if @stage.abbr == "IS" && iteration
|
44
45
|
raise Errors::IsStageIterationError, "IS stage document cannot have iteration"
|
45
46
|
end
|
46
|
-
@stage = stage
|
47
47
|
end
|
48
48
|
@iteration = iteration.to_i if iteration
|
49
49
|
@supplement = supplement if supplement
|
data/lib/pubid/iso/parser.rb
CHANGED
@@ -63,7 +63,7 @@ module Pubid::Iso
|
|
63
63
|
(space | str(".")).repeat(1).maybe >>
|
64
64
|
digits.as(:number) >>
|
65
65
|
(str(".") >> digits.as(:iteration)).maybe >>
|
66
|
-
((str(":") | str("-")) >> digits.as(:year)).maybe).as(:amendments)
|
66
|
+
((str(":") | str("-")) >> digits.as(:year)).maybe).repeat(1).as(:amendments)
|
67
67
|
end
|
68
68
|
|
69
69
|
rule(:corrigendum) do
|
@@ -73,7 +73,7 @@ module Pubid::Iso
|
|
73
73
|
(space | str(".")).repeat(1).maybe >>
|
74
74
|
digits.as(:number) >>
|
75
75
|
(str(".") >> digits.as(:iteration)).maybe >>
|
76
|
-
((str(":") | str("-")) >> digits.as(:year)).maybe).as(:corrigendums)
|
76
|
+
((str(":") | str("-")) >> digits.as(:year)).maybe).repeat(1).as(:corrigendums)
|
77
77
|
end
|
78
78
|
|
79
79
|
rule(:language) do
|
data/lib/pubid/iso/supplement.rb
CHANGED
@@ -9,7 +9,7 @@ module Pubid::Iso
|
|
9
9
|
# @see Pubid::Core::Supplement for other options
|
10
10
|
def initialize(stage: nil, publisher: nil, edition: nil, iteration: nil, **args)
|
11
11
|
super(**args)
|
12
|
-
@stage = stage
|
12
|
+
@stage = (stage.is_a?(Symbol) || stage.is_a?(String)) ? Stage.new(abbr: stage) : stage
|
13
13
|
@publisher = publisher.to_s
|
14
14
|
@edition = edition&.to_i
|
15
15
|
@iteration = iteration&.to_i
|
@@ -10,23 +10,25 @@ module Pubid::Iso
|
|
10
10
|
|
11
11
|
rule(amendments: subtree(:amendments)) do |context|
|
12
12
|
context[:amendments] =
|
13
|
-
[
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
13
|
+
context[:amendments].map do |amendment|
|
14
|
+
Amendment.new(
|
15
|
+
number: amendment[:number],
|
16
|
+
year: amendment[:year],
|
17
|
+
stage: amendment[:stage] && convert_stage(amendment[:stage]),
|
18
|
+
iteration: amendment[:iteration])
|
19
|
+
end
|
19
20
|
context
|
20
21
|
end
|
21
22
|
|
22
23
|
rule(corrigendums: subtree(:corrigendums)) do |context|
|
23
24
|
context[:corrigendums] =
|
24
|
-
[
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
25
|
+
context[:corrigendums].map do |corrigendum|
|
26
|
+
Corrigendum.new(
|
27
|
+
number: corrigendum[:number],
|
28
|
+
year: corrigendum[:year],
|
29
|
+
stage: corrigendum[:stage] && convert_stage(corrigendum[:stage]),
|
30
|
+
iteration: corrigendum[:iteration])
|
31
|
+
end
|
30
32
|
context
|
31
33
|
end
|
32
34
|
|
data/lib/pubid/iso/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: pubid-iso
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.12
|
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-09-
|
11
|
+
date: 2022-09-19 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rake
|
@@ -100,14 +100,14 @@ dependencies:
|
|
100
100
|
requirements:
|
101
101
|
- - "~>"
|
102
102
|
- !ruby/object:Gem::Version
|
103
|
-
version: 1.
|
103
|
+
version: 1.2.0
|
104
104
|
type: :runtime
|
105
105
|
prerelease: false
|
106
106
|
version_requirements: !ruby/object:Gem::Requirement
|
107
107
|
requirements:
|
108
108
|
- - "~>"
|
109
109
|
- !ruby/object:Gem::Version
|
110
|
-
version: 1.
|
110
|
+
version: 1.2.0
|
111
111
|
description: Library to generate, parse and manipulate ISO PubID.
|
112
112
|
email:
|
113
113
|
- open.source@ribose.com
|