vrt 0.3.1.pre.rc2 → 0.3.1

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: 41aacbb2870d6371b1bd4f31ceaea3604d0ab0fc
4
- data.tar.gz: 7a534cead651f42ca94aacd814b380d45e808179
3
+ metadata.gz: 0fd5c389eb5bd383a61325e88b698ee26e37e2d8
4
+ data.tar.gz: 7beea5136f462db2243da8063c7c30db955f703f
5
5
  SHA512:
6
- metadata.gz: d560ca672ec885afb547a0c7b7b8b9d7ecf3c8bb472d157ced64b4d10098d97769800a45f32fa9a812f215bafb94865541b4bc5811c9e3232121d20dfdb51582
7
- data.tar.gz: e2ff534d2d256f6814e74f1564218a17af17efd45c8685ffac36cbffd29bec5d95308fac637368363eab2f2111e028331f6381f2946626bff4db4850c486300a
6
+ metadata.gz: 208b805887df9f33a4741ec86c296e8c339012afd24c79c612fc9be16243256ba0296ce9d9bfcc70d15c64737adb7dc95e5349426521e7e66812eb2448c651ca
7
+ data.tar.gz: 91cb49c9d188adee9ea1385cb1ecb0e7b7e5e9ad781f85139d227a9536f7e08b63358cdfbddabcf0476d1b7bea79fd00229da8d5e8584f3946401cb8d93fbfaf
data/lib/vrt.rb CHANGED
@@ -17,7 +17,7 @@ module VRT
17
17
  'name' => 'Other',
18
18
  'priority' => nil,
19
19
  'type' => 'category' }.freeze
20
- MAPPINGS = { cvss_v3: VRT::Mapping::CVSSv3 }.freeze
20
+ MAPPINGS = %i[cvss_v3].freeze
21
21
 
22
22
  @version_json = {}
23
23
  @last_update = {}
@@ -108,7 +108,7 @@ module VRT
108
108
  end
109
109
 
110
110
  def mappings
111
- @mappings ||= Hash[MAPPINGS.map { |name, klass| [name, klass.new] }]
111
+ @mappings ||= Hash[MAPPINGS.map { |name| [name, VRT::Mapping.new(name)] }]
112
112
  end
113
113
 
114
114
  # Cache the VRT contents in-memory, so we're not hitting File I/O multiple times per
@@ -1,7 +1,7 @@
1
1
  module VRT
2
2
  class Mapping
3
3
  def initialize(scheme)
4
- @scheme = scheme
4
+ @scheme = scheme.to_s
5
5
  load_mappings
6
6
  end
7
7
 
@@ -59,11 +59,5 @@ module VRT
59
59
  mapping
60
60
  end
61
61
  end
62
-
63
- class CVSSv3 < Mapping
64
- def initialize
65
- super('cvss_v3')
66
- end
67
- end
68
62
  end
69
63
  end
@@ -23,8 +23,8 @@ module VRT
23
23
  id_list.join('.')
24
24
  end
25
25
 
26
- def cvss_v3
27
- VRT.mappings[:cvss_v3].get(id_list, @version)
26
+ def mappings
27
+ Hash[VRT.mappings.map { |name, map| [name, map.get(id_list, @version)] }]
28
28
  end
29
29
 
30
30
  def id_list
@@ -1,3 +1,3 @@
1
1
  module Vrt
2
- VERSION = '0.3.1-rc2'.freeze
2
+ VERSION = '0.3.1'.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.3.1.pre.rc2
4
+ version: 0.3.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Barnett Klane
@@ -113,9 +113,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
113
113
  version: '0'
114
114
  required_rubygems_version: !ruby/object:Gem::Requirement
115
115
  requirements:
116
- - - ">"
116
+ - - ">="
117
117
  - !ruby/object:Gem::Version
118
- version: 1.3.1
118
+ version: '0'
119
119
  requirements: []
120
120
  rubyforge_project:
121
121
  rubygems_version: 2.5.2