forked from rubysec/ruby-advisory-db
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Rakefile
41 lines (32 loc) · 854 Bytes
/
Rakefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
require 'yaml'
require 'codesake-dawn'
namespace :lint do
begin
gem 'rspec', '~> 2.4'
require 'rspec/core/rake_task'
RSpec::Core::RakeTask.new(:yaml)
rescue LoadError => e
task :spec do
abort "Please run `gem install rspec` to install RSpec."
end
end
task :dawn do
Dir.glob('gems/*/*.yml') do |path|
advisory = YAML.load_file(path)
if advisory['cve']
cve = "CVE-"+advisory['cve']
puts "CVE #{cve} NOT in dawn v#{Codesake::Dawn::VERSION} knowledge base" unless Codesake::Dawn::KnowledgeBase.new.find(cve)
end
end
end
task :cve do
Dir.glob('gems/*/*.yml') do |path|
advisory = YAML.load_file(path)
unless advisory['cve']
puts "Missing CVE: #{path}"
end
end
end
end
task :lint => ['lint:yaml', 'lint:cve']
task :default => :lint