cqm-parsers 4.0.0.0 → 4.0.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/measure-loader/elm_parser.rb +13 -13
- metadata +5 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9b9cd766586a10d7e7c93a71a4e17917306b877da4cba464d080c0d2e734007e
|
4
|
+
data.tar.gz: 4b8c2f211f8778d0d076403961946875c4c30808fcff24defca36250b3562477
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7b9649c92450d6aa774ab727d9b68a3ff17ca83ffa856f0d0f8e7c24a5cc3ebb0eeaf7eb7b7327ff4d231fd8da03794d5a8be0e4040de86f8ff81c67bedb5abf
|
7
|
+
data.tar.gz: 69751632831b6114194b428c2514ff04cc4129d0878adaa6a4a0a3411d62c90c7053909d821929d5c153b82e5287b27d6581bb6c65031770c973a5134217d0a3
|
@@ -12,14 +12,17 @@ module Measures
|
|
12
12
|
# extract library identifier data
|
13
13
|
ret[:identifier][:id] = doc.css("identifier").attr("id").value
|
14
14
|
ret[:identifier][:version] = doc.css("identifier").attr("version").value
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
15
|
+
# all the define statements including functions
|
16
|
+
definitions = doc.css("statements def")
|
17
|
+
definitions&.each do |definition|
|
18
|
+
annotation = definition.at("annotation")
|
19
|
+
if annotation
|
20
|
+
node = parse_node(annotation, localid_to_type_map)
|
21
|
+
define_name = definition.attr("name")
|
22
|
+
unless define_name.nil?
|
23
|
+
node[:define_name] = define_name
|
24
|
+
ret[:statements] << node
|
25
|
+
end
|
23
26
|
end
|
24
27
|
end
|
25
28
|
ret
|
@@ -31,7 +34,6 @@ module Measures
|
|
31
34
|
ret = {
|
32
35
|
children: []
|
33
36
|
}
|
34
|
-
define_name = nil
|
35
37
|
node.children.each do |child|
|
36
38
|
if child.is_a?(Nokogiri::XML::Text) # leaf node
|
37
39
|
clause_text = child.content.gsub(/\t/, " ")
|
@@ -40,19 +42,17 @@ module Measures
|
|
40
42
|
}
|
41
43
|
clause[:ref_id] = child['r'] unless child['r'].nil?
|
42
44
|
ret[:children] << clause
|
43
|
-
define_name = clause_text.split("\"")[1] if clause_text.strip.starts_with?("define")
|
44
45
|
else
|
45
46
|
node_type = localid_to_type_map[child['r']] unless child['r'].nil?
|
46
47
|
# Parses the current child recursively. child_define_name will bubble up to indicate which
|
47
48
|
# statement is currently being traversed.
|
48
|
-
node
|
49
|
+
node = parse_node(child, localid_to_type_map)
|
49
50
|
node[:node_type] = node_type unless node_type.nil?
|
50
51
|
node[:ref_id] = child['r'] unless child['r'].nil?
|
51
52
|
ret[:children] << node
|
52
|
-
define_name = child_define_name unless child_define_name.nil?
|
53
53
|
end
|
54
54
|
end
|
55
|
-
return ret
|
55
|
+
return ret
|
56
56
|
end
|
57
57
|
|
58
58
|
def self.generate_localid_to_type_map(doc)
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: cqm-parsers
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 4.0.0.
|
4
|
+
version: 4.0.0.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- The MITRE Corporation
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2022-05-09 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: cqm-models
|
@@ -131,7 +131,7 @@ dependencies:
|
|
131
131
|
version: 1.8.5
|
132
132
|
- - "<"
|
133
133
|
- !ruby/object:Gem::Version
|
134
|
-
version: 1.
|
134
|
+
version: 1.14.0
|
135
135
|
type: :runtime
|
136
136
|
prerelease: false
|
137
137
|
version_requirements: !ruby/object:Gem::Requirement
|
@@ -141,7 +141,7 @@ dependencies:
|
|
141
141
|
version: 1.8.5
|
142
142
|
- - "<"
|
143
143
|
- !ruby/object:Gem::Version
|
144
|
-
version: 1.
|
144
|
+
version: 1.14.0
|
145
145
|
- !ruby/object:Gem::Dependency
|
146
146
|
name: highline
|
147
147
|
requirement: !ruby/object:Gem::Requirement
|
@@ -329,7 +329,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
329
329
|
- !ruby/object:Gem::Version
|
330
330
|
version: '0'
|
331
331
|
requirements: []
|
332
|
-
rubygems_version: 3.
|
332
|
+
rubygems_version: 3.1.6
|
333
333
|
signing_key:
|
334
334
|
specification_version: 4
|
335
335
|
summary: A library for parsing HQMF documents.
|