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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: f22ed952810213fc68ae4da65da024233dd76f6c
4
- data.tar.gz: c517cd4bdc30fb87c1a985b8fe0167ed95eaf5ac
3
+ metadata.gz: 883f1b111f0d07e0f3cfd8fee0382c06b5df6d97
4
+ data.tar.gz: 6c29c4d366a9dc48a5e9a4f080fd8e4e13c72a0b
5
5
  SHA512:
6
- metadata.gz: 4e1537e271c74309332c3df8110936f2c8101aaed8f50bd14fd8b7ea74c2db6cf0f7ebcf3560055fac99037b35bcd1a51e71a000c133ed6c0f44c9e56ea6788d
7
- data.tar.gz: 4c5cf89fe55f63c035bc6b15e9e00d2a43ffe05eac36ad935e31f7467d8200f327bb2e5fa5c5ec28f0c2553d41ce78aa3c9da9fca25fce4eee9f3045c6f48f38
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.select { |key, _value| categories.include?(key) }.values.flatten
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
- id = value[latest_version].split('.')[0]
9
- category_map[id] ? category_map[id] << key : category_map[id] = [key]
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
@@ -1,3 +1,3 @@
1
1
  module Vrt
2
- VERSION = '0.4.3'.freeze
2
+ VERSION = '0.4.4'.freeze
3
3
  end
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.3
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-07 00:00:00.000000000 Z
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.5.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