nvd_feed_api 0.5.0 → 0.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/Gemfile +1 -1
- data/Gemfile.lock +30 -30
- data/lib/nvd_feed_api/feed.rb +26 -27
- data/lib/nvd_feed_api/version.rb +1 -1
- data/lib/nvd_feed_api.rb +3 -4
- data/pages/CHANGELOG.md +10 -1
- data/pages/INSTALL.md +23 -23
- data/test/test_nvd_feed_api.rb +7 -7
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 77fb8e2cb880ccd6376de4a63dc9ca016a3553cb8b52ad28463a6db7c8f28203
|
4
|
+
data.tar.gz: a6efdc897b58302b4fc8bf3f49a1cb31f3e00dcaa7deafcac9c1dc5e0642dfd9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8d2795f2b8b16563df4b8af0980fecdf167de7c875b4bc1c944931a65cebf02ee0ff689b299307bb3ec51c985c29cc2e830e5e01286095ccbb11167662f978ce
|
7
|
+
data.tar.gz: 3c9d6acb0c8a2736fd416dc4b6b6431f90a7f7ce30d1c748e85892f2c27e6c88e85082cbf2e0f6be39c90bab81d7179bd3010ff9930dbff8341edac3952b07e3
|
data/Gemfile
CHANGED
data/Gemfile.lock
CHANGED
@@ -9,7 +9,7 @@ GIT
|
|
9
9
|
PATH
|
10
10
|
remote: .
|
11
11
|
specs:
|
12
|
-
nvd_feed_api (0.
|
12
|
+
nvd_feed_api (0.6.0)
|
13
13
|
archive-zip (~> 0.11)
|
14
14
|
nokogiri (~> 1.11)
|
15
15
|
oj (>= 3.7.8, < 4)
|
@@ -17,46 +17,46 @@ PATH
|
|
17
17
|
GEM
|
18
18
|
remote: https://rubygems.org/
|
19
19
|
specs:
|
20
|
-
archive-zip (0.
|
21
|
-
io-like (~> 0.
|
20
|
+
archive-zip (0.13.0.pre1)
|
21
|
+
io-like (~> 0.4.0.pre1)
|
22
22
|
ast (2.4.3)
|
23
23
|
bigdecimal (3.1.9)
|
24
|
-
commonmarker (2.
|
24
|
+
commonmarker (2.3.0)
|
25
25
|
rb_sys (~> 0.9)
|
26
|
-
commonmarker (2.
|
27
|
-
commonmarker (2.
|
28
|
-
commonmarker (2.
|
29
|
-
commonmarker (2.
|
30
|
-
commonmarker (2.
|
31
|
-
commonmarker (2.
|
32
|
-
io-like (0.
|
33
|
-
json (2.
|
34
|
-
language_server-protocol (3.17.0.
|
26
|
+
commonmarker (2.3.0-aarch64-linux)
|
27
|
+
commonmarker (2.3.0-aarch64-linux-musl)
|
28
|
+
commonmarker (2.3.0-arm64-darwin)
|
29
|
+
commonmarker (2.3.0-x86_64-darwin)
|
30
|
+
commonmarker (2.3.0-x86_64-linux)
|
31
|
+
commonmarker (2.3.0-x86_64-linux-musl)
|
32
|
+
io-like (0.4.0.pre1)
|
33
|
+
json (2.12.0)
|
34
|
+
language_server-protocol (3.17.0.5)
|
35
35
|
lint_roller (1.1.0)
|
36
|
-
logger (1.
|
36
|
+
logger (1.7.0)
|
37
37
|
minitest (5.25.5)
|
38
|
-
nokogiri (1.18.
|
38
|
+
nokogiri (1.18.8-aarch64-linux-gnu)
|
39
39
|
racc (~> 1.4)
|
40
|
-
nokogiri (1.18.
|
40
|
+
nokogiri (1.18.8-aarch64-linux-musl)
|
41
41
|
racc (~> 1.4)
|
42
|
-
nokogiri (1.18.
|
42
|
+
nokogiri (1.18.8-arm-linux-gnu)
|
43
43
|
racc (~> 1.4)
|
44
|
-
nokogiri (1.18.
|
44
|
+
nokogiri (1.18.8-arm-linux-musl)
|
45
45
|
racc (~> 1.4)
|
46
|
-
nokogiri (1.18.
|
46
|
+
nokogiri (1.18.8-arm64-darwin)
|
47
47
|
racc (~> 1.4)
|
48
|
-
nokogiri (1.18.
|
48
|
+
nokogiri (1.18.8-x86_64-darwin)
|
49
49
|
racc (~> 1.4)
|
50
|
-
nokogiri (1.18.
|
50
|
+
nokogiri (1.18.8-x86_64-linux-gnu)
|
51
51
|
racc (~> 1.4)
|
52
|
-
nokogiri (1.18.
|
52
|
+
nokogiri (1.18.8-x86_64-linux-musl)
|
53
53
|
racc (~> 1.4)
|
54
54
|
oj (3.16.10)
|
55
55
|
bigdecimal (>= 3.0)
|
56
56
|
ostruct (>= 0.2)
|
57
57
|
ostruct (0.6.1)
|
58
|
-
parallel (1.
|
59
|
-
parser (3.3.
|
58
|
+
parallel (1.27.0)
|
59
|
+
parser (3.3.8.0)
|
60
60
|
ast (~> 2.4.1)
|
61
61
|
racc
|
62
62
|
prism (1.4.0)
|
@@ -67,7 +67,7 @@ GEM
|
|
67
67
|
rb_sys (0.9.111)
|
68
68
|
rake-compiler-dock (= 1.9.1)
|
69
69
|
regexp_parser (2.10.0)
|
70
|
-
rubocop (1.75.
|
70
|
+
rubocop (1.75.7)
|
71
71
|
json (~> 2.3)
|
72
72
|
language_server-protocol (~> 3.17.0.2)
|
73
73
|
lint_roller (~> 1.1.0)
|
@@ -75,15 +75,15 @@ GEM
|
|
75
75
|
parser (>= 3.3.0.2)
|
76
76
|
rainbow (>= 2.2.2, < 4.0)
|
77
77
|
regexp_parser (>= 2.9.3, < 3.0)
|
78
|
-
rubocop-ast (>= 1.
|
78
|
+
rubocop-ast (>= 1.44.0, < 2.0)
|
79
79
|
ruby-progressbar (~> 1.7)
|
80
80
|
unicode-display_width (>= 2.4.0, < 4.0)
|
81
|
-
rubocop-ast (1.
|
81
|
+
rubocop-ast (1.44.1)
|
82
82
|
parser (>= 3.3.7.2)
|
83
83
|
prism (~> 1.4)
|
84
|
-
rubocop-minitest (0.
|
84
|
+
rubocop-minitest (0.38.0)
|
85
85
|
lint_roller (~> 1.1)
|
86
|
-
rubocop (>= 1.
|
86
|
+
rubocop (>= 1.75.0, < 2.0)
|
87
87
|
rubocop-ast (>= 1.38.0, < 2.0)
|
88
88
|
ruby-progressbar (1.13.0)
|
89
89
|
unicode-display_width (3.1.4)
|
@@ -101,7 +101,7 @@ PLATFORMS
|
|
101
101
|
x86_64-linux-musl
|
102
102
|
|
103
103
|
DEPENDENCIES
|
104
|
-
archive-zip (
|
104
|
+
archive-zip (= 0.13.0.pre1)
|
105
105
|
bundler (~> 2.1)
|
106
106
|
commonmarker (~> 2.0)
|
107
107
|
logger (< 2.0)
|
data/lib/nvd_feed_api/feed.rb
CHANGED
@@ -34,17 +34,17 @@ class NVDFeedScraper
|
|
34
34
|
|
35
35
|
# @return [String] the URL of the metadata file of the feed.
|
36
36
|
# @example
|
37
|
-
# 'https://
|
37
|
+
# 'https://nvd.nist.gov/feeds/json/cve/2.0/nvdcve-2.0-2007.meta'
|
38
38
|
attr_reader :meta_url
|
39
39
|
|
40
40
|
# @return [String] the URL of the gz archive of the feed.
|
41
41
|
# @example
|
42
|
-
# 'https://
|
42
|
+
# 'https://nvd.nist.gov/feeds/json/cve/2.0/nvdcve-2.0-2007.json.gz'
|
43
43
|
attr_reader :gz_url
|
44
44
|
|
45
45
|
# @return [String] the URL of the zip archive of the feed.
|
46
46
|
# @example
|
47
|
-
# 'https://
|
47
|
+
# 'https://nvd.nist.gov/feeds/json/cve/2.0/nvdcve-2.0-2007.json.zip'
|
48
48
|
attr_reader :zip_url
|
49
49
|
|
50
50
|
# @return [Meta] the {Meta} object of the feed.
|
@@ -170,11 +170,11 @@ class NVDFeedScraper
|
|
170
170
|
# Set data
|
171
171
|
if @data_type.nil?
|
172
172
|
doc = Oj::Doc.open(File.read(@json_file))
|
173
|
-
@data_type = doc.fetch('/CVE_data_type')
|
174
|
-
@data_format = doc.fetch('/
|
175
|
-
@data_version = doc.fetch('/
|
176
|
-
@data_number_of_cves = doc.fetch('/
|
177
|
-
@data_timestamp = Date.strptime(doc.fetch('/
|
173
|
+
@data_type = 'CVE' # @data_type was doc.fetch('/CVE_data_type') in 1.1 schema but was removed in 2.0 so keep this string for retrocompatibility
|
174
|
+
@data_format = doc.fetch('/format')
|
175
|
+
@data_version = doc.fetch('/version').to_f
|
176
|
+
@data_number_of_cves = doc.fetch('/totalResults').to_i
|
177
|
+
@data_timestamp = Date.strptime(doc.fetch('/timestamp'), '%FT%T.%N')
|
178
178
|
doc.close
|
179
179
|
end
|
180
180
|
else
|
@@ -189,11 +189,11 @@ class NVDFeedScraper
|
|
189
189
|
|
190
190
|
# update data
|
191
191
|
doc = Oj::Doc.open(File.read(@json_file))
|
192
|
-
@data_type = doc.fetch('/CVE_data_type')
|
193
|
-
@data_format = doc.fetch('/
|
194
|
-
@data_version = doc.fetch('/
|
195
|
-
@data_number_of_cves = doc.fetch('/
|
196
|
-
@data_timestamp = Date.strptime(doc.fetch('/
|
192
|
+
@data_type = 'CVE' # @data_type was doc.fetch('/CVE_data_type') in 1.1 schema but was removed in 2.0 so keep this string for retrocompatibility
|
193
|
+
@data_format = doc.fetch('/format')
|
194
|
+
@data_version = doc.fetch('/version').to_f
|
195
|
+
@data_number_of_cves = doc.fetch('/totalResults').to_i
|
196
|
+
@data_timestamp = Date.strptime(doc.fetch('/timestamp'), '%FT%T.%N')
|
197
197
|
doc.close
|
198
198
|
end
|
199
199
|
return @json_file
|
@@ -215,8 +215,7 @@ class NVDFeedScraper
|
|
215
215
|
# @return [Array] an Array of CVE, each CVE is a Ruby Hash. May not be in the same order as provided.
|
216
216
|
# @note {#json_pull} is needed before using this method. Remember you're searching only in the current feed.
|
217
217
|
# @todo implement a CVE Class instead of returning a Hash.
|
218
|
-
# @see https://
|
219
|
-
# @see https://scap.nist.gov/schema/nvd/feed/0.1/CVE_JSON_4.0_min.schema
|
218
|
+
# @see https://csrc.nist.gov/schema/nvd/api/2.0/cve_api_json_2.0.schema
|
220
219
|
# @example
|
221
220
|
# s = NVDFeedScraper.new
|
222
221
|
# s.scrap
|
@@ -236,10 +235,10 @@ class NVDFeedScraper
|
|
236
235
|
raise "bad CVE name (#{arg_cve[0]})" unless /^CVE-[0-9]{4}-[0-9]{4,}$/i.match?(arg_cve[0])
|
237
236
|
|
238
237
|
doc = Oj::Doc.open(File.read(@json_file))
|
239
|
-
# Quicker than doc.fetch('/
|
238
|
+
# Quicker than doc.fetch('/vulnerabilities').size
|
240
239
|
(1..@data_number_of_cves).each do |i|
|
241
|
-
if arg_cve[0].upcase == doc.fetch("/
|
242
|
-
return_value = doc.fetch("/
|
240
|
+
if arg_cve[0].upcase == doc.fetch("/vulnerabilities/#{i}/cve/id")
|
241
|
+
return_value = doc.fetch("/vulnerabilities/#{i}")
|
243
242
|
break
|
244
243
|
end
|
245
244
|
end
|
@@ -253,10 +252,10 @@ class NVDFeedScraper
|
|
253
252
|
raise 'bad CVE name' unless cves_to_find.all? { |x| /^CVE-[0-9]{4}-[0-9]{4,}$/i.match?(x) }
|
254
253
|
|
255
254
|
doc = Oj::Doc.open(File.read(@json_file))
|
256
|
-
# Quicker than doc.fetch('/
|
255
|
+
# Quicker than doc.fetch('/vulnerabilities').size
|
257
256
|
(1..@data_number_of_cves).each do |i|
|
258
|
-
doc.move("/
|
259
|
-
cve_id = doc.fetch('cve/
|
257
|
+
doc.move("/vulnerabilities/#{i}")
|
258
|
+
cve_id = doc.fetch('cve/id')
|
260
259
|
if cves_to_find.include?(cve_id)
|
261
260
|
return_value.push(doc.fetch)
|
262
261
|
cves_to_find.delete(cve_id)
|
@@ -283,11 +282,11 @@ class NVDFeedScraper
|
|
283
282
|
raise "json_file (#{@json_file}) doesn't exist" unless File.file?(@json_file)
|
284
283
|
|
285
284
|
doc = Oj::Doc.open(File.read(@json_file))
|
286
|
-
# Quicker than doc.fetch('/
|
285
|
+
# Quicker than doc.fetch('/vulnerabilities').size
|
287
286
|
cve_names = []
|
288
287
|
(1..@data_number_of_cves).each do |i|
|
289
|
-
doc.move("/
|
290
|
-
cve_names.push(doc.fetch('cve/
|
288
|
+
doc.move("/vulnerabilities/#{i}")
|
289
|
+
cve_names.push(doc.fetch('cve/id'))
|
291
290
|
end
|
292
291
|
doc.close
|
293
292
|
return cve_names
|
@@ -316,7 +315,7 @@ class NVDFeedScraper
|
|
316
315
|
# @param arg_meta_url [String] the new URL of the metadata file of the feed.
|
317
316
|
# @return [String] the new URL of the metadata file of the feed.
|
318
317
|
# @example
|
319
|
-
# 'https://
|
318
|
+
# 'https://nvd.nist.gov/feeds/json/cve/2.0/nvdcve-2.0-2007.meta'
|
320
319
|
def meta_url=(arg_meta_url)
|
321
320
|
raise "meta_url (#{arg_meta_url}) is not a string" unless arg_meta_url.is_a?(String)
|
322
321
|
|
@@ -326,7 +325,7 @@ class NVDFeedScraper
|
|
326
325
|
# @param arg_gz_url [String] the new URL of the gz archive of the feed.
|
327
326
|
# @return [String] the new URL of the gz archive of the feed.
|
328
327
|
# @example
|
329
|
-
# 'https://
|
328
|
+
# 'https://nvd.nist.gov/feeds/json/cve/2.0/nvdcve-2.0-2007.json.gz'
|
330
329
|
def gz_url=(arg_gz_url)
|
331
330
|
raise "gz_url (#{arg_gz_url}) is not a string" unless arg_gz_url.is_a?(String)
|
332
331
|
|
@@ -336,7 +335,7 @@ class NVDFeedScraper
|
|
336
335
|
# @param arg_zip_url [String] the new URL of the zip archive of the feed.
|
337
336
|
# @return [String] the new URL of the zip archive of the feed.
|
338
337
|
# @example
|
339
|
-
# 'https://
|
338
|
+
# 'https://nvd.nist.gov/feeds/json/cve/2.0/nvdcve-2.0-2007.json.zip'
|
340
339
|
def zip_url=(arg_zip_url)
|
341
340
|
raise "zip_url (#{arg_zip_url}) is not a string" unless arg_zip_url.is_a?(String)
|
342
341
|
|
data/lib/nvd_feed_api/version.rb
CHANGED
data/lib/nvd_feed_api.rb
CHANGED
@@ -42,7 +42,7 @@ class NVDFeedScraper
|
|
42
42
|
doc = Nokogiri::HTML(html)
|
43
43
|
@feeds = []
|
44
44
|
tmp_feeds = {}
|
45
|
-
doc.css('
|
45
|
+
doc.css('div[data-testid=nvd-json-2-feed-table] table.xml-feed-table tr[data-testid]').each do |tr|
|
46
46
|
num, type = tr.attr('data-testid')[13..].split('-')
|
47
47
|
case type
|
48
48
|
when 'meta'
|
@@ -130,7 +130,7 @@ class NVDFeedScraper
|
|
130
130
|
# Return a list with the name of all available feeds. Returned feed names can be use as argument for {#feeds} method. Can only be called after {#scrap}.
|
131
131
|
# @return [Array<String>] List with the name of all available feeds.
|
132
132
|
# @example
|
133
|
-
# scraper.available_feeds => ["CVE-Modified", "CVE-Recent", "CVE-
|
133
|
+
# scraper.available_feeds => ["CVE-Modified", "CVE-Recent", "CVE-2025", "[…]", "CVE-2002"]
|
134
134
|
def available_feeds
|
135
135
|
raise 'call scrap method before using available_feeds method' if @feeds.nil?
|
136
136
|
|
@@ -153,8 +153,7 @@ class NVDFeedScraper
|
|
153
153
|
# @return [Array] an Array of CVE, each CVE is a Ruby Hash.
|
154
154
|
# @todo implement a CVE Class instead of returning a Hash. May not be in the same order as provided.
|
155
155
|
# @note {#scrap} is needed before using this method.
|
156
|
-
# @see https://
|
157
|
-
# @see https://scap.nist.gov/schema/nvd/feed/0.1/CVE_JSON_4.0_min.schema
|
156
|
+
# @see https://csrc.nist.gov/schema/nvd/api/2.0/cve_api_json_2.0.schema
|
158
157
|
# @example
|
159
158
|
# s = NVDFeedScraper.new
|
160
159
|
# s.scrap
|
data/pages/CHANGELOG.md
CHANGED
@@ -1,3 +1,12 @@
|
|
1
|
+
# [0.6.0] - 29 May 2025
|
2
|
+
|
3
|
+
- Enhancements and fixes:
|
4
|
+
- migrating from CVE JSON 1.1 to 2.0 spec
|
5
|
+
- 1.1 feeds will be removed in the future
|
6
|
+
- 1.1 feeds do not contain Deferred status CVEs
|
7
|
+
- Chore:
|
8
|
+
- Update dependencies
|
9
|
+
|
1
10
|
# [0.5.0] - 30 March 2025
|
2
11
|
|
3
12
|
- Breaking changes:
|
@@ -85,7 +94,7 @@
|
|
85
94
|
|
86
95
|
[0.0.1.rc2]: https://gitlab.com/noraj/nvd_api/tags/v0.0.1.rc2
|
87
96
|
|
88
|
-
- Add some contribution guidelines,
|
97
|
+
- Add some contribution guidelines, issues and MR templates.
|
89
98
|
- Improve the README to be a good entrypoint.
|
90
99
|
- Improve the FEATURES.
|
91
100
|
|
data/pages/INSTALL.md
CHANGED
@@ -4,42 +4,42 @@
|
|
4
4
|
|
5
5
|
### Install from rubygems.org
|
6
6
|
|
7
|
-
```
|
8
|
-
|
7
|
+
```bash
|
8
|
+
gem install nvd_feed_api
|
9
9
|
```
|
10
10
|
|
11
11
|
## Development
|
12
12
|
|
13
|
-
It's better to use [rbenv](https://github.com/rbenv/rbenv) to have latests version of ruby and to avoid trashing your system ruby.
|
13
|
+
It's better to use [rbenv](https://github.com/rbenv/rbenv) or [asdf-vm](https://asdf-vm.com/) to have latests version of ruby and to avoid trashing your system ruby.
|
14
14
|
|
15
15
|
### Install from rubygems.org
|
16
16
|
|
17
|
-
```
|
18
|
-
|
17
|
+
```bash
|
18
|
+
gem install --development nvd_feed_api
|
19
19
|
```
|
20
20
|
|
21
21
|
### Build from git
|
22
22
|
|
23
23
|
Just replace `x.x.x` with the gem version you see after `gem build`.
|
24
24
|
|
25
|
-
```
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
25
|
+
```bash
|
26
|
+
git clone https://gitlab.com/noraj/nvd_api.git nvd_feed_api
|
27
|
+
cd nvd_feed_api
|
28
|
+
gem install bundle
|
29
|
+
./bin/nvd_feed_api_setup
|
30
|
+
rake install
|
31
31
|
```
|
32
32
|
|
33
33
|
You can use `nvd_feed_api_console` to launch `irb` with the API required.
|
34
34
|
|
35
35
|
Alternatively to build you can use:
|
36
36
|
|
37
|
-
```
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
37
|
+
```bash
|
38
|
+
git clone https://gitlab.com/noraj/nvd_api.git nvd_feed_api
|
39
|
+
cd nvd_feed_api
|
40
|
+
gem install bundle
|
41
|
+
gem build nvd_feed_api.gemspec
|
42
|
+
gem install --development nvd_feed_api-x.x.x.gem
|
43
43
|
```
|
44
44
|
|
45
45
|
Note: if an automatic install is needed you can get the version with `$ gem build nvd_feed_api.gemspec | grep Version | cut -d' ' -f4`.
|
@@ -48,10 +48,10 @@ Note: if an automatic install is needed you can get the version with `$ gem buil
|
|
48
48
|
|
49
49
|
Useful when you want to try your changes without building the gem and re-installing it each time.
|
50
50
|
|
51
|
-
```
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
51
|
+
```bash
|
52
|
+
git clone https://gitlab.com/noraj/nvd_api.git nvd_feed_api
|
53
|
+
cd nvd_feed_api
|
54
|
+
gem install bundle
|
55
|
+
./bin/nvd_feed_api_setup
|
56
|
+
irb -Ilib -rnvd_feed_api
|
57
57
|
```
|
data/test/test_nvd_feed_api.rb
CHANGED
@@ -112,9 +112,9 @@ class NVDAPITest < Minitest::Test
|
|
112
112
|
|
113
113
|
def test_feed_attributes
|
114
114
|
name = 'CVE-2010'
|
115
|
-
meta_url = 'https://nvd.nist.gov/feeds/json/cve/
|
116
|
-
gz_url = 'https://nvd.nist.gov/feeds/json/cve/
|
117
|
-
zip_url = 'https://nvd.nist.gov/feeds/json/cve/
|
115
|
+
meta_url = 'https://nvd.nist.gov/feeds/json/cve/2.0/nvdcve-2.0-2010.meta'
|
116
|
+
gz_url = 'https://nvd.nist.gov/feeds/json/cve/2.0/nvdcve-2.0-2010.json.gz'
|
117
|
+
zip_url = 'https://nvd.nist.gov/feeds/json/cve/2.0/nvdcve-2.0-2010.json.zip'
|
118
118
|
f = @s.feeds('CVE-2010')
|
119
119
|
# Test name
|
120
120
|
assert_instance_of(String, f.name, "name doesn't return a string")
|
@@ -250,28 +250,28 @@ class NVDAPITest < Minitest::Test
|
|
250
250
|
end
|
251
251
|
|
252
252
|
def test_meta_parse_noarg
|
253
|
-
m = NVDFeedScraper::Meta.new('https://nvd.nist.gov/feeds/json/cve/
|
253
|
+
m = NVDFeedScraper::Meta.new('https://nvd.nist.gov/feeds/json/cve/2.0/nvdcve-2.0-2015.meta')
|
254
254
|
|
255
255
|
assert_equal(0, m.parse, 'parse method return nothing')
|
256
256
|
end
|
257
257
|
|
258
258
|
def test_meta_parse_witharg
|
259
259
|
m = NVDFeedScraper::Meta.new
|
260
|
-
meta_url = 'https://nvd.nist.gov/feeds/json/cve/
|
260
|
+
meta_url = 'https://nvd.nist.gov/feeds/json/cve/2.0/nvdcve-2.0-2015.meta'
|
261
261
|
|
262
262
|
assert_equal(0, m.parse(meta_url), 'parse method return nothing')
|
263
263
|
end
|
264
264
|
|
265
265
|
def test_meta_url_setter
|
266
266
|
m = NVDFeedScraper::Meta.new
|
267
|
-
meta_url = 'https://nvd.nist.gov/feeds/json/cve/
|
267
|
+
meta_url = 'https://nvd.nist.gov/feeds/json/cve/2.0/nvdcve-2.0-2015.meta'
|
268
268
|
|
269
269
|
assert_equal(meta_url, m.url = meta_url, 'the meta URL is not set correctly')
|
270
270
|
end
|
271
271
|
|
272
272
|
def test_meta_attributes
|
273
273
|
m = NVDFeedScraper::Meta.new
|
274
|
-
meta_url = 'https://nvd.nist.gov/feeds/json/cve/
|
274
|
+
meta_url = 'https://nvd.nist.gov/feeds/json/cve/2.0/nvdcve-2.0-2015.meta'
|
275
275
|
m.url = meta_url
|
276
276
|
m.parse
|
277
277
|
# Test gz_size
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: nvd_feed_api
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.6.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Alexandre ZANNI
|
8
8
|
bindir: bin
|
9
9
|
cert_chain: []
|
10
|
-
date: 2025-
|
10
|
+
date: 2025-05-29 00:00:00.000000000 Z
|
11
11
|
dependencies:
|
12
12
|
- !ruby/object:Gem::Dependency
|
13
13
|
name: archive-zip
|