mn-requirements 0.2.3 → 0.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/metanorma/default/default.rb +3 -1
- data/lib/metanorma/modspec/validate.rb +18 -7
- data/lib/metanorma/requirements/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: 4f81b57e8350c7018f06bb68420de8d7b409b7f9ff4b81eb0d98d06f484e246e
|
4
|
+
data.tar.gz: 771ba5edb39491ad133dfc2d8cacaba2e11a0eba8b95389a2d834ddd84d0227a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 38d500ecb762b731b2ef373c55c67b0cfef8e4a93bfcf4619d629c6fe69fae635c4362502bf3235a94f3b5cfbab7248fcd5e7110c42640916bd4e3b3b33e21dc
|
7
|
+
data.tar.gz: 8d5c5b770acd55b9b0006345f3c743e863239257c353626e4f56f0cb50dc218f9512338080e30bec75160e89b61bf85b747296ead049480812625799cc3fc74e
|
@@ -4,10 +4,12 @@ module Metanorma
|
|
4
4
|
class Requirements
|
5
5
|
class Modspec < Default
|
6
6
|
def validate(reqt, log)
|
7
|
+
@fatalerrors = []
|
7
8
|
@log ||= log
|
8
9
|
@ids ||= reqt_links(reqt.document)
|
9
10
|
reqt_cycles_validate
|
10
11
|
reqt_link_validate(reqt)
|
12
|
+
@fatalerrors
|
11
13
|
end
|
12
14
|
|
13
15
|
def nested_reqt?(reqt)
|
@@ -112,17 +114,26 @@ module Metanorma
|
|
112
114
|
.each_with_object({ id: {}, class: {}, label: {} }) do |r, m|
|
113
115
|
next if nested_reqt?(r)
|
114
116
|
|
115
|
-
reqt_links1(r, m)
|
117
|
+
reqt_links1(r, m, type2validate(r), reqt_links_struct(r))
|
116
118
|
end
|
117
119
|
end
|
118
120
|
|
119
|
-
def reqt_links1(reqt, hash)
|
120
|
-
|
121
|
-
a = reqt_links_struct(reqt)
|
122
|
-
hash[:id][reqt["id"]] = a
|
121
|
+
def reqt_links1(reqt, hash, type, struct)
|
122
|
+
hash[:id][reqt["id"]] = struct
|
123
123
|
hash[:class][type] ||= []
|
124
|
-
hash[:class][type] <<
|
125
|
-
hash
|
124
|
+
hash[:class][type] << struct
|
125
|
+
reqt_links1_label(reqt, hash, struct)
|
126
|
+
end
|
127
|
+
|
128
|
+
def reqt_links1_label(reqt, hash, struct)
|
129
|
+
return hash unless struct[:label]
|
130
|
+
|
131
|
+
if hash[:label][struct[:label]]
|
132
|
+
msg = "Modspec identifier #{struct[:label]} is used more than once"
|
133
|
+
@log.add("Requirements", reqt, msg)
|
134
|
+
@fatalerrors << msg
|
135
|
+
end
|
136
|
+
hash[:label][struct[:label]] = reqt["id"]
|
126
137
|
hash
|
127
138
|
end
|
128
139
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: mn-requirements
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.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-
|
11
|
+
date: 2022-11-24 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: isodoc-i18n
|