cqm-parsers 4.0.0.0 → 4.1.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile +1 -1
- data/lib/measure-loader/elm_parser.rb +13 -13
- metadata +13 -13
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 941e271032c6b25868959e769dd4980df733a28134c0f1c4902c754fb1dd25f4
|
4
|
+
data.tar.gz: c733db1084a81605ee74005ac528b2d8b3f2fbb9cb7cb92d0e215a8d7693ce7f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 929661a624be50d82bbf71720d141e33d25068a4d3683a79cd318148b656e1bf51b04924b97b3a3d7943c9d065d4eae9d7bd762b207d2be99ddeacb8fd2f9d10
|
7
|
+
data.tar.gz: '090372bf2550215301c871b0e042597797ff62cc2d8cbe7abe49bda2b13bd06c7517250bff3889a739c869843d638522a50507db1b3171c98713a1bd9201d806'
|
data/Gemfile
CHANGED
@@ -2,7 +2,7 @@ source 'https://rubygems.org'
|
|
2
2
|
|
3
3
|
gemspec :development_group => :test
|
4
4
|
|
5
|
-
gem 'mongoid', '~>
|
5
|
+
gem 'mongoid', '~> 7.0.5'
|
6
6
|
|
7
7
|
# gem 'cqm-models', git: 'https://github.com/projecttacoma/cqm-models.git', branch: 'master'
|
8
8
|
# gem 'cqm-models', :path => '../cqm-models'
|
@@ -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,29 +1,29 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: cqm-parsers
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 4.
|
4
|
+
version: 4.1.0.0
|
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-11-09 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: cqm-models
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
|
-
- - "
|
17
|
+
- - ">"
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version:
|
19
|
+
version: 3.0.0
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
|
-
- - "
|
24
|
+
- - ">"
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version:
|
26
|
+
version: 3.0.0
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: mustache
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
@@ -58,14 +58,14 @@ dependencies:
|
|
58
58
|
requirements:
|
59
59
|
- - "~>"
|
60
60
|
- !ruby/object:Gem::Version
|
61
|
-
version:
|
61
|
+
version: 7.0.5
|
62
62
|
type: :runtime
|
63
63
|
prerelease: false
|
64
64
|
version_requirements: !ruby/object:Gem::Requirement
|
65
65
|
requirements:
|
66
66
|
- - "~>"
|
67
67
|
- !ruby/object:Gem::Version
|
68
|
-
version:
|
68
|
+
version: 7.0.5
|
69
69
|
- !ruby/object:Gem::Dependency
|
70
70
|
name: mongoid-tree
|
71
71
|
requirement: !ruby/object:Gem::Requirement
|
@@ -86,14 +86,14 @@ dependencies:
|
|
86
86
|
requirements:
|
87
87
|
- - "~>"
|
88
88
|
- !ruby/object:Gem::Version
|
89
|
-
version:
|
89
|
+
version: '6.0'
|
90
90
|
type: :runtime
|
91
91
|
prerelease: false
|
92
92
|
version_requirements: !ruby/object:Gem::Requirement
|
93
93
|
requirements:
|
94
94
|
- - "~>"
|
95
95
|
- !ruby/object:Gem::Version
|
96
|
-
version:
|
96
|
+
version: '6.0'
|
97
97
|
- !ruby/object:Gem::Dependency
|
98
98
|
name: uuid
|
99
99
|
requirement: !ruby/object:Gem::Requirement
|
@@ -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.
|