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.
Files changed (4) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile +1 -1
  3. data/lib/measure-loader/elm_parser.rb +13 -13
  4. metadata +13 -13
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: d42976fc653ecb9c5a69de2d4ff1cb23a56880bbfc45f53cc7f159f45e7929a4
4
- data.tar.gz: 4d66c6e37db1a5a4ad9ea4134eda9388817092031ebe0aa7cec9e1c1b69057ac
3
+ metadata.gz: 941e271032c6b25868959e769dd4980df733a28134c0f1c4902c754fb1dd25f4
4
+ data.tar.gz: c733db1084a81605ee74005ac528b2d8b3f2fbb9cb7cb92d0e215a8d7693ce7f
5
5
  SHA512:
6
- metadata.gz: 33eca35212fcfc098812f2959c1390771bc2fb8453161b1b243cca5c59fdb30398a74ca01e285d4799d5978704012cedf581a3e22e62c226f8881804fac66d75
7
- data.tar.gz: efcfb1116851ac81d5ec7659821f5f4547e8c93ab9e41e28bf8f9895e99bfd3be2e3a00f93cea238776bd3192b94cca6cbe5d759cbed74e52fbe23adfa81b062
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', '~> 6.4.2'
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
- # extracts the fields of type "annotation" and their children.
17
- annotations = doc.css("annotation")
18
- annotations.each do |node|
19
- node, define_name = parse_node(node, localid_to_type_map)
20
- unless define_name.nil?
21
- node[:define_name] = define_name
22
- ret[:statements] << node
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, child_define_name = parse_node(child, localid_to_type_map)
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, define_name
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.0.0.0
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: 2021-10-19 00:00:00.000000000 Z
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: 4.0.0
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: 4.0.0
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: 6.4.2
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: 6.4.2
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: 5.2.1
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: 5.2.1
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.13.0
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.13.0
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.0.2
332
+ rubygems_version: 3.1.6
333
333
  signing_key:
334
334
  specification_version: 4
335
335
  summary: A library for parsing HQMF documents.