vrt 0.4.3 → 0.4.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/vrt.rb +5 -1
- data/lib/vrt/cross_version_mapping.rb +6 -2
- data/lib/vrt/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 883f1b111f0d07e0f3cfd8fee0382c06b5df6d97
|
4
|
+
data.tar.gz: 6c29c4d366a9dc48a5e9a4f080fd8e4e13c72a0b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ba0e927a7ae12b7262050a9ae274085f69404f880343b0d89a40bc681b392e69f1f370cedd95fc73a28433a683fd8f3205f6c7384f09a57d2c3cfffab9879308
|
7
|
+
data.tar.gz: 15b48c431ff02144d73207176c9b0a3ca908abf3e6aac7ef4c4e33faf3b8f053eb8cd43bfeca83dbb7bac49348691095543ecfdb7d31ba443a8f95666c937170
|
data/lib/vrt.rb
CHANGED
@@ -57,7 +57,11 @@ module VRT
|
|
57
57
|
|
58
58
|
# Get all deprecated ids that would match in the given categories from the current version
|
59
59
|
def all_matching_categories(categories)
|
60
|
-
cross_version_category_mapping
|
60
|
+
cross_version_category_mapping
|
61
|
+
.select { |key, _value| categories.include?(key) }
|
62
|
+
.values
|
63
|
+
.flatten
|
64
|
+
.uniq
|
61
65
|
end
|
62
66
|
|
63
67
|
# Finds the best match valid node. First looks at valid nodes in the given new version or finds
|
@@ -1,12 +1,16 @@
|
|
1
1
|
module VRT
|
2
2
|
module CrossVersionMapping
|
3
3
|
# Maps new_category_id: deprecated_node_id
|
4
|
+
# and new_subcategory_id: deprecated_node_id
|
4
5
|
def cross_version_category_mapping
|
5
6
|
category_map = {}
|
6
7
|
deprecated_node_json.each do |key, value|
|
7
8
|
latest_version = value.keys.sort_by { |n| Gem::Version.new(n) }.last
|
8
|
-
|
9
|
-
|
9
|
+
id_list = value[latest_version].split('.')
|
10
|
+
cat_id = id_list[0]
|
11
|
+
sub_id = id_list[0..1].join('.')
|
12
|
+
category_map[cat_id] ? category_map[cat_id] << key : category_map[cat_id] = [key]
|
13
|
+
category_map[sub_id] ? category_map[sub_id] << key : category_map[sub_id] = [key]
|
10
14
|
end
|
11
15
|
category_map
|
12
16
|
end
|
data/lib/vrt/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: vrt
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.4.
|
4
|
+
version: 0.4.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Barnett Klane
|
@@ -10,7 +10,7 @@ authors:
|
|
10
10
|
autorequire:
|
11
11
|
bindir: bin
|
12
12
|
cert_chain: []
|
13
|
-
date: 2017-12-
|
13
|
+
date: 2017-12-15 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: bundler
|
@@ -137,7 +137,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
137
137
|
version: '0'
|
138
138
|
requirements: []
|
139
139
|
rubyforge_project:
|
140
|
-
rubygems_version: 2.
|
140
|
+
rubygems_version: 2.6.12
|
141
141
|
signing_key:
|
142
142
|
specification_version: 4
|
143
143
|
summary: Ruby wrapper for Bugcrowd's Vulnerability Rating Taxonomy
|